[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 02eee0e1946d2116d1ce23ccd86945ad33d1ae24. * [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 <mayeut@users.noreply.github.com>
This commit is contained in:
+8
-2
@@ -16,7 +16,8 @@ jobs:
|
|||||||
services: docker
|
services: docker
|
||||||
env:
|
env:
|
||||||
- PYTHON=python
|
- 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
|
- name: Linux | arm64 | Python 3.12
|
||||||
python: 3.12
|
python: 3.12
|
||||||
@@ -42,10 +43,15 @@ jobs:
|
|||||||
os: windows
|
os: windows
|
||||||
language: shell
|
language: shell
|
||||||
before_install:
|
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"
|
- choco upgrade python3 -y --version 3.12.8 --limit-output --params "/InstallDir:C:\\Python312"
|
||||||
env:
|
env:
|
||||||
- PYTHON=C:\\Python312\\python
|
- 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
|
- name: Linux | s390x | Python 3.12
|
||||||
python: 3.12
|
python: 3.12
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import platform as platform_module
|
import platform as platform_module
|
||||||
import shutil
|
import shutil
|
||||||
@@ -350,28 +351,22 @@ def setup_python(
|
|||||||
text=True,
|
text=True,
|
||||||
).strip()
|
).strip()
|
||||||
log.notice(f"Discovering Visual Studio for GraalPy at {vcpath}")
|
log.notice(f"Discovering Visual Studio for GraalPy at {vcpath}")
|
||||||
env.update(
|
vcvars = subprocess.check_output(
|
||||||
dict(
|
[
|
||||||
[
|
f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat",
|
||||||
envvar.strip().split("=", 1)
|
"-no_logo",
|
||||||
for envvar in subprocess.check_output(
|
"-arch=amd64",
|
||||||
[
|
"-host_arch=amd64",
|
||||||
f"{vcpath}\\Common7\\Tools\\vsdevcmd.bat",
|
"&&",
|
||||||
"-no_logo",
|
"python",
|
||||||
"-arch=amd64",
|
"-c",
|
||||||
"-host_arch=amd64",
|
"import os, json, sys; json.dump(dict(os.environ), sys.stdout);",
|
||||||
"&&",
|
],
|
||||||
"set",
|
shell=True,
|
||||||
],
|
text=True,
|
||||||
shell=True,
|
env=env,
|
||||||
text=True,
|
|
||||||
env=env,
|
|
||||||
)
|
|
||||||
.strip()
|
|
||||||
.split("\n")
|
|
||||||
]
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
env.update(json.loads(vcvars))
|
||||||
|
|
||||||
return base_python, env
|
return base_python, env
|
||||||
|
|
||||||
|
|||||||
@@ -36,16 +36,19 @@ def test(tmp_path):
|
|||||||
with (project_dir / "text_info.txt").open(mode="w") as ff:
|
with (project_dir / "text_info.txt").open(mode="w") as ff:
|
||||||
print("dummy text", file=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 = (
|
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 os, sys; f = open('{project}/text_info.txt', 'w'); f.write('sample text '+os.environ.get('TEST_VAL', '')); f.close()" && """
|
||||||
'''python -c "import pathlib, sys; pathlib.Path('{project}/python_prefix.txt').write_text(sys.prefix)"'''
|
'''python -c "import sys; f = open('{project}/python_prefix.txt', 'w'); f.write(sys.prefix); f.close()"'''
|
||||||
)
|
)
|
||||||
actual_wheels = utils.cibuildwheel_run(
|
actual_wheels = utils.cibuildwheel_run(
|
||||||
project_dir,
|
project_dir,
|
||||||
add_env={
|
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": before_all_command,
|
||||||
"CIBW_BEFORE_ALL_LINUX": f'{before_all_command} && python -c "import sys; assert sys.version_info >= (3, 8)"',
|
"CIBW_BEFORE_ALL_LINUX": f'{before_all_command} && python -c "import sys; assert sys.version_info >= (3, 8)"',
|
||||||
"CIBW_ENVIRONMENT": "TEST_VAL='123'",
|
"CIBW_ENVIRONMENT": "TEST_VAL='123'",
|
||||||
|
|||||||
Reference in New Issue
Block a user