Skip to content

Commit e92147f

Browse files
joerickmayeut
andauthored
[travis-ci] debugging ci failures on travis (#2387)
* [travis-ci] debugging ci failures on travis * [travis-ci] Use JSON to encode env vars * [travis-ci] Use a more broadly compatible before_all command * Drop CIBW_ENABLE=all on Travis windows It doesn't fit into the time limit * [travis-ci] try upgrading certifi to get around SSL errors * Revert "[travis-ci] try upgrading certifi to get around SSL errors" This reverts commit 02eee0e. * [travis-ci] upgrade windows certificates * [travis-ci] re-enable linux builds * Drop CIBW_ENABLE=all on Travis Linux It doesn't fit into the time limit --------- Co-authored-by: mayeut <[email protected]>
1 parent 3bbc772 commit e92147f

File tree

3 files changed

+32
-28
lines changed

3 files changed

+32
-28
lines changed

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
services: docker
1717
env:
1818
- PYTHON=python
19-
- CIBW_ENABLE=all
19+
# a build using CIBW_ENABLE=all does not fit into Travis' time limit,
20+
# so only the defaults are tested
2021

2122
- name: Linux | arm64 | Python 3.12
2223
python: 3.12
@@ -42,10 +43,15 @@ jobs:
4243
os: windows
4344
language: shell
4445
before_install:
46+
# http://woshub.com/updating-trusted-root-certificates-in-windows-10
47+
- certutil -generateSSTFromWU roots.sst
48+
- powershell -Command 'Get-ChildItem -Path roots.sst | Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root'
49+
- rm -f roots.sst
4550
- choco upgrade python3 -y --version 3.12.8 --limit-output --params "/InstallDir:C:\\Python312"
4651
env:
4752
- PYTHON=C:\\Python312\\python
48-
- CIBW_ENABLE=all
53+
# a build using CIBW_ENABLE=all does not fit into Travis' time limit,
54+
# so only the defaults are tested
4955

5056
- name: Linux | s390x | Python 3.12
5157
python: 3.12

cibuildwheel/platforms/windows.py

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
import os
23
import platform as platform_module
34
import shutil
@@ -350,28 +351,22 @@ def setup_python(
350351
text=True,
351352
).strip()
352353
log.notice(f"Discovering Visual Studio for GraalPy at {vcpath}")
353-
env.update(
354-
dict(
355-
[
356-
envvar.strip().split("=", 1)
357-
for envvar in subprocess.check_output(
358-
[
359-
f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat",
360-
"-no_logo",
361-
"-arch=amd64",
362-
"-host_arch=amd64",
363-
"&&",
364-
"set",
365-
],
366-
shell=True,
367-
text=True,
368-
env=env,
369-
)
370-
.strip()
371-
.split("\n")
372-
]
373-
)
354+
vcvars = subprocess.check_output(
355+
[
356+
f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat",
357+
"-no_logo",
358+
"-arch=amd64",
359+
"-host_arch=amd64",
360+
"&&",
361+
"python",
362+
"-c",
363+
"import os, json, sys; json.dump(dict(os.environ), sys.stdout);",
364+
],
365+
shell=True,
366+
text=True,
367+
env=env,
374368
)
369+
env.update(json.loads(vcvars))
375370

376371
return base_python, env
377372

test/test_before_all.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,19 @@ def test(tmp_path):
3636
with (project_dir / "text_info.txt").open(mode="w") as ff:
3737
print("dummy text", file=ff)
3838

39-
# build the wheels
39+
# write python version information to a temporary file, this is checked in
40+
# setup.py
41+
#
42+
# note, before_all runs in whatever the host environment is, `python`
43+
# might be any version of python (even Python 2 on Travis ci!), so this is
44+
# written to be broadly compatible
4045
before_all_command = (
41-
"""python -c "import os, pathlib, sys; pathlib.Path('{project}/text_info.txt').write_text('sample text '+os.environ.get('TEST_VAL', ''))" && """
42-
'''python -c "import pathlib, sys; pathlib.Path('{project}/python_prefix.txt').write_text(sys.prefix)"'''
46+
"""python -c "import os, sys; f = open('{project}/text_info.txt', 'w'); f.write('sample text '+os.environ.get('TEST_VAL', '')); f.close()" && """
47+
'''python -c "import sys; f = open('{project}/python_prefix.txt', 'w'); f.write(sys.prefix); f.close()"'''
4348
)
4449
actual_wheels = utils.cibuildwheel_run(
4550
project_dir,
4651
add_env={
47-
# write python version information to a temporary file, this is
48-
# checked in setup.py
4952
"CIBW_BEFORE_ALL": before_all_command,
5053
"CIBW_BEFORE_ALL_LINUX": f'{before_all_command} && python -c "import sys; assert sys.version_info >= (3, 8)"',
5154
"CIBW_ENVIRONMENT": "TEST_VAL='123'",

0 commit comments

Comments
 (0)