Drop 32bit Windows release support

See #6050, still keeping open to track NSIS changes
This commit is contained in:
Florian Bruhin 2023-07-27 12:28:24 +02:00
parent 6d84462d68
commit c2210539a9
3 changed files with 31 additions and 80 deletions

View File

@ -19,47 +19,34 @@ jobs:
toxenv: build-release-qt5 toxenv: build-release-qt5
name: qt5-macos name: qt5-macos
- os: windows-2019 - os: windows-2019
args: --64bit
branch: main branch: main
toxenv: build-release-qt5 toxenv: build-release-qt5
name: qt5-windows-64bit name: qt5-windows
- os: windows-2019
args: --32bit
branch: main
toxenv: build-release-qt5
name: qt5-windows-32bit
- os: macos-11 - os: macos-11
args: --debug args: --debug
branch: main branch: main
toxenv: build-release-qt5 toxenv: build-release-qt5
name: qt5-macos-debug name: qt5-macos-debug
- os: windows-2019 - os: windows-2019
args: --64bit --debug args: --debug
branch: main branch: main
toxenv: build-release-qt5 toxenv: build-release-qt5
name: qt5-windows-64bit-debug name: qt5-windows-debug
- os: windows-2019
args: --32bit --debug
branch: main
toxenv: build-release-qt5
name: qt5-windows-32bit-debug
- os: macos-11 - os: macos-11
toxenv: build-release toxenv: build-release
name: macos name: macos
- os: windows-2019 - os: windows-2019
args: --64bit
toxenv: build-release toxenv: build-release
name: windows-64bit name: windows
- os: macos-11 - os: macos-11
args: --debug args: --debug
toxenv: build-release toxenv: build-release
name: macos-debug name: macos-debug
- os: windows-2019 - os: windows-2019
args: --64bit --debug args: --debug
toxenv: build-release toxenv: build-release
name: windows-64bit-debug name: windows-debug
runs-on: "${{ matrix.os }}" runs-on: "${{ matrix.os }}"
timeout-minutes: 45 timeout-minutes: 45
steps: steps:

View File

@ -340,7 +340,7 @@ def build_mac(
gh_token=gh_token) gh_token=gh_token)
utils.print_title("Building .app via pyinstaller") utils.print_title("Building .app via pyinstaller")
call_tox(f'pyinstaller-64bit{"-qt5" if qt5 else ""}', '-r', debug=debug) call_tox(f'pyinstaller{"-qt5" if qt5 else ""}', '-r', debug=debug)
utils.print_title("Patching .app") utils.print_title("Patching .app")
patch_mac_app(qt5=qt5) patch_mac_app(qt5=qt5)
utils.print_title("Re-signing .app") utils.print_title("Re-signing .app")
@ -388,18 +388,14 @@ def build_mac(
] ]
def _get_windows_python_path(x64: bool) -> pathlib.Path: def _get_windows_python_path() -> pathlib.Path:
"""Get the path to Python.exe on Windows.""" """Get the path to Python.exe on Windows."""
parts = str(sys.version_info.major), str(sys.version_info.minor) parts = str(sys.version_info.major), str(sys.version_info.minor)
ver = ''.join(parts) ver = ''.join(parts)
dot_ver = '.'.join(parts) dot_ver = '.'.join(parts)
if x64: path = rf'SOFTWARE\Python\PythonCore\{dot_ver}\InstallPath'
path = rf'SOFTWARE\Python\PythonCore\{dot_ver}\InstallPath' fallback = pathlib.Path('C:', f'Python{ver}', 'python.exe')
fallback = pathlib.Path('C:', f'Python{ver}', 'python.exe')
else:
path = rf'SOFTWARE\WOW6432Node\Python\PythonCore\{dot_ver}-32\InstallPath'
fallback = pathlib.Path('C:', f'Python{ver}-32', 'python.exe')
try: try:
key = winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, path) key = winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, path)
@ -409,47 +405,39 @@ def _get_windows_python_path(x64: bool) -> pathlib.Path:
def _build_windows_single( def _build_windows_single(
*, x64: bool, *,
qt5: bool, qt5: bool,
skip_packaging: bool, skip_packaging: bool,
debug: bool, debug: bool,
) -> List[Artifact]: ) -> List[Artifact]:
"""Build on Windows for a single architecture.""" """Build on Windows for a single build type."""
human_arch = '64-bit' if x64 else '32-bit' utils.print_title("Running pyinstaller")
utils.print_title(f"Running pyinstaller {human_arch}")
dist_path = pathlib.Path("dist") dist_path = pathlib.Path("dist")
arch = "x64" if x64 else "x86" out_path = dist_path / f'qutebrowser-{qutebrowser.__version__}'
out_path = dist_path / f'qutebrowser-{qutebrowser.__version__}-{arch}'
_maybe_remove(out_path) _maybe_remove(out_path)
python = _get_windows_python_path(x64=x64) python = _get_windows_python_path()
suffix = "64bit" if x64 else "32bit" # FIXME:qt6 does this regress 391623d5ec983ecfc4512c7305c4b7a293ac3872?
if qt5: suffix = "-qt5" if qt5 else ""
# FIXME:qt6 does this regress 391623d5ec983ecfc4512c7305c4b7a293ac3872? call_tox(f'pyinstaller{suffix}', '-r', python=python, debug=debug)
suffix += "-qt5"
call_tox(f'pyinstaller-{suffix}', '-r', python=python, debug=debug)
out_pyinstaller = dist_path / "qutebrowser" out_pyinstaller = dist_path / "qutebrowser"
shutil.move(out_pyinstaller, out_path) shutil.move(out_pyinstaller, out_path)
exe_path = out_path / 'qutebrowser.exe' exe_path = out_path / 'qutebrowser.exe'
utils.print_title(f"Verifying {human_arch} exe") utils.print_title("Verifying exe")
verify_windows_exe(exe_path) verify_windows_exe(exe_path)
utils.print_title(f"Running {human_arch} smoke test") utils.print_title("Running smoke test")
smoke_test(exe_path, debug=debug, qt5=qt5) smoke_test(exe_path, debug=debug, qt5=qt5)
if skip_packaging: if skip_packaging:
return [] return []
utils.print_title(f"Packaging {human_arch}") utils.print_title("Packaging")
return _package_windows_single( return _package_windows_single(
nsis_flags=[] if x64 else ['/DX86'],
out_path=out_path, out_path=out_path,
filename_arch='amd64' if x64 else 'win32',
desc_arch=human_arch,
desc_suffix='' if x64 else ' (only for 32-bit Windows!)',
debug=debug, debug=debug,
qt5=qt5, qt5=qt5,
) )
@ -458,8 +446,6 @@ def _build_windows_single(
def build_windows( def build_windows(
*, gh_token: str, *, gh_token: str,
skip_packaging: bool, skip_packaging: bool,
only_32bit: bool,
only_64bit: bool,
qt5: bool, qt5: bool,
debug: bool, debug: bool,
) -> List[Artifact]: ) -> List[Artifact]:
@ -470,37 +456,23 @@ def build_windows(
utils.print_title("Building Windows binaries") utils.print_title("Building Windows binaries")
artifacts = []
from scripts.dev import gen_versioninfo from scripts.dev import gen_versioninfo
utils.print_title("Updating VersionInfo file") utils.print_title("Updating VersionInfo file")
gen_versioninfo.main() gen_versioninfo.main()
if not only_32bit: artifacts = [
artifacts += _build_windows_single( _build_windows_single(
x64=True,
skip_packaging=skip_packaging, skip_packaging=skip_packaging,
debug=debug, debug=debug,
qt5=qt5, qt5=qt5,
) ),
if not only_64bit and qt5: ]
artifacts += _build_windows_single(
x64=False,
skip_packaging=skip_packaging,
debug=debug,
qt5=qt5,
)
return artifacts return artifacts
def _package_windows_single( def _package_windows_single(
*, *,
nsis_flags: List[str],
out_path: pathlib.Path, out_path: pathlib.Path,
desc_arch: str,
desc_suffix: str,
filename_arch: str,
debug: bool, debug: bool,
qt5: bool, qt5: bool,
) -> List[Artifact]: ) -> List[Artifact]:
@ -508,15 +480,14 @@ def _package_windows_single(
artifacts = [] artifacts = []
dist_path = pathlib.Path("dist") dist_path = pathlib.Path("dist")
utils.print_subtitle(f"Building {desc_arch} installer...") utils.print_subtitle("Building installer...")
subprocess.run(['makensis.exe', subprocess.run(['makensis.exe',
f'/DVERSION={qutebrowser.__version__}', *nsis_flags, f'/DVERSION={qutebrowser.__version__}',
'misc/nsis/qutebrowser.nsi'], check=True) 'misc/nsis/qutebrowser.nsi'], check=True)
name_parts = [ name_parts = [
'qutebrowser', 'qutebrowser',
str(qutebrowser.__version__), str(qutebrowser.__version__),
filename_arch,
] ]
if debug: if debug:
name_parts.append('debug') name_parts.append('debug')
@ -527,16 +498,15 @@ def _package_windows_single(
artifacts.append(Artifact( artifacts.append(Artifact(
path=dist_path / name, path=dist_path / name,
mimetype='application/vnd.microsoft.portable-executable', mimetype='application/vnd.microsoft.portable-executable',
description=f'Windows {desc_arch} installer{desc_suffix}', description='Windows installer',
)) ))
utils.print_subtitle(f"Zipping {desc_arch} standalone...") utils.print_subtitle("Zipping standalone...")
zip_name_parts = [ zip_name_parts = [
'qutebrowser', 'qutebrowser',
str(qutebrowser.__version__), str(qutebrowser.__version__),
'windows', 'windows',
'standalone', 'standalone',
filename_arch,
] ]
if debug: if debug:
zip_name_parts.append('debug') zip_name_parts.append('debug')
@ -549,7 +519,7 @@ def _package_windows_single(
artifacts.append(Artifact( artifacts.append(Artifact(
path=zip_path, path=zip_path,
mimetype='application/zip', mimetype='application/zip',
description=f'Windows {desc_arch} standalone{desc_suffix}', description='Windows standalone',
)) ))
return artifacts return artifacts
@ -720,10 +690,6 @@ def main() -> None:
help="Skip confirmation before uploading.") help="Skip confirmation before uploading.")
parser.add_argument('--skip-packaging', action='store_true', required=False, parser.add_argument('--skip-packaging', action='store_true', required=False,
help="Skip Windows installer/zip generation or macOS DMG.") help="Skip Windows installer/zip generation or macOS DMG.")
parser.add_argument('--32bit', action='store_true', required=False,
help="Skip Windows 64 bit build.", dest='only_32bit')
parser.add_argument('--64bit', action='store_true', required=False,
help="Skip Windows 32 bit build.", dest='only_64bit')
parser.add_argument('--debug', action='store_true', required=False, parser.add_argument('--debug', action='store_true', required=False,
help="Build a debug build.") help="Build a debug build.")
parser.add_argument('--qt5', action='store_true', required=False, parser.add_argument('--qt5', action='store_true', required=False,
@ -754,8 +720,6 @@ def main() -> None:
artifacts = build_windows( artifacts = build_windows(
gh_token=gh_token, gh_token=gh_token,
skip_packaging=args.skip_packaging, skip_packaging=args.skip_packaging,
only_32bit=args.only_32bit,
only_64bit=args.only_64bit,
qt5=args.qt5, qt5=args.qt5,
debug=args.debug, debug=args.debug,
) )

View File

@ -181,7 +181,7 @@ commands =
{envpython} scripts/dev/check_doc_changes.py {posargs} {envpython} scripts/dev/check_doc_changes.py {posargs}
{envpython} scripts/asciidoc2html.py {posargs} {envpython} scripts/asciidoc2html.py {posargs}
[testenv:pyinstaller-{64bit,32bit}{,-qt5}] [testenv:pyinstaller{,-qt5}]
basepython = {env:PYTHON:python3} basepython = {env:PYTHON:python3}
passenv = passenv =
APPDATA APPDATA