Try fixing installing 32-bit go, and try fixing 32-bit paths in scripts

This commit is contained in:
Micah Lee 2022-03-30 15:52:31 -07:00
parent 1d9ce020e5
commit e77cd6939e
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
3 changed files with 35 additions and 15 deletions

View File

@ -83,7 +83,6 @@ jobs:
command: |
choco install python --version=3.9.12
choco install 7zip
choco install go
- run:
name: Install poetry
command: (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
@ -123,36 +122,37 @@ jobs:
- run:
name: Install chocolately dependencies
command: |
choco install python3 --params "/InstallDir32:C:\Python39-32bit" --version=3.9.12
choco install python3 --params "/InstallDir32:C:\Python-32bit" --version=3.9.12
choco install 7zip
- run:
name: Install golang (32-bit)
command: |
Invoke-WebRequest -Uri https://go.dev/dl/go1.18.windows-386.msi -OutFile ~\Downloads\go1.18.windows-386.msi
msiexec.exe /i "~\Downloads\go1.18.windows-386.msi" /qn
cd ~\Downloads
Invoke-WebRequest -Uri https://go.dev/dl/go1.18.windows-386.msi -OutFile go1.18.windows-386.msi
msiexec.exe /i go1.18.windows-386.msi /quiet /L*V go-install.log
- run:
name: Install poetry (32-bit)
command: C:\Python39-32bit\Scripts\pip install poetry
command: C:\Python-32bit\Scripts\pip install poetry
- run:
name: Install poetry dependencies
command: |
cd ~\project\desktop
C:\Python39-32bit\Scripts\poetry install
C:\Python-32bit\Scripts\poetry install
- run:
name: Get tor
command: |
cd ~\project\desktop
C:\Python39-32bit\Scripts\poetry run python .\scripts\get-tor-windows.py
C:\Python-32bit\Scripts\poetry run python .\scripts\get-tor-windows.py
- run:
name: Build meek
command: |
cd ~\project\desktop
C:\Python39-32bit\python .\scripts\build-meek-client.py
C:\Python-32bit\python .\scripts\build-meek-client.py
- run:
name: Build
command: |
cd ~\project\desktop
C:\Python39-32bit\Scripts\poetry run python .\package\build-windows.py --ci-build
C:\Python-32bit\Scripts\poetry run python .\package\build-windows.py --ci-build
- run:
name: Compress
command: Compress-Archive -LiteralPath ~\project\desktop\build\exe.win32-3.9 -DestinationPath ~\onionshare-win32.zip

View File

@ -162,6 +162,18 @@ def wix_build_components_xml(root, data):
def main():
# Figure out the architecture and python path
if "64 bit" in sys.version:
python_arch = "win-amd64"
else:
python_arch = "win32"
if os.getlogin() == "circleci" and python_arch == "win32":
python_path = "C:\\Python-32bit\\python"
else:
python_path = shutil.which("python")
# Arguments
parser = argparse.ArgumentParser(
formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=48)
)
@ -185,17 +197,13 @@ def main():
print("> Building binaries")
run(
[
"python",
python_path,
"setup-freeze.py",
"build",
],
desktop_dir,
)
if "64 bit" in sys.version:
python_arch = "win-amd64"
else:
python_arch = "win32"
build_path = os.path.join(desktop_dir, "build", f"exe.{python_arch}-3.9")
# before_size = get_size(build_path)

View File

@ -26,13 +26,25 @@ and hard-code the sha256 hash.
"""
import shutil
import os
import sys
import subprocess
import inspect
import platform
def main():
if shutil.which("go") is None:
# Figure out the architecture and python path
if "64 bit" in sys.version:
python_arch = "win-amd64"
else:
python_arch = "win32"
if os.getlogin() == "circleci" and python_arch == "win32":
go_path = "C:\\Program Files (x86)\\Go\\bin\\go"
else:
go_path = shutil.which("go")
if go_path is None:
print("Install go: https://golang.org/doc/install")
return