Skip to content

Commit d193b7f

Browse files
committed
ci: do arm64 builds natively on TravisCI
1 parent 1f845d0 commit d193b7f

File tree

5 files changed

+102
-31
lines changed

5 files changed

+102
-31
lines changed

.travis.yml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,22 @@ matrix:
1818
env:
1919
- PYTHON_VERSION=2.7.15
2020

21+
- os: linux
22+
arch: arm64
23+
virt: vm
24+
group: edge
25+
dist: focal
26+
language: generic
27+
env:
28+
- PYTHON_VERSION=3.8.5
29+
2130
before_cache:
2231
# Cleanup to avoid the cache to grow indefinitely as new package versions are released
2332
# see https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci
24-
- brew cleanup
33+
- |
34+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
35+
brew cleanup
36+
fi
2537
2638
cache:
2739
directories:
@@ -43,20 +55,39 @@ before_install:
4355
if [[ "$TRAVIS_OS_NAME" == "osx" && "${PYTHON_VERSION}" == "3.7.8" ]]; then
4456
brew install gettext
4557
fi
46-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir $HOME/bin; ln -s $(which pip2) $HOME/bin/pip; ln -s $(which python2) $HOME/bin/python; fi
47-
- python scripts/ssl-check.py
48-
- python -m pip install --disable-pip-version-check --upgrade pip
49-
- pip install -U scikit-ci scikit-ci-addons
50-
- ci_addons --install ../addons
58+
- |
59+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
60+
mkdir $HOME/bin; ln -s $(which pip2) $HOME/bin/pip; ln -s $(which python2) $HOME/bin/python
61+
python scripts/ssl-check.py
62+
python -m pip install --disable-pip-version-check --upgrade pip
63+
pip install -U scikit-ci scikit-ci-addons
64+
ci_addons --install ../addons
65+
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
66+
docker run -t --rm \
67+
-v $(pwd):/io \
68+
--env TRAVIS=True \
69+
--env TRAVIS_OS_NAME="${TRAVIS_OS_NAME}" \
70+
quay.io/pypa/manylinux2014_aarch64 \
71+
/io/scripts/docker-build.sh
72+
fi
5173
5274
install:
53-
- ci install
75+
- |
76+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
77+
ci install
78+
fi
5479
5580
script:
56-
- ci test
81+
- |
82+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
83+
ci test
84+
fi
5785
5886
after_success:
59-
- ci after_test
87+
- |
88+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
89+
ci after_test
90+
fi
6091
6192
deploy:
6293
# deploy-release

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ if(CMakePythonDistributions_SUPERBUILD)
188188
# cache file.
189189
file(WRITE "${CMAKE_BINARY_DIR}/initial-cache.txt"
190190
"set(CMAKE_C_FLAGS \"-D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1\" CACHE STRING \"Initial cache\" FORCE)
191-
set(CMAKE_EXE_LINKER_FLAGS \"-static-libstdc++ -static-libgcc -lrt\" CACHE STRING \"Initial cache\" FORCE)
191+
set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\" FORCE)
192192
")
193193
set(_common_args
194194
CMAKE_ARGS -C "${CMAKE_BINARY_DIR}/initial-cache.txt"

appveyor.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ environment:
2323
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
2424
PYTHON_DIR: "C:\\Python37"
2525
PYTHON_VERSION: "3.7.x"
26-
PYTHON_ARCH: "64"
26+
PYTHON_ARCH: "32"
2727
BLOCK: "0"
2828

2929
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
@@ -38,22 +38,22 @@ environment:
3838
secure: qDoPKmtLMdcKUKRHuTlfaajjzO4Q4yu25FM5JuB7z84=
3939

4040
init:
41-
- python -m pip install -U scikit-ci scikit-ci-addons
42-
- python -m ci_addons --install ../addons
41+
- "%PYTHON_DIR%\\python.exe -m pip install -U scikit-ci scikit-ci-addons"
42+
- "%PYTHON_DIR%\\python.exe -m ci_addons --install ../addons"
4343

4444
- ps: ../addons/appveyor/rolling-build.ps1
4545

4646
install:
47-
- python -m ci install
47+
- "%PYTHON_DIR%\\python.exe -m ci install"
4848

4949
build_script:
50-
- python -m ci build
50+
- "%PYTHON_DIR%\\python.exe -m ci build"
5151

5252
test_script:
53-
- python -m ci test
53+
- "%PYTHON_DIR%\\python.exe -m ci test"
5454

5555
after_test:
56-
- python -m ci after_test
56+
- "%PYTHON_DIR%\\python.exe -m ci after_test"
5757

5858
on_finish:
5959
- ps: ../addons/appveyor/enable-worker-remote-access.ps1 -check_for_block

scikit-ci.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ before_install:
5656
- python ../addons/travis/install_pyenv.py
5757
- python scripts/ssl-check.py
5858
- python ../addons/travis/install_cmake.py 3.12.0
59+
linux:
60+
commands:
61+
- python: |
62+
import os
63+
import ci
64+
os.environ["SETUP_BDIST_WHEEL_ARGS"] = "--plat-name %s" % os.environ["AUDITWHEEL_PLAT"]
65+
setup_cmake_args = []
66+
setup_cmake_args.append("-DSTRIP_EXECUTABLE:FILEPATH=/opt/rh/devtoolset-9/root/usr/" + "/bin/strip")
67+
os.environ["SETUP_CMAKE_ARGS"] = " ".join(setup_cmake_args)
68+
ci.driver.Driver.save_env(os.environ)
5969
6070
install:
6171
commands:
@@ -82,20 +92,16 @@ build:
8292
sdist=(glob.glob("dist/*.tar.gz") + glob.glob("dist/*.zip"))[0]
8393
print("Deleting [%s]" % sdist)
8494
os.remove(sdist)
85-
86-
circle:
87-
commands:
88-
- |
89-
arch=${AUDITWHEEL_ARCH}
90-
if [[ ${arch} == "aarch64" ]]; then
91-
exit
92-
fi
93-
# Since there are no external shared libraries to bundle into the wheels
94-
# this step will fixup the wheel switching from 'linux' to 'manylinux' tag
95-
for whl in dist/*linux_${arch}.whl; do
96-
auditwheel repair --plat ${AUDITWHEEL_PLAT} $whl -w ./dist/
97-
rm $whl
98-
done
95+
travis:
96+
linux:
97+
commands:
98+
- |
99+
# Since there are no external shared libraries to bundle into the wheels
100+
# this step will fixup the wheel switching from 'linux' to 'manylinux' tag
101+
for whl in dist/*linux*_$(arch).whl; do
102+
auditwheel repair --plat ${AUDITWHEEL_PLAT} $whl -w ./wheelhouse
103+
rm $whl
104+
done
99105
100106
test:
101107
commands:

scripts/docker-build.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
MANYLINUX_PYTHON=cp38-cp38
7+
export PATH="/opt/python/${MANYLINUX_PYTHON}/bin:$PATH"
8+
export DEFAULT_DOCKCROSS_IMAGE=dockcross/manylinux2014-aarch64
9+
10+
11+
yum install -y openssl-devel
12+
13+
cd /io
14+
15+
16+
ci_before_install() {
17+
/opt/python/${MANYLINUX_PYTHON}/bin/python scripts/ssl-check.py
18+
/opt/python/${MANYLINUX_PYTHON}/bin/pip install scikit-ci scikit-ci-addons scikit-build
19+
}
20+
21+
ci_install() {
22+
/opt/python/${MANYLINUX_PYTHON}/bin/ci install
23+
}
24+
ci_test() {
25+
/opt/python/${MANYLINUX_PYTHON}/bin/ci test
26+
}
27+
ci_after_success() {
28+
/opt/python/${MANYLINUX_PYTHON}/bin/ci after_test
29+
}
30+
31+
ci_before_install
32+
ci_install
33+
ci_test
34+
ci_after_success

0 commit comments

Comments
 (0)