From 71054ac2a3fc1bc5681561583ddd962e174d01cc Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sat, 10 May 2025 16:16:24 +0100 Subject: [PATCH 1/9] [travis-ci] debugging ci failures on travis --- cibuildwheel/platforms/windows.py | 36 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/cibuildwheel/platforms/windows.py b/cibuildwheel/platforms/windows.py index 4e59275bf..8d1227741 100644 --- a/cibuildwheel/platforms/windows.py +++ b/cibuildwheel/platforms/windows.py @@ -2,6 +2,7 @@ import platform as platform_module import shutil import subprocess +import sys import textwrap from collections.abc import MutableMapping, Set from dataclasses import dataclass @@ -350,28 +351,25 @@ def setup_python( text=True, ).strip() log.notice(f"Discovering Visual Studio for GraalPy at {vcpath}") - env.update( - dict( + vcvars = ( + subprocess.check_output( [ - envvar.strip().split("=", 1) - for envvar in subprocess.check_output( - [ - f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat", - "-no_logo", - "-arch=amd64", - "-host_arch=amd64", - "&&", - "set", - ], - shell=True, - text=True, - env=env, - ) - .strip() - .split("\n") - ] + f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat", + "-no_logo", + "-arch=amd64", + "-host_arch=amd64", + "&&", + "set", + ], + shell=True, + text=True, + env=env, ) + .strip() + .split("\n") ) + print("vcvars", vcvars, file=sys.stderr) + env.update(dict([envvar.strip().split("=", 1) for envvar in vcvars])) return base_python, env From be4faa9d299b6f2000061c46381306c728026865 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 15 May 2025 09:48:12 +0100 Subject: [PATCH 2/9] [travis-ci] Use JSON to encode env vars --- cibuildwheel/platforms/windows.py | 35 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/cibuildwheel/platforms/windows.py b/cibuildwheel/platforms/windows.py index 8d1227741..52e081f76 100644 --- a/cibuildwheel/platforms/windows.py +++ b/cibuildwheel/platforms/windows.py @@ -1,8 +1,8 @@ +import json import os import platform as platform_module import shutil import subprocess -import sys import textwrap from collections.abc import MutableMapping, Set from dataclasses import dataclass @@ -351,25 +351,22 @@ def setup_python( text=True, ).strip() log.notice(f"Discovering Visual Studio for GraalPy at {vcpath}") - vcvars = ( - subprocess.check_output( - [ - f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat", - "-no_logo", - "-arch=amd64", - "-host_arch=amd64", - "&&", - "set", - ], - shell=True, - text=True, - env=env, - ) - .strip() - .split("\n") + vcvars = subprocess.check_output( + [ + f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat", + "-no_logo", + "-arch=amd64", + "-host_arch=amd64", + "&&", + "python", + "-c", + "import os, json, sys; json.dump(dict(os.environ), sys.stdout);", + ], + shell=True, + text=True, + env=env, ) - print("vcvars", vcvars, file=sys.stderr) - env.update(dict([envvar.strip().split("=", 1) for envvar in vcvars])) + env.update(json.loads(vcvars)) return base_python, env From 27a69f5a424e96f74a5b87c9ef5186c977813e92 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Fri, 16 May 2025 12:43:29 +0100 Subject: [PATCH 3/9] [travis-ci] Use a more broadly compatible before_all command --- test/test_before_all.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/test_before_all.py b/test/test_before_all.py index c7ec86240..f0c89972b 100644 --- a/test/test_before_all.py +++ b/test/test_before_all.py @@ -36,16 +36,19 @@ def test(tmp_path): with (project_dir / "text_info.txt").open(mode="w") as ff: print("dummy text", file=ff) - # build the wheels + # write python version information to a temporary file, this is checked in + # setup.py + # + # note, before_all runs in whatever the host environment is, `python` + # might be any version of python (even Python 2 on Travis ci!), so this is + # written to be broadly compatible before_all_command = ( - """python -c "import os, pathlib, sys; pathlib.Path('{project}/text_info.txt').write_text('sample text '+os.environ.get('TEST_VAL', ''))" && """ - '''python -c "import pathlib, sys; pathlib.Path('{project}/python_prefix.txt').write_text(sys.prefix)"''' + """python -c "import os, sys; f = open('{project}/text_info.txt', 'w'); f.write('sample text '+os.environ.get('TEST_VAL', '')); f.close()" && """ + '''python -c "import sys; f = open('{project}/python_prefix.txt', 'w'); f.write(sys.prefix); f.close()"''' ) actual_wheels = utils.cibuildwheel_run( project_dir, add_env={ - # write python version information to a temporary file, this is - # checked in setup.py "CIBW_BEFORE_ALL": before_all_command, "CIBW_BEFORE_ALL_LINUX": f'{before_all_command} && python -c "import sys; assert sys.version_info >= (3, 8)"', "CIBW_ENVIRONMENT": "TEST_VAL='123'", From 59020a571637d06cc6f190ede9b452986525606e Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sun, 18 May 2025 21:32:14 +0100 Subject: [PATCH 4/9] Drop CIBW_ENABLE=all on Travis windows It doesn't fit into the time limit --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e4d1d72a3..d2b774261 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,8 @@ jobs: - choco upgrade python3 -y --version 3.12.8 --limit-output --params "/InstallDir:C:\\Python312" env: - PYTHON=C:\\Python312\\python - - CIBW_ENABLE=all + # a build using CIBW_ENABLE=all does not fit into Travis' time limit, + # so only the defaults are tested - name: Linux | s390x | Python 3.12 python: 3.12 From 02eee0e1946d2116d1ce23ccd86945ad33d1ae24 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 22 May 2025 11:11:32 +0100 Subject: [PATCH 5/9] [travis-ci] try upgrading certifi to get around SSL errors --- cibuildwheel/platforms/windows.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cibuildwheel/platforms/windows.py b/cibuildwheel/platforms/windows.py index 52e081f76..16e7b04c9 100644 --- a/cibuildwheel/platforms/windows.py +++ b/cibuildwheel/platforms/windows.py @@ -277,6 +277,16 @@ def setup_python( use_uv=use_uv, ) + print("Updating certifi...") + call( + "pip", + "install", + "--upgrade", + "certifi", + *constraint_flags(dependency_constraint), + env=env, + ) + # set up environment variables for run_with_env env["PYTHON_VERSION"] = python_configuration.version env["PYTHON_ARCH"] = python_configuration.arch From dd55e8b785f95d2613dd5e384745855ef4516752 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 25 May 2025 14:26:30 +0200 Subject: [PATCH 6/9] Revert "[travis-ci] try upgrading certifi to get around SSL errors" This reverts commit 02eee0e1946d2116d1ce23ccd86945ad33d1ae24. --- cibuildwheel/platforms/windows.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/cibuildwheel/platforms/windows.py b/cibuildwheel/platforms/windows.py index 16e7b04c9..52e081f76 100644 --- a/cibuildwheel/platforms/windows.py +++ b/cibuildwheel/platforms/windows.py @@ -277,16 +277,6 @@ def setup_python( use_uv=use_uv, ) - print("Updating certifi...") - call( - "pip", - "install", - "--upgrade", - "certifi", - *constraint_flags(dependency_constraint), - env=env, - ) - # set up environment variables for run_with_env env["PYTHON_VERSION"] = python_configuration.version env["PYTHON_ARCH"] = python_configuration.arch From ff49719e7e266618fa116bf488ce590f7ba783d3 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 25 May 2025 14:47:59 +0200 Subject: [PATCH 7/9] [travis-ci] upgrade windows certificates --- .travis.yml | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2b774261..de955c584 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,52 +11,20 @@ if: (type = "push") OR (commit_message =~ /travis-ci/) jobs: include: - - name: Linux | x86_64 + i686 | Python 3.12 - python: 3.12 - services: docker - env: - - PYTHON=python - - CIBW_ENABLE=all - - - name: Linux | arm64 | Python 3.12 - python: 3.12 - services: docker - arch: arm64 - env: - - PYTHON=python - - CIBW_ENABLE=all - - - name: Linux | ppc64le | Python 3.12 - python: 3.12 - services: docker - arch: ppc64le - allow_failure: True - env: - - PYTHON=python - # skip test_manylinuxXXXX_only, it uses too much disk space - # c.f. https://travis-ci.community/t/running-out-of-disk-space-quota-when-using-docker-on-ppc64le/11634 - - PYTEST_ADDOPTS='-k "not test_manylinuxXXXX_only"' - - CIBW_ENABLE=all - - name: Windows | x86_64 | Python 3.12 os: windows language: shell before_install: + # http://woshub.com/updating-trusted-root-certificates-in-windows-10 + - certutil -generateSSTFromWU roots.sst + - powershell -Command 'Get-ChildItem -Path roots.sst | Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root' + - rm -f roots.sst - choco upgrade python3 -y --version 3.12.8 --limit-output --params "/InstallDir:C:\\Python312" env: - PYTHON=C:\\Python312\\python # a build using CIBW_ENABLE=all does not fit into Travis' time limit, # so only the defaults are tested - - name: Linux | s390x | Python 3.12 - python: 3.12 - services: docker - arch: s390x - allow_failure: True - env: - - PYTHON=python - - CIBW_ENABLE=all - install: - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all; fi - $PYTHON -m pip install -U pip dependency-groups From 1f129d9f31930e8c3b57dea1b77c6362b519abf0 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 25 May 2025 16:03:30 +0200 Subject: [PATCH 8/9] [travis-ci] re-enable linux builds --- .travis.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.travis.yml b/.travis.yml index de955c584..fa8e3c054 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,33 @@ if: (type = "push") OR (commit_message =~ /travis-ci/) jobs: include: + - name: Linux | x86_64 + i686 | Python 3.12 + python: 3.12 + services: docker + env: + - PYTHON=python + - CIBW_ENABLE=all + + - name: Linux | arm64 | Python 3.12 + python: 3.12 + services: docker + arch: arm64 + env: + - PYTHON=python + - CIBW_ENABLE=all + + - name: Linux | ppc64le | Python 3.12 + python: 3.12 + services: docker + arch: ppc64le + allow_failure: True + env: + - PYTHON=python + # skip test_manylinuxXXXX_only, it uses too much disk space + # c.f. https://travis-ci.community/t/running-out-of-disk-space-quota-when-using-docker-on-ppc64le/11634 + - PYTEST_ADDOPTS='-k "not test_manylinuxXXXX_only"' + - CIBW_ENABLE=all + - name: Windows | x86_64 | Python 3.12 os: windows language: shell @@ -25,6 +52,15 @@ jobs: # a build using CIBW_ENABLE=all does not fit into Travis' time limit, # so only the defaults are tested + - name: Linux | s390x | Python 3.12 + python: 3.12 + services: docker + arch: s390x + allow_failure: True + env: + - PYTHON=python + - CIBW_ENABLE=all + install: - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then docker run --rm --privileged docker.io/tonistiigi/binfmt:latest --install all; fi - $PYTHON -m pip install -U pip dependency-groups From 78bc39a0390a8529c795b153282269afe31a0447 Mon Sep 17 00:00:00 2001 From: mayeut Date: Mon, 26 May 2025 07:28:43 +0200 Subject: [PATCH 9/9] Drop CIBW_ENABLE=all on Travis Linux It doesn't fit into the time limit --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fa8e3c054..d2082cc1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,8 @@ jobs: services: docker env: - PYTHON=python - - CIBW_ENABLE=all + # a build using CIBW_ENABLE=all does not fit into Travis' time limit, + # so only the defaults are tested - name: Linux | arm64 | Python 3.12 python: 3.12