Skip to content

[travis-ci] debugging ci failures on travis #2387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ jobs:
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
- 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
Expand Down
37 changes: 16 additions & 21 deletions cibuildwheel/platforms/windows.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import os
import platform as platform_module
import shutil
Expand Down Expand Up @@ -350,28 +351,22 @@ def setup_python(
text=True,
).strip()
log.notice(f"Discovering Visual Studio for GraalPy at {vcpath}")
env.update(
dict(
[
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")
]
)
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,
)
env.update(json.loads(vcvars))

return base_python, env

Expand Down
13 changes: 8 additions & 5 deletions test/test_before_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand Down
Loading