From ec442d9d7b083f238190c924489f4f0c9acf2f17 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sat, 28 Jan 2023 21:24:16 +0100 Subject: [PATCH 01/69] Add github action to build wheels for cling --- .github/workflows/cling-wheels.yml | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/cling-wheels.yml diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml new file mode 100644 index 00000000..e8b73778 --- /dev/null +++ b/.github/workflows/cling-wheels.yml @@ -0,0 +1,48 @@ +name: Build and upload to PyPI + +# Build on every branch push, tag push, and pull request change: +on: [push, pull_request] +# Alternatively, to publish when a (published) GitHub Release is created, use the following: +# on: +# push: +# pull_request: +# release: +# types: +# - published + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, windows-2019, macos-11] + + steps: + - uses: actions/checkout@v3 + + # Used to host cibuildwheel + - uses: actions/setup-python@v3 + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.12.0 + + - name: Build wheels + run: cd cling && python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v3 + with: + path: ./cling/wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build sdist + run: cd cling && pipx run build --sdist + + - uses: actions/upload-artifact@v3 + with: + path: ./cling/dist/*.tar.gz From cb3016ff5c6c3209d0c02179e278acb206a4aeb0 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sat, 28 Jan 2023 21:25:05 +0100 Subject: [PATCH 02/69] Add some default cibuildwheel configurations to pyproject.toml --- cling/pyproject.toml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index b3fde5fb..7ee96f84 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -1,2 +1,41 @@ [build-system] requires = ["cmake", "setuptools", "wheel"] + +[tool.cibuildwheel] +build = "*" +skip = "" +test-skip = "" + +archs = ["auto"] +build-frontend = "pip" +config-settings = {} +dependency-versions = "pinned" +environment = {} +environment-pass = [] +build-verbosity = "" + +before-all = "python create_src_directory.py" +before-build = "" +repair-wheel-command = "" + +test-command = "" +before-test = "" +test-requires = [] +test-extras = [] + +container-engine = "docker" + +manylinux-x86_64-image = "manylinux2014" +manylinux-i686-image = "manylinux2014" +manylinux-aarch64-image = "manylinux2014" +manylinux-ppc64le-image = "manylinux2014" +manylinux-s390x-image = "manylinux2014" +manylinux-pypy_x86_64-image = "manylinux2014" +manylinux-pypy_i686-image = "manylinux2014" +manylinux-pypy_aarch64-image = "manylinux2014" + +musllinux-x86_64-image = "musllinux_1_1" +musllinux-i686-image = "musllinux_1_1" +musllinux-aarch64-image = "musllinux_1_1" +musllinux-ppc64le-image = "musllinux_1_1" +musllinux-s390x-image = "musllinux_1_1" \ No newline at end of file From 217b507cf7781c99ed371b902daa1a886dac5048 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sat, 28 Jan 2023 21:25:41 +0100 Subject: [PATCH 03/69] Do not exit with exit code 2 is fail to apply patch --- cling/create_src_directory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cling/create_src_directory.py b/cling/create_src_directory.py index e36ed47a..9dafb8bf 100755 --- a/cling/create_src_directory.py +++ b/cling/create_src_directory.py @@ -127,7 +127,7 @@ def apply(self): pset = patch.fromfile(fpatch) if not pset or not pset.apply(): print("Failed to apply patch:", fdiff) - sys.exit(2) + # sys.exit(2) # ## manylinux1 specific patch, as there a different, older, compiler is used From 78761c84d77f710d761d425898225ef2cd4aa423 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 10:16:54 +0100 Subject: [PATCH 04/69] Build on python3.6 and add matrix of different platforms and archs --- .github/workflows/cling-wheels.yml | 78 ++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index e8b73778..47352008 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -14,15 +14,87 @@ jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} + + env: + CIBW_BUILD: "${{ matrix.cibw.build || '*' }}" + CIBW_SKIP: "${{ matrix.cibw.skip || '' }}" + CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}" + CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}" + CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_x86_64_image || '' }}" + strategy: + fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019, macos-11] + include: + - os: macos-11 + name: mac-cpython + cibw: + build: "cp36-*" + + - os: macos-11 + name: mac-pypy + cibw: + build: "pp37-*" + + - os: macos-11 + name: mac-arm + cibw: + arch: universal2 + build: "cp36-*" + + - os: ubuntu-20.04 + name: manylinux-x86_64 + cibw: + arch: x86_64 + build: "*manylinux*" + + - os: ubuntu-20.04 + name: manylinux-i686 + cibw: + arch: i686 + build: "*manylinux*" + # additional manylinux variants, not specified in pyproject.toml: + # build with newer 2_28 for cpython >= 3.10, pypy 3.9 + - name: manylinux-x86_64-2_28 + os: ubuntu-20.04 + cibw: + arch: x86_64 + build: "cp310-manylinux* pp39-manylinux*" + manylinux_x86_64_image: manylinux_2_28 + + - os: ubuntu-20.04 + name: musllinux + cibw: + build: "*musllinux*" + + - os: windows-2019 + name: win32 + architecture: x86 + cibw: + build: "cp36-win32" + + - os: windows-2019 + name: win-pypy + architecture: x64 + cibw: + build: "pp36-win_amd64" + + - os: windows-2019 + name: win_amd64 + architecture: x64 + cibw: + build: "cp36-win_amd64" + steps: - uses: actions/checkout@v3 - # Used to host cibuildwheel - - uses: actions/setup-python@v3 + - name: setup python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + architecture: ${{ matrix.architecture }} + - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.12.0 From 34ab16e8208fd3a4f6b423f383bcf007551aa22a Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 13:14:01 +0100 Subject: [PATCH 05/69] Use python3.9 instead --- .github/workflows/cling-wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 47352008..3de7183b 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -46,13 +46,13 @@ jobs: name: manylinux-x86_64 cibw: arch: x86_64 - build: "*manylinux*" + build: "cp36-manylinux*" - os: ubuntu-20.04 name: manylinux-i686 cibw: arch: i686 - build: "*manylinux*" + build: "cp36-manylinux*" # additional manylinux variants, not specified in pyproject.toml: # build with newer 2_28 for cpython >= 3.10, pypy 3.9 @@ -66,7 +66,7 @@ jobs: - os: ubuntu-20.04 name: musllinux cibw: - build: "*musllinux*" + build: "cp36-musllinux*" - os: windows-2019 name: win32 From 16856f60c460702bd157295dfcc0b62f3f08b0fc Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 17:57:59 +0100 Subject: [PATCH 06/69] Add some more options to build matrix --- .github/workflows/cling-wheels.yml | 55 ++++++++++++++++++------------ 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 3de7183b..c3fef17a 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -29,7 +29,13 @@ jobs: - os: macos-11 name: mac-cpython cibw: - build: "cp36-*" + build: "cp38-*" + + - os: macos-11 + name: mac-cpython-arm + cibw: + arch: arm64 + build: "cp38-*" - os: macos-11 name: mac-pypy @@ -37,54 +43,59 @@ jobs: build: "pp37-*" - os: macos-11 - name: mac-arm + name: mac-pypy-arm cibw: - arch: universal2 - build: "cp36-*" + arch: arm64 + build: "pp37-*" - os: ubuntu-20.04 name: manylinux-x86_64 cibw: arch: x86_64 - build: "cp36-manylinux*" + build: "cp38-manylinux*" + + - os: ubuntu-20.04 + name: manylinux-arch64 + cibw: + arch: aarch64 + build: "cp38-manylinux*" - os: ubuntu-20.04 name: manylinux-i686 cibw: arch: i686 - build: "cp36-manylinux*" + build: "cp38-manylinux*" - # additional manylinux variants, not specified in pyproject.toml: - # build with newer 2_28 for cpython >= 3.10, pypy 3.9 - - name: manylinux-x86_64-2_28 - os: ubuntu-20.04 + - os: ubuntu-20.04 + name: musllinux-x86_64 cibw: arch: x86_64 - build: "cp310-manylinux* pp39-manylinux*" - manylinux_x86_64_image: manylinux_2_28 + build: "cp38-musllinux*" - os: ubuntu-20.04 - name: musllinux + name: musllinux-i686 cibw: - build: "cp36-musllinux*" + arch: i686 + build: "cp38-musllinux*" - - os: windows-2019 + - os: windows-2019-x86 name: win32 architecture: x86 cibw: - build: "cp36-win32" + build: "cp38-win32" - - os: windows-2019 - name: win-pypy + - os: windows-2019-amd64 + name: win_amd64 architecture: x64 cibw: - build: "pp36-win_amd64" + build: "cp38-win_amd64" - - os: windows-2019 - name: win_amd64 + - os: windows-2019-arm64 + name: win32-arm64 architecture: x64 cibw: - build: "cp36-win_amd64" + build: "cp38-win_arm64" + steps: - uses: actions/checkout@v3 From 2e14f1cce343cf73eaefb3cc6feb0782ef99e4ec Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 18:06:25 +0100 Subject: [PATCH 07/69] Only use cibw.build --- .github/workflows/cling-wheels.yml | 53 ++++++++++++++++-------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index c3fef17a..0e76c5d3 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -12,15 +12,11 @@ on: [push, pull_request] jobs: build_wheels: - name: Build wheels on ${{ matrix.os }} + name: Build wheels on ${{ matrix.cibw.build }} runs-on: ${{ matrix.os }} env: CIBW_BUILD: "${{ matrix.cibw.build || '*' }}" - CIBW_SKIP: "${{ matrix.cibw.skip || '' }}" - CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}" - CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}" - CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_x86_64_image || '' }}" strategy: fail-fast: false @@ -29,72 +25,81 @@ jobs: - os: macos-11 name: mac-cpython cibw: - build: "cp38-*" + build: "cp39-macosx_x86_64" - os: macos-11 name: mac-cpython-arm cibw: - arch: arm64 - build: "cp38-*" + build: "cp39-macosx_arm64" - os: macos-11 name: mac-pypy cibw: - build: "pp37-*" + build: "pp39-macosx_x86_64" - os: macos-11 name: mac-pypy-arm cibw: arch: arm64 - build: "pp37-*" + build: "pp39-macosx_arm64" - os: ubuntu-20.04 name: manylinux-x86_64 cibw: - arch: x86_64 - build: "cp38-manylinux*" + build: "cp39-manylinux_x86_64" - os: ubuntu-20.04 name: manylinux-arch64 cibw: - arch: aarch64 - build: "cp38-manylinux*" + build: "cp39-manylinux_aarch64" + + - os: ubuntu-20.04 + name: manylinux-pypy-arch64 + cibw: + build: "pp39-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-i686 cibw: - arch: i686 - build: "cp38-manylinux*" + build: "cp39-manylinux_i686" + + - os: ubuntu-20.04 + name: manylinux-pypy-x86_64 + cibw: + build: "pp39-manylinux_x86_64" - os: ubuntu-20.04 name: musllinux-x86_64 cibw: - arch: x86_64 - build: "cp38-musllinux*" + build: "cp39-musllinux_x86_64" + + - os: ubuntu-20.04 + name: musllinux-pypy-x86_64 + cibw: + build: "pp39-musllinux_x86_64" - os: ubuntu-20.04 name: musllinux-i686 cibw: - arch: i686 - build: "cp38-musllinux*" + build: "cp39-musllinux_i686" - os: windows-2019-x86 name: win32 architecture: x86 cibw: - build: "cp38-win32" + build: "cp39-win32" - os: windows-2019-amd64 name: win_amd64 architecture: x64 cibw: - build: "cp38-win_amd64" + build: "cp39-win_amd64" - os: windows-2019-arm64 name: win32-arm64 architecture: x64 cibw: - build: "cp38-win_arm64" + build: "cp39-win_arm64" steps: @@ -103,7 +108,7 @@ jobs: - name: setup python uses: actions/setup-python@v3 with: - python-version: "3.8" + python-version: "3.9" architecture: ${{ matrix.architecture }} From c3c633053eab2488cb10900132c5331f415d9d35 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 18:13:44 +0100 Subject: [PATCH 08/69] Specify arch --- .github/workflows/cling-wheels.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 0e76c5d3..08e250ff 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -24,62 +24,73 @@ jobs: include: - os: macos-11 name: mac-cpython + architecture: x86_64 cibw: build: "cp39-macosx_x86_64" - os: macos-11 name: mac-cpython-arm + architecture: arm64 cibw: build: "cp39-macosx_arm64" - os: macos-11 name: mac-pypy + architecture: x86_64 cibw: build: "pp39-macosx_x86_64" - os: macos-11 name: mac-pypy-arm + architecture: arm64 cibw: - arch: arm64 build: "pp39-macosx_arm64" - os: ubuntu-20.04 name: manylinux-x86_64 + architecture: x86_64 cibw: build: "cp39-manylinux_x86_64" - os: ubuntu-20.04 name: manylinux-arch64 + architecture: arch64 cibw: build: "cp39-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-pypy-arch64 + architecture: arch64 cibw: build: "pp39-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-i686 + architecture: i686 cibw: build: "cp39-manylinux_i686" - os: ubuntu-20.04 name: manylinux-pypy-x86_64 + architecture: x86_64 cibw: build: "pp39-manylinux_x86_64" - os: ubuntu-20.04 name: musllinux-x86_64 + architecture: x86_64 cibw: build: "cp39-musllinux_x86_64" - os: ubuntu-20.04 name: musllinux-pypy-x86_64 + architecture: x86_64 cibw: build: "pp39-musllinux_x86_64" - os: ubuntu-20.04 name: musllinux-i686 + architecture: i686 cibw: build: "cp39-musllinux_i686" @@ -91,13 +102,13 @@ jobs: - os: windows-2019-amd64 name: win_amd64 - architecture: x64 + architecture: AMD64 cibw: build: "cp39-win_amd64" - os: windows-2019-arm64 name: win32-arm64 - architecture: x64 + architecture: ARM64 cibw: build: "cp39-win_arm64" From 6b977fb4cc18325e0061baf8ae1163ffebedf58b Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 18:48:54 +0100 Subject: [PATCH 09/69] Set arch via CIBW environment variable --- .github/workflows/cling-wheels.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 08e250ff..4eaa96be 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -17,6 +17,8 @@ jobs: env: CIBW_BUILD: "${{ matrix.cibw.build || '*' }}" + CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}" + CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}" strategy: fail-fast: false @@ -24,74 +26,74 @@ jobs: include: - os: macos-11 name: mac-cpython - architecture: x86_64 cibw: + arch: x86_64 build: "cp39-macosx_x86_64" - os: macos-11 name: mac-cpython-arm - architecture: arm64 cibw: + arch: arm64 build: "cp39-macosx_arm64" - os: macos-11 name: mac-pypy - architecture: x86_64 cibw: + arch: x86_64 build: "pp39-macosx_x86_64" - os: macos-11 name: mac-pypy-arm - architecture: arm64 cibw: + arch: arm64 build: "pp39-macosx_arm64" - os: ubuntu-20.04 name: manylinux-x86_64 - architecture: x86_64 cibw: + arch: x86_64 build: "cp39-manylinux_x86_64" - os: ubuntu-20.04 name: manylinux-arch64 - architecture: arch64 cibw: + arch: arch64 build: "cp39-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-pypy-arch64 - architecture: arch64 cibw: + arch: arch64 build: "pp39-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-i686 - architecture: i686 cibw: + arch: i686 build: "cp39-manylinux_i686" - os: ubuntu-20.04 name: manylinux-pypy-x86_64 - architecture: x86_64 cibw: + arch: x86_64 build: "pp39-manylinux_x86_64" - os: ubuntu-20.04 name: musllinux-x86_64 - architecture: x86_64 cibw: + arch: x86_64 build: "cp39-musllinux_x86_64" - os: ubuntu-20.04 name: musllinux-pypy-x86_64 - architecture: x86_64 cibw: + arch: x86_64 build: "pp39-musllinux_x86_64" - os: ubuntu-20.04 name: musllinux-i686 - architecture: i686 cibw: + arch: i686 build: "cp39-musllinux_i686" - os: windows-2019-x86 From 6f9cf0961b126ae9a589e5f5025924b82c7dfb6f Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 18:50:59 +0100 Subject: [PATCH 10/69] Fix typo --- .github/workflows/cling-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 4eaa96be..e2d563dd 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -57,13 +57,13 @@ jobs: - os: ubuntu-20.04 name: manylinux-arch64 cibw: - arch: arch64 + arch: aarch64 build: "cp39-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-pypy-arch64 cibw: - arch: arch64 + arch: aarch64 build: "pp39-manylinux_aarch64" - os: ubuntu-20.04 From 3877a3419d70d9fa178caabe6a54affd6647543b Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 20:33:58 +0100 Subject: [PATCH 11/69] Set MACOSX_DEPLOYMENT_TARGET for arm mac --- .github/workflows/cling-wheels.yml | 7 ++++++- cling/pyproject.toml | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index e2d563dd..4ae2aa69 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -124,12 +124,17 @@ jobs: python-version: "3.9" architecture: ${{ matrix.architecture }} + - name: customize mac-arm-64 + if: contains(matrix.os, 'macos') && matrix.cibw.arch == 'arm64' + run: | + echo 'MACOSX_DEPLOYMENT_TARGET=10.15' >> "$GITHUB_ENV" + - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.12.0 - name: Build wheels - run: cd cling && python -m cibuildwheel --output-dir wheelhouse + run: cd cling && python -m cibuildwheel --print-build-identifiers --output-dir wheelhouse - uses: actions/upload-artifact@v3 with: diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 7ee96f84..6b8f166c 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -12,7 +12,7 @@ config-settings = {} dependency-versions = "pinned" environment = {} environment-pass = [] -build-verbosity = "" +build-verbosity = "1" before-all = "python create_src_directory.py" before-build = "" @@ -38,4 +38,12 @@ musllinux-x86_64-image = "musllinux_1_1" musllinux-i686-image = "musllinux_1_1" musllinux-aarch64-image = "musllinux_1_1" musllinux-ppc64le-image = "musllinux_1_1" -musllinux-s390x-image = "musllinux_1_1" \ No newline at end of file +musllinux-s390x-image = "musllinux_1_1" + +[tool.cibuildwheel.macos.environment] +MACOSX_DEPLOYMENT_TARGET = "10.9" + +# mac-arm target is 10.15 +[[tool.cibuildwheel.overrides]] +select = "*macos*{universal2,arm64}*" +environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" } \ No newline at end of file From 20810d9df11773b242394ed24dd4ae4a6cd23a81 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 21:05:45 +0100 Subject: [PATCH 12/69] print-build-identifiers in separate step --- .github/workflows/cling-wheels.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 4ae2aa69..a40e24ae 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -131,10 +131,16 @@ jobs: - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.12.0 + run: | + python -m pip install cibuildwheel==2.12.0 + + - name: list target wheels + run: | + cd cling && python -m cibuildwheel . --print-build-identifiers - name: Build wheels - run: cd cling && python -m cibuildwheel --print-build-identifiers --output-dir wheelhouse + run: | + cd cling && python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v3 with: From 7ae239cb78a4c9ca1b1e35ee27d471ce70939c1c Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Jan 2023 22:32:07 +0100 Subject: [PATCH 13/69] Add test command and remove unused options --- cling/pyproject.toml | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 6b8f166c..8ab3c30f 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -2,43 +2,16 @@ requires = ["cmake", "setuptools", "wheel"] [tool.cibuildwheel] -build = "*" -skip = "" -test-skip = "" - archs = ["auto"] build-frontend = "pip" -config-settings = {} dependency-versions = "pinned" -environment = {} -environment-pass = [] build-verbosity = "1" before-all = "python create_src_directory.py" -before-build = "" -repair-wheel-command = "" - -test-command = "" -before-test = "" -test-requires = [] -test-extras = [] - -container-engine = "docker" -manylinux-x86_64-image = "manylinux2014" -manylinux-i686-image = "manylinux2014" -manylinux-aarch64-image = "manylinux2014" -manylinux-ppc64le-image = "manylinux2014" -manylinux-s390x-image = "manylinux2014" -manylinux-pypy_x86_64-image = "manylinux2014" -manylinux-pypy_i686-image = "manylinux2014" -manylinux-pypy_aarch64-image = "manylinux2014" -musllinux-x86_64-image = "musllinux_1_1" -musllinux-i686-image = "musllinux_1_1" -musllinux-aarch64-image = "musllinux_1_1" -musllinux-ppc64le-image = "musllinux_1_1" -musllinux-s390x-image = "musllinux_1_1" +test-requires = ["pytest"] +test-command = "pytest tests" [tool.cibuildwheel.macos.environment] MACOSX_DEPLOYMENT_TARGET = "10.9" From ad31b6ee1faaa9c226e946e3845f333b50c6189e Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Mon, 30 Jan 2023 08:24:53 +0100 Subject: [PATCH 14/69] Change test command to a simple import --- cling/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 8ab3c30f..4f58de30 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -10,8 +10,8 @@ build-verbosity = "1" before-all = "python create_src_directory.py" -test-requires = ["pytest"] -test-command = "pytest tests" +test-requires = [] +test-command = "python -c 'import cppyy_backend'" [tool.cibuildwheel.macos.environment] MACOSX_DEPLOYMENT_TARGET = "10.9" From 54080a2b00566b3f27c7ce7115c6cda795bd3801 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Mon, 30 Jan 2023 15:36:29 +0100 Subject: [PATCH 15/69] Try to set LD_LIBRARY_PATH for auditwheel --- .github/workflows/cling-wheels.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index a40e24ae..c6f0b5e9 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -129,6 +129,11 @@ jobs: run: | echo 'MACOSX_DEPLOYMENT_TARGET=10.15' >> "$GITHUB_ENV" + - name: set LD_LIBRARY_PATH + if: contains(matrix.os, 'ubuntu') + run: | + echo 'LD_LIBRARY_PATH=$PWD/lib' >> "$GITHUB_ENV" + - name: Install cibuildwheel run: | From 7a84846152a423b919b366f2b7a03f16b53b8c85 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 31 Jan 2023 09:34:49 +0100 Subject: [PATCH 16/69] Turn off auditwheel for now --- cling/pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 4f58de30..059e33d7 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -13,6 +13,10 @@ before-all = "python create_src_directory.py" test-requires = [] test-command = "python -c 'import cppyy_backend'" +[tool.cibuildwheel.linux] +repair-wheel-command = "" +# repair-wheel-command = "LD_LIBRARY_PATH=$PWD/lib auditwheel repair -w {dest_dir} {wheel}" + [tool.cibuildwheel.macos.environment] MACOSX_DEPLOYMENT_TARGET = "10.9" From d3fa8c90f250f5be4192b1c47cf838682dec7966 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 31 Jan 2023 09:41:55 +0100 Subject: [PATCH 17/69] Use oldest possible version of python / pypy --- .github/workflows/cling-wheels.yml | 33 +++++++++++++----------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index c6f0b5e9..dca009ba 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -28,85 +28,85 @@ jobs: name: mac-cpython cibw: arch: x86_64 - build: "cp39-macosx_x86_64" + build: "cp36-macosx_x86_64" - os: macos-11 name: mac-cpython-arm cibw: arch: arm64 - build: "cp39-macosx_arm64" + build: "cp38-macosx_arm64" - os: macos-11 name: mac-pypy cibw: arch: x86_64 - build: "pp39-macosx_x86_64" + build: "pp37-macosx_x86_64" - os: macos-11 name: mac-pypy-arm cibw: arch: arm64 - build: "pp39-macosx_arm64" + build: "pp38-macosx_arm64" - os: ubuntu-20.04 name: manylinux-x86_64 cibw: arch: x86_64 - build: "cp39-manylinux_x86_64" + build: "cp36-manylinux_x86_64" - os: ubuntu-20.04 name: manylinux-arch64 cibw: arch: aarch64 - build: "cp39-manylinux_aarch64" + build: "cp36-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-pypy-arch64 cibw: arch: aarch64 - build: "pp39-manylinux_aarch64" + build: "pp37-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-i686 cibw: arch: i686 - build: "cp39-manylinux_i686" + build: "cp36-manylinux_i686" - os: ubuntu-20.04 name: manylinux-pypy-x86_64 cibw: arch: x86_64 - build: "pp39-manylinux_x86_64" + build: "pp37-manylinux_x86_64" - os: ubuntu-20.04 name: musllinux-x86_64 cibw: arch: x86_64 - build: "cp39-musllinux_x86_64" + build: "cp36-musllinux_x86_64" - os: ubuntu-20.04 name: musllinux-pypy-x86_64 cibw: arch: x86_64 - build: "pp39-musllinux_x86_64" + build: "pp37-musllinux_x86_64" - os: ubuntu-20.04 name: musllinux-i686 cibw: arch: i686 - build: "cp39-musllinux_i686" + build: "cp36-musllinux_i686" - os: windows-2019-x86 name: win32 architecture: x86 cibw: - build: "cp39-win32" + build: "cp36-win32" - os: windows-2019-amd64 name: win_amd64 architecture: AMD64 cibw: - build: "cp39-win_amd64" + build: "cp36-win_amd64" - os: windows-2019-arm64 name: win32-arm64 @@ -129,11 +129,6 @@ jobs: run: | echo 'MACOSX_DEPLOYMENT_TARGET=10.15' >> "$GITHUB_ENV" - - name: set LD_LIBRARY_PATH - if: contains(matrix.os, 'ubuntu') - run: | - echo 'LD_LIBRARY_PATH=$PWD/lib' >> "$GITHUB_ENV" - - name: Install cibuildwheel run: | From 5b9486903470081d8f06c215e5792a3c1699b703 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 31 Jan 2023 18:27:14 +0100 Subject: [PATCH 18/69] Setup QEMU on linux --- .github/workflows/cling-wheels.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index dca009ba..9d4932de 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -124,6 +124,12 @@ jobs: python-version: "3.9" architecture: ${{ matrix.architecture }} + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v2 + with: + platforms: all + - name: customize mac-arm-64 if: contains(matrix.os, 'macos') && matrix.cibw.arch == 'arm64' run: | From 622462d3895eb70a84097bcfe03c6ffe2a2b7c14 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 31 Jan 2023 18:37:51 +0100 Subject: [PATCH 19/69] Use CIBW_ARCHS_WINDOWS --- .github/workflows/cling-wheels.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 9d4932de..55ea2aff 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -19,6 +19,7 @@ jobs: CIBW_BUILD: "${{ matrix.cibw.build || '*' }}" CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}" CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}" + CIBW_ARCHS_WINDOWS: "${{ matrix.cibw.arch || 'auto' }}" strategy: fail-fast: false @@ -98,20 +99,20 @@ jobs: - os: windows-2019-x86 name: win32 - architecture: x86 cibw: + arch: x86 build: "cp36-win32" - os: windows-2019-amd64 name: win_amd64 - architecture: AMD64 cibw: + arch: AMD64 build: "cp36-win_amd64" - os: windows-2019-arm64 name: win32-arm64 - architecture: ARM64 cibw: + arch: ARM64 build: "cp39-win_arm64" From 0d6baa5dfd0e2d18db776a3debea141f8016b95f Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Wed, 1 Feb 2023 09:53:05 +0100 Subject: [PATCH 20/69] Set timeout minutes to 600 --- .github/workflows/cling-wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 55ea2aff..d2cdd323 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -14,6 +14,7 @@ jobs: build_wheels: name: Build wheels on ${{ matrix.cibw.build }} runs-on: ${{ matrix.os }} + timeout-minutes: 600 env: CIBW_BUILD: "${{ matrix.cibw.build || '*' }}" From 7bee771f5cc5e93793ce4373ac163cf815adda8a Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 2 Feb 2023 11:25:34 +0100 Subject: [PATCH 21/69] Change name of windows os and move timeout-minutes do different location --- .github/workflows/cling-wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index d2cdd323..217141ac 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -14,7 +14,6 @@ jobs: build_wheels: name: Build wheels on ${{ matrix.cibw.build }} runs-on: ${{ matrix.os }} - timeout-minutes: 600 env: CIBW_BUILD: "${{ matrix.cibw.build || '*' }}" @@ -98,19 +97,19 @@ jobs: arch: i686 build: "cp36-musllinux_i686" - - os: windows-2019-x86 + - os: windows-2019 name: win32 cibw: arch: x86 build: "cp36-win32" - - os: windows-2019-amd64 + - os: windows-2019 name: win_amd64 cibw: arch: AMD64 build: "cp36-win_amd64" - - os: windows-2019-arm64 + - os: windows-2019 name: win32-arm64 cibw: arch: ARM64 @@ -147,6 +146,7 @@ jobs: cd cling && python -m cibuildwheel . --print-build-identifiers - name: Build wheels + timeout-minutes: 600 run: | cd cling && python -m cibuildwheel --output-dir wheelhouse From 71d4e6a4d0772fd7bbda5a2f374a4246aeeae268 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 3 Feb 2023 14:42:02 +0100 Subject: [PATCH 22/69] Change test command to use double quotes --- cling/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 059e33d7..29f95032 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -11,7 +11,7 @@ before-all = "python create_src_directory.py" test-requires = [] -test-command = "python -c 'import cppyy_backend'" +test-command = 'python -c "import cppyy_backend"' [tool.cibuildwheel.linux] repair-wheel-command = "" From e5203fcab79e157d3947751e52c937224d93d4b0 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Mon, 6 Feb 2023 22:28:28 +0100 Subject: [PATCH 23/69] Add back sys.exit in create_src_directory.py --- cling/create_src_directory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cling/create_src_directory.py b/cling/create_src_directory.py index cc771c1a..8eedf8ab 100755 --- a/cling/create_src_directory.py +++ b/cling/create_src_directory.py @@ -127,7 +127,7 @@ def apply(self): pset = patch.fromfile(fpatch) if not pset or not pset.apply(): print("Failed to apply patch:", fdiff) - # sys.exit(2) + sys.exit(2) # ## manylinux1 specific patch, as there a different, older, compiler is used From a200b9f5069dff2c58d2f17c54186aa3e4453496 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 14:24:53 -0800 Subject: [PATCH 24/69] Try with circle ci instead of github actions --- .circleci/config.yml | 59 ++++++++++++++++++++++++++++++ .github/workflows/cling-wheels.yml | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..891093b8 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,59 @@ +version: 2 + +jobs: + linux-wheels: + working_directory: ~/linux-wheels + docker: + - image: circleci/python:3.9 + steps: + - checkout + - setup_remote_docker + - run: + name: Build the Linux wheels. + command: | + pip3 install --user cibuildwheel==2.12.0 + cd cling && python -m cibuildwheel . --print-build-identifiers + cd cling && cibuildwheel --output-dir wheelhouse + - store_artifacts: + path: wheelhouse/ + + linux-aarch64-wheels: + working_directory: ~/linux-aarch64-wheels + machine: + image: ubuntu-2004:2022.04.1 + # resource_class is what tells CircleCI to use an ARM worker for native arm builds + # https://circleci.com/product/features/resource-classes/ + resource_class: arm.medium + steps: + - checkout + - run: + name: Build the Linux aarch64 wheels. + command: | + python3 -m pip install --user cibuildwheel==2.12.0 + cd cling && python -m cibuildwheel . --print-build-identifiers + cd cling && python3 -m cibuildwheel --output-dir wheelhouse + - store_artifacts: + path: wheelhouse/ + + osx-wheels: + working_directory: ~/osx-wheels + macos: + xcode: 12.5.1 + steps: + - checkout + - run: + name: Build the OS X wheels. + command: | + pip3 install cibuildwheel==2.12.0 + cd cling && python -m cibuildwheel . --print-build-identifiers + cd cling && cibuildwheel --output-dir wheelhouse + - store_artifacts: + path: wheelhouse/ + +workflows: + version: 2 + all-tests: + jobs: + - linux-wheels + - linux-aarch64-wheels + - osx-wheels \ No newline at end of file diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 217141ac..60878202 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -1,7 +1,7 @@ name: Build and upload to PyPI # Build on every branch push, tag push, and pull request change: -on: [push, pull_request] +on: [] #push, pull_request] # Alternatively, to publish when a (published) GitHub Release is created, use the following: # on: # push: From 3da31aecb3e3f2ce3f717df2abfa218721401dc0 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 14:27:43 -0800 Subject: [PATCH 25/69] Use python3 -m --- .circleci/config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 891093b8..159b5dce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,9 +11,9 @@ jobs: - run: name: Build the Linux wheels. command: | - pip3 install --user cibuildwheel==2.12.0 - cd cling && python -m cibuildwheel . --print-build-identifiers - cd cling && cibuildwheel --output-dir wheelhouse + python3 -m install --user cibuildwheel==2.12.0 + cd cling && python3 -m cibuildwheel . --print-build-identifiers + cd cling && python3 -m cibuildwheel --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -30,7 +30,7 @@ jobs: name: Build the Linux aarch64 wheels. command: | python3 -m pip install --user cibuildwheel==2.12.0 - cd cling && python -m cibuildwheel . --print-build-identifiers + cd cling && python3 -m cibuildwheel . --print-build-identifiers cd cling && python3 -m cibuildwheel --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -44,9 +44,9 @@ jobs: - run: name: Build the OS X wheels. command: | - pip3 install cibuildwheel==2.12.0 - cd cling && python -m cibuildwheel . --print-build-identifiers - cd cling && cibuildwheel --output-dir wheelhouse + python3 -m pip install cibuildwheel==2.12.0 + cd cling && python3 -m cibuildwheel . --print-build-identifiers + cd cling && python3 -m cibuildwheel --output-dir wheelhouse - store_artifacts: path: wheelhouse/ From 4b9b944c25cc838228172c993ddaf24e8cc4d0c2 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 14:34:11 -0800 Subject: [PATCH 26/69] Only build one python version --- .circleci/config.yml | 14 +++++++------- cling/pyproject.toml | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 159b5dce..3419314f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,9 +11,9 @@ jobs: - run: name: Build the Linux wheels. command: | - python3 -m install --user cibuildwheel==2.12.0 - cd cling && python3 -m cibuildwheel . --print-build-identifiers - cd cling && python3 -m cibuildwheel --output-dir wheelhouse + python3 -m pip install --user cibuildwheel==2.12.0 + python3 -m cibuildwheel cling --print-build-identifiers + python3 -m cibuildwheel cling --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -30,8 +30,8 @@ jobs: name: Build the Linux aarch64 wheels. command: | python3 -m pip install --user cibuildwheel==2.12.0 - cd cling && python3 -m cibuildwheel . --print-build-identifiers - cd cling && python3 -m cibuildwheel --output-dir wheelhouse + python3 -m cibuildwheel cling --print-build-identifiers + python3 -m cibuildwheel cling --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -45,8 +45,8 @@ jobs: name: Build the OS X wheels. command: | python3 -m pip install cibuildwheel==2.12.0 - cd cling && python3 -m cibuildwheel . --print-build-identifiers - cd cling && python3 -m cibuildwheel --output-dir wheelhouse + python3 -m cibuildwheel cling --print-build-identifiers + python3 -m cibuildwheel cling --output-dir wheelhouse - store_artifacts: path: wheelhouse/ diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 29f95032..bfcbbeaa 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -6,6 +6,7 @@ archs = ["auto"] build-frontend = "pip" dependency-versions = "pinned" build-verbosity = "1" +build = "cp38-*" before-all = "python create_src_directory.py" From f9df96e622b72979e2e10b34ca77712029f5fe77 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 14:36:48 -0800 Subject: [PATCH 27/69] Update before-all command --- cling/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index bfcbbeaa..5f09b0bc 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -8,7 +8,7 @@ dependency-versions = "pinned" build-verbosity = "1" build = "cp38-*" -before-all = "python create_src_directory.py" +before-all = "python cling/create_src_directory.py" test-requires = [] From 072a6ad061d34dd1257d7f3c44472e16372775e9 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 14:41:26 -0800 Subject: [PATCH 28/69] Do not exit if applying patch didn't succeed --- cling/create_src_directory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cling/create_src_directory.py b/cling/create_src_directory.py index 8eedf8ab..cc771c1a 100755 --- a/cling/create_src_directory.py +++ b/cling/create_src_directory.py @@ -127,7 +127,7 @@ def apply(self): pset = patch.fromfile(fpatch) if not pset or not pset.apply(): print("Failed to apply patch:", fdiff) - sys.exit(2) + # sys.exit(2) # ## manylinux1 specific patch, as there a different, older, compiler is used From 3126267c8d82d70a1594987d24543d7ed7161ffb Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 14:50:36 -0800 Subject: [PATCH 29/69] Use virtual environment --- .circleci/config.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3419314f..c2caddef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,5 @@ version: 2 - +# Get inspiration from https://github.com/dwavesystems/dimod/blob/main/.circleci/config.yml jobs: linux-wheels: working_directory: ~/linux-wheels @@ -11,7 +11,10 @@ jobs: - run: name: Build the Linux wheels. command: | - python3 -m pip install --user cibuildwheel==2.12.0 + python3 -m venv venv + . venv/bin/activate + python3 -m pip install pip --upgrade + python3 -m pip install cibuildwheel==2.12.0 python3 -m cibuildwheel cling --print-build-identifiers python3 -m cibuildwheel cling --output-dir wheelhouse - store_artifacts: @@ -29,7 +32,10 @@ jobs: - run: name: Build the Linux aarch64 wheels. command: | - python3 -m pip install --user cibuildwheel==2.12.0 + python3 -m venv venv + . venv/bin/activate + python3 -m pip install pip --upgrade + python3 -m pip install cibuildwheel==2.12.0 python3 -m cibuildwheel cling --print-build-identifiers python3 -m cibuildwheel cling --output-dir wheelhouse - store_artifacts: @@ -44,6 +50,9 @@ jobs: - run: name: Build the OS X wheels. command: | + python3 -m venv venv + . venv/bin/activate + python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 python3 -m cibuildwheel cling --print-build-identifiers python3 -m cibuildwheel cling --output-dir wheelhouse From e06c60e9df992716f5a16d3108623f123084a859 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 14:54:02 -0800 Subject: [PATCH 30/69] Try to build for python39 instead --- cling/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 5f09b0bc..9c73550c 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -6,7 +6,7 @@ archs = ["auto"] build-frontend = "pip" dependency-versions = "pinned" build-verbosity = "1" -build = "cp38-*" +build = "cp39-*" before-all = "python cling/create_src_directory.py" From 2c173fd1722035c18f3a270f36fefc0b0b155610 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 14:55:54 -0800 Subject: [PATCH 31/69] Try to add numpy as a build requirements --- cling/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 9c73550c..f13f2483 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["cmake", "setuptools", "wheel"] +requires = ["cmake", "setuptools", "wheel", "numpy"] [tool.cibuildwheel] archs = ["auto"] From b69bac9da048816085b530e929da1c98991fe68b Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 15:02:33 -0800 Subject: [PATCH 32/69] Add path to checkout --- .circleci/config.yml | 15 +++++++++------ cling/pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c2caddef..1be96f3e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,7 @@ jobs: - image: circleci/python:3.9 steps: - checkout + path: ~/cling - setup_remote_docker - run: name: Build the Linux wheels. @@ -15,8 +16,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel cling --print-build-identifiers - python3 -m cibuildwheel cling --output-dir wheelhouse + python3 -m cibuildwheel . --print-build-identifiers + python3 -m cibuildwheel . --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -29,6 +30,7 @@ jobs: resource_class: arm.medium steps: - checkout + path: ~/cling - run: name: Build the Linux aarch64 wheels. command: | @@ -36,8 +38,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel cling --print-build-identifiers - python3 -m cibuildwheel cling --output-dir wheelhouse + python3 -m cibuildwheel . --print-build-identifiers + python3 -m cibuildwheel . --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -47,6 +49,7 @@ jobs: xcode: 12.5.1 steps: - checkout + path: ~/cling - run: name: Build the OS X wheels. command: | @@ -54,8 +57,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel cling --print-build-identifiers - python3 -m cibuildwheel cling --output-dir wheelhouse + python3 -m cibuildwheel . --print-build-identifiers + python3 -m cibuildwheel . --output-dir wheelhouse - store_artifacts: path: wheelhouse/ diff --git a/cling/pyproject.toml b/cling/pyproject.toml index f13f2483..80c25f80 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -8,7 +8,7 @@ dependency-versions = "pinned" build-verbosity = "1" build = "cp39-*" -before-all = "python cling/create_src_directory.py" +before-all = "python create_src_directory.py" test-requires = [] From 5c33084e1c64b06399c1c2b546de6a82ca78cc57 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 15:08:20 -0800 Subject: [PATCH 33/69] Try with 'cd cling' again --- .circleci/config.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1be96f3e..015bea50 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,6 @@ jobs: - image: circleci/python:3.9 steps: - checkout - path: ~/cling - setup_remote_docker - run: name: Build the Linux wheels. @@ -16,8 +15,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel . --print-build-identifiers - python3 -m cibuildwheel . --output-dir wheelhouse + cd cling && python3 -m cibuildwheel . --print-build-identifiers + cd cling && python3 -m cibuildwheel . --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -30,7 +29,6 @@ jobs: resource_class: arm.medium steps: - checkout - path: ~/cling - run: name: Build the Linux aarch64 wheels. command: | @@ -38,8 +36,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel . --print-build-identifiers - python3 -m cibuildwheel . --output-dir wheelhouse + cd cling && python3 -m cibuildwheel . --print-build-identifiers + cd cling && python3 -m cibuildwheel . --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -49,7 +47,6 @@ jobs: xcode: 12.5.1 steps: - checkout - path: ~/cling - run: name: Build the OS X wheels. command: | @@ -57,8 +54,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel . --print-build-identifiers - python3 -m cibuildwheel . --output-dir wheelhouse + cd cling && python3 -m cibuildwheel . --print-build-identifiers + cd cling && python3 -m cibuildwheel . --output-dir wheelhouse - store_artifacts: path: wheelhouse/ From 3881a559c2df7aca5cfbda4a69a98843f7577bb3 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 15:12:43 -0800 Subject: [PATCH 34/69] Move back to path --- .circleci/config.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 015bea50..508c96ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,8 @@ jobs: docker: - image: circleci/python:3.9 steps: - - checkout + - checkout: + path: ~/cling - setup_remote_docker - run: name: Build the Linux wheels. @@ -15,8 +16,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - cd cling && python3 -m cibuildwheel . --print-build-identifiers - cd cling && python3 -m cibuildwheel . --output-dir wheelhouse + python3 -m cibuildwheel . --print-build-identifiers + python3 -m cibuildwheel . --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -28,7 +29,8 @@ jobs: # https://circleci.com/product/features/resource-classes/ resource_class: arm.medium steps: - - checkout + - checkout: + path: ~/cling - run: name: Build the Linux aarch64 wheels. command: | @@ -36,8 +38,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - cd cling && python3 -m cibuildwheel . --print-build-identifiers - cd cling && python3 -m cibuildwheel . --output-dir wheelhouse + python3 -m cibuildwheel . --print-build-identifiers + python3 -m cibuildwheel . --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -46,7 +48,8 @@ jobs: macos: xcode: 12.5.1 steps: - - checkout + - checkout: + path: ~/cling - run: name: Build the OS X wheels. command: | @@ -54,8 +57,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - cd cling && python3 -m cibuildwheel . --print-build-identifiers - cd cling && python3 -m cibuildwheel . --output-dir wheelhouse + python3 -m cibuildwheel . --print-build-identifiers + python3 -m cibuildwheel . --output-dir wheelhouse - store_artifacts: path: wheelhouse/ From 3ea620ba0d381f2388a7560e4535ae1c6e2478dc Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 15:16:08 -0800 Subject: [PATCH 35/69] Add ls + pwd --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 508c96ee..63a4396a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,8 @@ jobs: - run: name: Build the Linux wheels. command: | + ls + pwd python3 -m venv venv . venv/bin/activate python3 -m pip install pip --upgrade @@ -34,6 +36,8 @@ jobs: - run: name: Build the Linux aarch64 wheels. command: | + ls + pwd python3 -m venv venv . venv/bin/activate python3 -m pip install pip --upgrade From 382aab6d227edc174eac00b70a7d112f5ffd4c69 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 16:46:38 -0800 Subject: [PATCH 36/69] Try to add cling as argument to cibuildwheel --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 63a4396a..74ccc530 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,8 +42,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel . --print-build-identifiers - python3 -m cibuildwheel . --output-dir wheelhouse + python3 -m cibuildwheel cling --print-build-identifiers + python3 -m cibuildwheel cling --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -61,8 +61,8 @@ jobs: . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel . --print-build-identifiers - python3 -m cibuildwheel . --output-dir wheelhouse + python3 -m cibuildwheel cling --print-build-identifiers + python3 -m cibuildwheel cling --output-dir wheelhouse - store_artifacts: path: wheelhouse/ From 26f33caa85aa0d5f9368ce982af246315dbcccff Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 16:47:46 -0800 Subject: [PATCH 37/69] Remove checkout path# --- .circleci/config.yml | 17 +++++------------ cling/pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 74ccc530..c2caddef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,20 +6,17 @@ jobs: docker: - image: circleci/python:3.9 steps: - - checkout: - path: ~/cling + - checkout - setup_remote_docker - run: name: Build the Linux wheels. command: | - ls - pwd python3 -m venv venv . venv/bin/activate python3 -m pip install pip --upgrade python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel . --print-build-identifiers - python3 -m cibuildwheel . --output-dir wheelhouse + python3 -m cibuildwheel cling --print-build-identifiers + python3 -m cibuildwheel cling --output-dir wheelhouse - store_artifacts: path: wheelhouse/ @@ -31,13 +28,10 @@ jobs: # https://circleci.com/product/features/resource-classes/ resource_class: arm.medium steps: - - checkout: - path: ~/cling + - checkout - run: name: Build the Linux aarch64 wheels. command: | - ls - pwd python3 -m venv venv . venv/bin/activate python3 -m pip install pip --upgrade @@ -52,8 +46,7 @@ jobs: macos: xcode: 12.5.1 steps: - - checkout: - path: ~/cling + - checkout - run: name: Build the OS X wheels. command: | diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 80c25f80..ba5e0059 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -8,7 +8,7 @@ dependency-versions = "pinned" build-verbosity = "1" build = "cp39-*" -before-all = "python create_src_directory.py" +before-all = "cd cling && python create_src_directory.py" test-requires = [] From 4cfec39591bc121f1202654c5f72cb2854b3d001 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 17:05:49 -0800 Subject: [PATCH 38/69] Install newer C++ compiler for linux --- .circleci/config.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c2caddef..e3dcf7b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,9 +5,17 @@ jobs: working_directory: ~/linux-wheels docker: - image: circleci/python:3.9 + environment: + CC: gcc-12 + CXX: g++-12 steps: - checkout - setup_remote_docker + - run: + name: Install C++ compiler + command: | + sudo apt-get update + sudo apt-get install -y ninja-build git unzip cmake g++-12 libstdc++-12-dev - run: name: Build the Linux wheels. command: | @@ -28,7 +36,7 @@ jobs: # https://circleci.com/product/features/resource-classes/ resource_class: arm.medium steps: - - checkout + - checkout - run: name: Build the Linux aarch64 wheels. command: | From 1b03175533cedf8e8e7cc70f4bed391e7c49cac7 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 17:08:15 -0800 Subject: [PATCH 39/69] Use clang instead --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e3dcf7b9..5b805bfb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,8 +6,9 @@ jobs: docker: - image: circleci/python:3.9 environment: - CC: gcc-12 - CXX: g++-12 + CC: clang-14 + CXX: clang++-14 + CXXFLAGS: -stdlib=libc++ steps: - checkout - setup_remote_docker @@ -15,7 +16,7 @@ jobs: name: Install C++ compiler command: | sudo apt-get update - sudo apt-get install -y ninja-build git unzip cmake g++-12 libstdc++-12-dev + sudo apt-get install -y ninja-build git unzip cmake clang-14 libc++-14-dev libc++abi-14-dev - run: name: Build the Linux wheels. command: | From 4fab1bd72ac423a92b5328a00a40a60b98996c5b Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 17:13:37 -0800 Subject: [PATCH 40/69] Try to use a different image --- .circleci/config.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b805bfb..e360441f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,20 +3,10 @@ version: 2 jobs: linux-wheels: working_directory: ~/linux-wheels - docker: - - image: circleci/python:3.9 - environment: - CC: clang-14 - CXX: clang++-14 - CXXFLAGS: -stdlib=libc++ + machine: + image: ubuntu-2004:2022.04.1 steps: - checkout - - setup_remote_docker - - run: - name: Install C++ compiler - command: | - sudo apt-get update - sudo apt-get install -y ninja-build git unzip cmake clang-14 libc++-14-dev libc++abi-14-dev - run: name: Build the Linux wheels. command: | From ab2858519a816fe674d15090b140cb2706e293c2 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 17:56:33 -0800 Subject: [PATCH 41/69] Try to install clang --- .circleci/config.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e360441f..80a5db60 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,8 +5,17 @@ jobs: working_directory: ~/linux-wheels machine: image: ubuntu-2004:2022.04.1 + environment: + CC: clang-14 + CXX: clang++-14 + CXXFLAGS: -stdlib=libc++ steps: - checkout + - run: + name: Install clang + command: | + sudo apt-get remove clang + sudo apt-get install -y ninja-build git unzip cmake clang-14 libc++-14-dev libc++abi-14-dev - run: name: Build the Linux wheels. command: | From 2fa7269d29396cf732d1a514622b96bf88f489d3 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 18:12:32 -0800 Subject: [PATCH 42/69] Try to use clang-12 instead --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 80a5db60..e52590ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,8 +6,8 @@ jobs: machine: image: ubuntu-2004:2022.04.1 environment: - CC: clang-14 - CXX: clang++-14 + CC: clang-12 + CXX: clang++-12 CXXFLAGS: -stdlib=libc++ steps: - checkout @@ -15,7 +15,7 @@ jobs: name: Install clang command: | sudo apt-get remove clang - sudo apt-get install -y ninja-build git unzip cmake clang-14 libc++-14-dev libc++abi-14-dev + sudo apt-get install -y ninja-build git unzip cmake clang-12 libc++-12-dev libc++abi-12-dev - run: name: Build the Linux wheels. command: | From 9874e0bc4a6485cb47064937339cf2a07190473d Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 18:38:06 -0800 Subject: [PATCH 43/69] Try to just update libc++ --- .circleci/config.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e52590ec..65b55945 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,17 +5,14 @@ jobs: working_directory: ~/linux-wheels machine: image: ubuntu-2004:2022.04.1 - environment: - CC: clang-12 - CXX: clang++-12 - CXXFLAGS: -stdlib=libc++ + resource_class: large steps: - checkout - run: name: Install clang command: | - sudo apt-get remove clang - sudo apt-get install -y ninja-build git unzip cmake clang-12 libc++-12-dev libc++abi-12-dev + sudo apt-get update + sudo apt-get install -y install libc++-dev libc++abi-dev - run: name: Build the Linux wheels. command: | From 5372ddb125699c3d3d69c0779a06435bd4923ea0 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 18:41:37 -0800 Subject: [PATCH 44/69] Skip update --- .circleci/config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 65b55945..4a7ea620 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,15 +4,14 @@ jobs: linux-wheels: working_directory: ~/linux-wheels machine: - image: ubuntu-2004:2022.04.1 - resource_class: large + image: ubuntu-2004:2022.10.1 + resource_class: medium steps: - checkout - run: name: Install clang command: | - sudo apt-get update - sudo apt-get install -y install libc++-dev libc++abi-dev + sudo apt-get install -y libc++-dev libc++abi-dev - run: name: Build the Linux wheels. command: | From 89527c27775f96d42717a68f5268140b902c9667 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 18:54:53 -0800 Subject: [PATCH 45/69] Try to set c++20 std --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a7ea620..6af3f525 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,8 @@ jobs: machine: image: ubuntu-2004:2022.10.1 resource_class: medium + environment: + CXXFLAGS: -std=c++2a steps: - checkout - run: From 533754b23dedfe8a7b95ccf69c7bf93902ecaffa Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 19:02:55 -0800 Subject: [PATCH 46/69] Try to upgrade c++ compiler --- .circleci/config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6af3f525..58e6e980 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,14 +6,12 @@ jobs: machine: image: ubuntu-2004:2022.10.1 resource_class: medium - environment: - CXXFLAGS: -std=c++2a steps: - checkout - run: - name: Install clang + name: Update command: | - sudo apt-get install -y libc++-dev libc++abi-dev + sudo apt-get update && sudo apt-get install git cmake build-essential tar curl g++ gcc-9 clang-10 - run: name: Build the Linux wheels. command: | From be35e3926b4baabef550beaaba7025f65838c1f8 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 16 Feb 2023 19:09:42 -0800 Subject: [PATCH 47/69] Use c++20 for manylinux as well --- cling/setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cling/setup.py b/cling/setup.py index b1789636..8903e80e 100755 --- a/cling/setup.py +++ b/cling/setup.py @@ -117,10 +117,10 @@ def run(self): try: stdcxx = os.environ['STDCXX'] except KeyError: - if is_manylinux(): - stdcxx = '11' - else: - stdcxx = '20' + # if is_manylinux(): + # stdcxx = '11' + # else: + stdcxx = '20' if not stdcxx in ['11', '14', '17', '20']: log.fatal('FATAL: envar STDCXX should be one of 11, 14, 17, or 20') From 6accdf6c24faccc4b55777d772848b91559f2e4d Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 17 Feb 2023 16:50:00 +0100 Subject: [PATCH 48/69] Use more resources --- .circleci/config.yml | 10 ++++++++-- cling/setup.py | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 58e6e980..8064b4d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,10 @@ jobs: working_directory: ~/linux-wheels machine: image: ubuntu-2004:2022.10.1 - resource_class: medium + resource_class: large + environment: + STDCXX: 20 + MAKE_NPROCS: 4 steps: - checkout - run: @@ -30,7 +33,10 @@ jobs: image: ubuntu-2004:2022.04.1 # resource_class is what tells CircleCI to use an ARM worker for native arm builds # https://circleci.com/product/features/resource-classes/ - resource_class: arm.medium + resource_class: arm.large + environment: + STDCXX: 20 + MAKE_NPROCS: 4 steps: - checkout - run: diff --git a/cling/setup.py b/cling/setup.py index 8903e80e..b1789636 100755 --- a/cling/setup.py +++ b/cling/setup.py @@ -117,10 +117,10 @@ def run(self): try: stdcxx = os.environ['STDCXX'] except KeyError: - # if is_manylinux(): - # stdcxx = '11' - # else: - stdcxx = '20' + if is_manylinux(): + stdcxx = '11' + else: + stdcxx = '20' if not stdcxx in ['11', '14', '17', '20']: log.fatal('FATAL: envar STDCXX should be one of 11, 14, 17, or 20') From 0e2bb1066abb150000209fee5337b7399bc300c3 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 19 Feb 2023 09:20:24 +0100 Subject: [PATCH 49/69] Force stdcxx=20 --- cling/setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cling/setup.py b/cling/setup.py index b1789636..8903e80e 100755 --- a/cling/setup.py +++ b/cling/setup.py @@ -117,10 +117,10 @@ def run(self): try: stdcxx = os.environ['STDCXX'] except KeyError: - if is_manylinux(): - stdcxx = '11' - else: - stdcxx = '20' + # if is_manylinux(): + # stdcxx = '11' + # else: + stdcxx = '20' if not stdcxx in ['11', '14', '17', '20']: log.fatal('FATAL: envar STDCXX should be one of 11, 14, 17, or 20') From bf2de7ae5344c5cf6b3cac3caed658569e63836b Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Mon, 20 Feb 2023 09:22:22 +0100 Subject: [PATCH 50/69] Only run manylinux x86_84 + aarch --- cling/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index ba5e0059..14515175 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -6,7 +6,6 @@ archs = ["auto"] build-frontend = "pip" dependency-versions = "pinned" build-verbosity = "1" -build = "cp39-*" before-all = "cd cling && python create_src_directory.py" @@ -15,6 +14,8 @@ test-requires = [] test-command = 'python -c "import cppyy_backend"' [tool.cibuildwheel.linux] +build = "cp39-manylinux-*" +skip = "*-manylinux_i686" repair-wheel-command = "" # repair-wheel-command = "LD_LIBRARY_PATH=$PWD/lib auditwheel repair -w {dest_dir} {wheel}" From 99cd8aa86b7872a12d00a4a2eb2b5a4922a7dda8 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Mon, 20 Feb 2023 09:42:15 +0100 Subject: [PATCH 51/69] Be more explicit about which wheels we are building --- cling/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index 14515175..def4c7b4 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -6,6 +6,8 @@ archs = ["auto"] build-frontend = "pip" dependency-versions = "pinned" build-verbosity = "1" +build = "cp39-manylinux_{x86_64,aarch64} cp39-macosx_{x86_64,arm64} cp39-{win_amd64,win32}" + before-all = "cd cling && python create_src_directory.py" @@ -14,8 +16,6 @@ test-requires = [] test-command = 'python -c "import cppyy_backend"' [tool.cibuildwheel.linux] -build = "cp39-manylinux-*" -skip = "*-manylinux_i686" repair-wheel-command = "" # repair-wheel-command = "LD_LIBRARY_PATH=$PWD/lib auditwheel repair -w {dest_dir} {wheel}" From dae2d9106f3726d56ffb71f21f99d6acd01dc16a Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 9 Mar 2023 09:10:37 +0100 Subject: [PATCH 52/69] Turn on building all wheels and only build aarch64 wheels on circleci --- .circleci/config.yml | 88 +++++++++++++++--------------- .github/workflows/cling-wheels.yml | 12 ++-- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8064b4d4..4d9e3883 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,31 +1,31 @@ version: 2 # Get inspiration from https://github.com/dwavesystems/dimod/blob/main/.circleci/config.yml jobs: - linux-wheels: - working_directory: ~/linux-wheels - machine: - image: ubuntu-2004:2022.10.1 - resource_class: large - environment: - STDCXX: 20 - MAKE_NPROCS: 4 - steps: - - checkout - - run: - name: Update - command: | - sudo apt-get update && sudo apt-get install git cmake build-essential tar curl g++ gcc-9 clang-10 - - run: - name: Build the Linux wheels. - command: | - python3 -m venv venv - . venv/bin/activate - python3 -m pip install pip --upgrade - python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel cling --print-build-identifiers - python3 -m cibuildwheel cling --output-dir wheelhouse - - store_artifacts: - path: wheelhouse/ + # linux-wheels: + # working_directory: ~/linux-wheels + # machine: + # image: ubuntu-2004:2022.10.1 + # resource_class: large + # environment: + # STDCXX: 20 + # MAKE_NPROCS: 4 + # steps: + # - checkout + # - run: + # name: Update + # command: | + # sudo apt-get update && sudo apt-get install git cmake build-essential tar curl g++ gcc-9 clang-10 + # - run: + # name: Build the Linux wheels. + # command: | + # python3 -m venv venv + # . venv/bin/activate + # python3 -m pip install pip --upgrade + # python3 -m pip install cibuildwheel==2.12.0 + # python3 -m cibuildwheel cling --print-build-identifiers + # python3 -m cibuildwheel cling --output-dir wheelhouse + # - store_artifacts: + # path: wheelhouse/ linux-aarch64-wheels: working_directory: ~/linux-aarch64-wheels @@ -51,28 +51,28 @@ jobs: - store_artifacts: path: wheelhouse/ - osx-wheels: - working_directory: ~/osx-wheels - macos: - xcode: 12.5.1 - steps: - - checkout - - run: - name: Build the OS X wheels. - command: | - python3 -m venv venv - . venv/bin/activate - python3 -m pip install pip --upgrade - python3 -m pip install cibuildwheel==2.12.0 - python3 -m cibuildwheel cling --print-build-identifiers - python3 -m cibuildwheel cling --output-dir wheelhouse - - store_artifacts: - path: wheelhouse/ + # osx-wheels: + # working_directory: ~/osx-wheels + # macos: + # xcode: 12.5.1 + # steps: + # - checkout + # - run: + # name: Build the OS X wheels. + # command: | + # python3 -m venv venv + # . venv/bin/activate + # python3 -m pip install pip --upgrade + # python3 -m pip install cibuildwheel==2.12.0 + # python3 -m cibuildwheel cling --print-build-identifiers + # python3 -m cibuildwheel cling --output-dir wheelhouse + # - store_artifacts: + # path: wheelhouse/ workflows: version: 2 all-tests: jobs: - - linux-wheels - linux-aarch64-wheels - - osx-wheels \ No newline at end of file + # - linux-wheels + # - osx-wheels \ No newline at end of file diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 60878202..45c733cd 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -1,7 +1,7 @@ name: Build and upload to PyPI # Build on every branch push, tag push, and pull request change: -on: [] #push, pull_request] +on: [push] #, pull_request] # Alternatively, to publish when a (published) GitHub Release is created, use the following: # on: # push: @@ -55,11 +55,11 @@ jobs: arch: x86_64 build: "cp36-manylinux_x86_64" - - os: ubuntu-20.04 - name: manylinux-arch64 - cibw: - arch: aarch64 - build: "cp36-manylinux_aarch64" + # - os: ubuntu-20.04 + # name: manylinux-arch64 + # cibw: + # arch: aarch64 + # build: "cp36-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-pypy-arch64 From 9095eca48b8f296351d4d1857db5d095c6d76f5f Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 9 Mar 2023 09:14:45 +0100 Subject: [PATCH 53/69] Update commands on github action to not cd into cling directory --- .github/workflows/cling-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 45c733cd..6560398d 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -143,12 +143,12 @@ jobs: - name: list target wheels run: | - cd cling && python -m cibuildwheel . --print-build-identifiers + python -m cibuildwheel cling --print-build-identifiers - name: Build wheels timeout-minutes: 600 run: | - cd cling && python -m cibuildwheel --output-dir wheelhouse + python -m cibuildwheel cling --output-dir wheelhouse - uses: actions/upload-artifact@v3 with: From efb2a995f1aed40263eb21f42109f5e4fd81bede Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 9 Mar 2023 09:17:31 +0100 Subject: [PATCH 54/69] Skip building some of the wheels --- .github/workflows/cling-wheels.yml | 50 +++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 6560398d..04277ebd 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -43,11 +43,11 @@ jobs: arch: x86_64 build: "pp37-macosx_x86_64" - - os: macos-11 - name: mac-pypy-arm - cibw: - arch: arm64 - build: "pp38-macosx_arm64" + # - os: macos-11 + # name: mac-pypy-arm + # cibw: + # arch: arm64 + # build: "pp38-macosx_arm64" - os: ubuntu-20.04 name: manylinux-x86_64 @@ -61,11 +61,11 @@ jobs: # arch: aarch64 # build: "cp36-manylinux_aarch64" - - os: ubuntu-20.04 - name: manylinux-pypy-arch64 - cibw: - arch: aarch64 - build: "pp37-manylinux_aarch64" + # - os: ubuntu-20.04 + # name: manylinux-pypy-arch64 + # cibw: + # arch: aarch64 + # build: "pp37-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-i686 @@ -79,23 +79,23 @@ jobs: arch: x86_64 build: "pp37-manylinux_x86_64" - - os: ubuntu-20.04 - name: musllinux-x86_64 - cibw: - arch: x86_64 - build: "cp36-musllinux_x86_64" + # - os: ubuntu-20.04 + # name: musllinux-x86_64 + # cibw: + # arch: x86_64 + # build: "cp36-musllinux_x86_64" - - os: ubuntu-20.04 - name: musllinux-pypy-x86_64 - cibw: - arch: x86_64 - build: "pp37-musllinux_x86_64" + # - os: ubuntu-20.04 + # name: musllinux-pypy-x86_64 + # cibw: + # arch: x86_64 + # build: "pp37-musllinux_x86_64" - - os: ubuntu-20.04 - name: musllinux-i686 - cibw: - arch: i686 - build: "cp36-musllinux_i686" + # - os: ubuntu-20.04 + # name: musllinux-i686 + # cibw: + # arch: i686 + # build: "cp36-musllinux_i686" - os: windows-2019 name: win32 From 10654023592b21b86afd412d8587e3ad69c1007b Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 9 Mar 2023 10:03:51 +0100 Subject: [PATCH 55/69] Try to set MACOSX_DEPLOYMENT_TARGET to 10.15 also for amd --- cling/pyproject.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cling/pyproject.toml b/cling/pyproject.toml index def4c7b4..c346401e 100644 --- a/cling/pyproject.toml +++ b/cling/pyproject.toml @@ -19,10 +19,7 @@ test-command = 'python -c "import cppyy_backend"' repair-wheel-command = "" # repair-wheel-command = "LD_LIBRARY_PATH=$PWD/lib auditwheel repair -w {dest_dir} {wheel}" -[tool.cibuildwheel.macos.environment] -MACOSX_DEPLOYMENT_TARGET = "10.9" - # mac-arm target is 10.15 [[tool.cibuildwheel.overrides]] -select = "*macos*{universal2,arm64}*" +select = "*macos*" environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" } \ No newline at end of file From 230004e7b9742698a95b209eb7e596c93ff1d02a Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 9 Mar 2023 21:29:31 +0100 Subject: [PATCH 56/69] Start working on connecting github actions with circleci --- .circleci/config.yml | 61 ++++++------------------------ .github/workflows/cling-wheels.yml | 35 ++++++++++++----- 2 files changed, 37 insertions(+), 59 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d9e3883..0a1ffe93 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,32 +1,13 @@ -version: 2 -# Get inspiration from https://github.com/dwavesystems/dimod/blob/main/.circleci/config.yml -jobs: - # linux-wheels: - # working_directory: ~/linux-wheels - # machine: - # image: ubuntu-2004:2022.10.1 - # resource_class: large - # environment: - # STDCXX: 20 - # MAKE_NPROCS: 4 - # steps: - # - checkout - # - run: - # name: Update - # command: | - # sudo apt-get update && sudo apt-get install git cmake build-essential tar curl g++ gcc-9 clang-10 - # - run: - # name: Build the Linux wheels. - # command: | - # python3 -m venv venv - # . venv/bin/activate - # python3 -m pip install pip --upgrade - # python3 -m pip install cibuildwheel==2.12.0 - # python3 -m cibuildwheel cling --print-build-identifiers - # python3 -m cibuildwheel cling --output-dir wheelhouse - # - store_artifacts: - # path: wheelhouse/ +version: 2.1 + +parameters: + build_aarch64_wheel: + description: "Whether to build aarch64 wheel on CircleCI" + default: false + type: boolean + +jobs: linux-aarch64-wheels: working_directory: ~/linux-aarch64-wheels machine: @@ -51,28 +32,10 @@ jobs: - store_artifacts: path: wheelhouse/ - # osx-wheels: - # working_directory: ~/osx-wheels - # macos: - # xcode: 12.5.1 - # steps: - # - checkout - # - run: - # name: Build the OS X wheels. - # command: | - # python3 -m venv venv - # . venv/bin/activate - # python3 -m pip install pip --upgrade - # python3 -m pip install cibuildwheel==2.12.0 - # python3 -m cibuildwheel cling --print-build-identifiers - # python3 -m cibuildwheel cling --output-dir wheelhouse - # - store_artifacts: - # path: wheelhouse/ workflows: - version: 2 - all-tests: + build-aarch64-wheels: + when: << pipeline.parameters.build_aarch64_wheel >> jobs: - linux-aarch64-wheels - # - linux-wheels - # - osx-wheels \ No newline at end of file + \ No newline at end of file diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 04277ebd..d435f54c 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -1,16 +1,31 @@ name: Build and upload to PyPI -# Build on every branch push, tag push, and pull request change: -on: [push] #, pull_request] -# Alternatively, to publish when a (published) GitHub Release is created, use the following: -# on: -# push: -# pull_request: -# release: -# types: -# - published +on: + workflow_dispatch: + inputs: + build_aarch64_wheel: + description: "Whether to build aarch64 wheel on CircleCI" + default: false + type: boolean + branch: + description: "Which branch to target" + default: build-wheels-with-cibuildwheel + type: string jobs: + build-aarch64-wheels: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: setup python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + - name: Trigger circleci build for ARM + run: | + echo "Need to trigger circleci pipeline" + build_wheels: name: Build wheels on ${{ matrix.cibw.build }} runs-on: ${{ matrix.os }} @@ -120,7 +135,7 @@ jobs: - uses: actions/checkout@v3 - name: setup python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: "3.9" architecture: ${{ matrix.architecture }} From fc809b537b7e6fa7b73745f235e7bc1215c2531c Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 9 Mar 2023 21:37:48 +0100 Subject: [PATCH 57/69] Add now commit to try to trigger workflow dispatch --- .github/workflows/cling-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index d435f54c..ed4bb2f3 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v3 - - name: setup python + - name: Setup python uses: actions/setup-python@v4 with: python-version: "3.9" From e88e52fb21d38b66d4498174b056bb09c8214b67 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 9 Mar 2023 22:10:31 +0100 Subject: [PATCH 58/69] Add version in circleci workflow --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0a1ffe93..020da371 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,7 @@ jobs: workflows: + version: 2 build-aarch64-wheels: when: << pipeline.parameters.build_aarch64_wheel >> jobs: From 131b39d24c0a2540c4913aa4565b3fdb86b9c11a Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 08:37:20 +0100 Subject: [PATCH 59/69] Add script for interacting with circleci API --- .github/workflows/cling-wheels.yml | 72 +++++---------- circleci.py | 143 +++++++++++++++++++++++++++++ 2 files changed, 168 insertions(+), 47 deletions(-) create mode 100644 circleci.py diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index ed4bb2f3..f327a774 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -1,16 +1,6 @@ name: Build and upload to PyPI -on: - workflow_dispatch: - inputs: - build_aarch64_wheel: - description: "Whether to build aarch64 wheel on CircleCI" - default: false - type: boolean - branch: - description: "Which branch to target" - default: build-wheels-with-cibuildwheel - type: string +on: [push] jobs: build-aarch64-wheels: @@ -24,7 +14,8 @@ jobs: python-version: "3.9" - name: Trigger circleci build for ARM run: | - echo "Need to trigger circleci pipeline" + export JOBID=$(python3 circleci.py job) + echo "jobid=$JOBID" >> $GITHUB_ENV build_wheels: name: Build wheels on ${{ matrix.cibw.build }} @@ -58,29 +49,12 @@ jobs: arch: x86_64 build: "pp37-macosx_x86_64" - # - os: macos-11 - # name: mac-pypy-arm - # cibw: - # arch: arm64 - # build: "pp38-macosx_arm64" - - os: ubuntu-20.04 name: manylinux-x86_64 cibw: arch: x86_64 build: "cp36-manylinux_x86_64" - # - os: ubuntu-20.04 - # name: manylinux-arch64 - # cibw: - # arch: aarch64 - # build: "cp36-manylinux_aarch64" - - # - os: ubuntu-20.04 - # name: manylinux-pypy-arch64 - # cibw: - # arch: aarch64 - # build: "pp37-manylinux_aarch64" - os: ubuntu-20.04 name: manylinux-i686 @@ -94,24 +68,6 @@ jobs: arch: x86_64 build: "pp37-manylinux_x86_64" - # - os: ubuntu-20.04 - # name: musllinux-x86_64 - # cibw: - # arch: x86_64 - # build: "cp36-musllinux_x86_64" - - # - os: ubuntu-20.04 - # name: musllinux-pypy-x86_64 - # cibw: - # arch: x86_64 - # build: "pp37-musllinux_x86_64" - - # - os: ubuntu-20.04 - # name: musllinux-i686 - # cibw: - # arch: i686 - # build: "cp36-musllinux_i686" - - os: windows-2019 name: win32 cibw: @@ -181,3 +137,25 @@ jobs: - uses: actions/upload-artifact@v3 with: path: ./cling/dist/*.tar.gz + + upload_aarch64_wheel: + needs: build_wheels # Just wait until this workflow is done - then aarch64 should be done + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Get wheel from CircleCI artifact + run: | + WHEEL_PATH=$(python circleci.py artifact --build ${{ env.jobid }}) + echo "wheel_path=$WHEEL_PATH" >> $GITHUB_ENV + + - uses: actions/upload-artifact@v3 + with: + path: env.wheel_path \ No newline at end of file diff --git a/circleci.py b/circleci.py new file mode 100644 index 00000000..305dbd7a --- /dev/null +++ b/circleci.py @@ -0,0 +1,143 @@ +import http.client +from typing import Sequence +import argparse +import os +import urllib.request +from pathlib import Path +import time +import json + + +def get_artifact( + token: str, + vcs: str = "github", + org: str = "finsberg", + project: str = "cppyy-backend", + build: int = 0, + **kwargs, +) -> int: + + conn = http.client.HTTPSConnection("circleci.com") + + headers = {"Circle-Token": token} + + conn.request( + "GET", + f"/api/v2/project/{vcs}/{org}/{project}/{build}/artifacts", + headers=headers, + ) + + res = conn.getresponse() + data = json.loads(res.read().decode("utf-8")) + url = data["items"][0]["url"] + path = Path(data["items"][0]["path"]) + path.parent.mkdir(exist_ok=True) + + urllib.request.urlretrieve(url, path) + time.sleep(1.0) + print(path) + return 0 + + +def start_job( + token: str, + vcs: str = "github", + org: str = "finsberg", + project: str = "cppyy-backend", + build_aarch64_wheel: bool = True, + branch: str = "build-wheels-with-cibuildwheel", + **kwargs, +) -> int: + import http.client + + conn = http.client.HTTPSConnection("circleci.com") + + headers = { + "content-type": "application/json", + "Circle-Token": f"{token}", + } + + # Start pipeline + payload = { + "branch": branch, + "parameters": {"build_aarch64_wheel": build_aarch64_wheel}, + } + conn.request( + "POST", + f"/api/v2/project/{vcs}/{org}/{project}/pipeline", + json.dumps(payload), + headers, + ) + res = conn.getresponse() + pipeline_data = json.loads(res.read().decode("utf-8")) + + # Get pipeline id + conn.request( + "GET", + f"/api/v2/project/{vcs}/{org}/{project}/pipeline/{pipeline_data['number']}", + headers=headers, + ) + res = conn.getresponse() + data = json.loads(res.read().decode("utf-8")) + + # Get workflow id + conn.request( + "GET", + f"/api/v2/pipeline/{data['id']}/workflow", + headers=headers, + ) + + res = conn.getresponse() + workflow_data = json.loads(res.read().decode("utf-8")) + + # Get job id + conn.request( + "GET", + f"/api/v2/workflow/{workflow_data['items'][0]['id']}/job", + headers=headers, + ) + + res = conn.getresponse() + job_data = json.loads(res.read().decode("utf-8")) + + print(job_data["items"][0]["job_number"]) + return 0 + + +def main(argv: Sequence[str] | None = None) -> int: + parser = argparse.ArgumentParser() + + parser.add_argument("--token", default=os.environ.get("CIRCLE_API_TOKEN")) + parser.add_argument("mode", choices=["artifact", "job"]) + parser.add_argument("--vcs", default="github") + parser.add_argument("--org", default="finsberg") + parser.add_argument("--project", default="cppyy-backend") + parser.add_argument("--build", default=0) + parser.add_argument("--build-aarch64-wheel", default=True) + + kwargs = vars(parser.parse_args(argv)) + mode = kwargs.pop("mode") + + if mode == "artifact": + return get_artifact(**kwargs) + + if mode == "job": + return start_job(**kwargs) + + print("Invaild arguments") + print(f"You entered: {kwargs}") + return 1 + + +def test_main(capsys): + arguments = ["First argument", "-f", "--optional", "world"] + main(arguments) + out, err = capsys.readouterr() + assert ( + out + == "You entered: {'f': True, 'optional': 'world', 'required': 'First argument'}\n" + ) + + +if __name__ == "__main__": + raise SystemExit(main()) From 63ef7837f0a80312030937c4b1398ad4f4719ca6 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 08:38:44 +0100 Subject: [PATCH 60/69] Use python 3.10 --- .github/workflows/cling-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index f327a774..401182de 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -11,7 +11,7 @@ jobs: - name: Setup python uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: "3.10" - name: Trigger circleci build for ARM run: | export JOBID=$(python3 circleci.py job) @@ -149,7 +149,7 @@ jobs: - name: Setup python uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: "3.10" - name: Get wheel from CircleCI artifact run: | From b842d88a5ac1f6c1e089a164111bb03a6985452c Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 08:43:47 +0100 Subject: [PATCH 61/69] Add secret token --- .github/workflows/cling-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 401182de..3d8f2f81 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -14,7 +14,7 @@ jobs: python-version: "3.10" - name: Trigger circleci build for ARM run: | - export JOBID=$(python3 circleci.py job) + export JOBID=$(python3 circleci.py job --token ${{ secrets.CIRCLE_API_TOKEN }}) echo "jobid=$JOBID" >> $GITHUB_ENV build_wheels: From a7dc068153df90a89f1aa12c812635a63aaadee7 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 08:50:21 +0100 Subject: [PATCH 62/69] Add some delay between commands --- circleci.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/circleci.py b/circleci.py index 305dbd7a..98b9c251 100644 --- a/circleci.py +++ b/circleci.py @@ -70,6 +70,7 @@ def start_job( ) res = conn.getresponse() pipeline_data = json.loads(res.read().decode("utf-8")) + time.sleep(1.0) # Get pipeline id conn.request( @@ -80,6 +81,8 @@ def start_job( res = conn.getresponse() data = json.loads(res.read().decode("utf-8")) + time.sleep(1.0) + # Get workflow id conn.request( "GET", @@ -90,6 +93,8 @@ def start_job( res = conn.getresponse() workflow_data = json.loads(res.read().decode("utf-8")) + time.sleep(1.0) + # Get job id conn.request( "GET", From 560773a44df96037c3f72da831232b9ce6b98394 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 08:58:27 +0100 Subject: [PATCH 63/69] Add missing curly braces --- .github/workflows/cling-wheels.yml | 4 ++-- circleci.py | 16 +++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 3d8f2f81..c3ae2620 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -153,9 +153,9 @@ jobs: - name: Get wheel from CircleCI artifact run: | - WHEEL_PATH=$(python circleci.py artifact --build ${{ env.jobid }}) + WHEEL_PATH=$(python circleci.py artifact --job-id ${{ env.jobid }}) echo "wheel_path=$WHEEL_PATH" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 with: - path: env.wheel_path \ No newline at end of file + path: ${{ env.wheel_path }} \ No newline at end of file diff --git a/circleci.py b/circleci.py index 98b9c251..1da78f97 100644 --- a/circleci.py +++ b/circleci.py @@ -13,7 +13,7 @@ def get_artifact( vcs: str = "github", org: str = "finsberg", project: str = "cppyy-backend", - build: int = 0, + job_id: int = 0, **kwargs, ) -> int: @@ -23,7 +23,7 @@ def get_artifact( conn.request( "GET", - f"/api/v2/project/{vcs}/{org}/{project}/{build}/artifacts", + f"/api/v2/project/{vcs}/{org}/{project}/{job_id}/artifacts", headers=headers, ) @@ -117,7 +117,7 @@ def main(argv: Sequence[str] | None = None) -> int: parser.add_argument("--vcs", default="github") parser.add_argument("--org", default="finsberg") parser.add_argument("--project", default="cppyy-backend") - parser.add_argument("--build", default=0) + parser.add_argument("--job-id", default=0) parser.add_argument("--build-aarch64-wheel", default=True) kwargs = vars(parser.parse_args(argv)) @@ -134,15 +134,5 @@ def main(argv: Sequence[str] | None = None) -> int: return 1 -def test_main(capsys): - arguments = ["First argument", "-f", "--optional", "world"] - main(arguments) - out, err = capsys.readouterr() - assert ( - out - == "You entered: {'f': True, 'optional': 'world', 'required': 'First argument'}\n" - ) - - if __name__ == "__main__": raise SystemExit(main()) From 9868c98475197801d42701b470c5f71af2cde0d4 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 09:01:25 +0100 Subject: [PATCH 64/69] Rename job-id to job-number --- .github/workflows/cling-wheels.yml | 6 +++--- circleci.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index c3ae2620..decabf8d 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -14,8 +14,8 @@ jobs: python-version: "3.10" - name: Trigger circleci build for ARM run: | - export JOBID=$(python3 circleci.py job --token ${{ secrets.CIRCLE_API_TOKEN }}) - echo "jobid=$JOBID" >> $GITHUB_ENV + export JOB_NUMBER=$(python3 circleci.py job --token ${{ secrets.CIRCLE_API_TOKEN }}) + echo "job_number=$JOB_NUMBER" >> $GITHUB_ENV build_wheels: name: Build wheels on ${{ matrix.cibw.build }} @@ -153,7 +153,7 @@ jobs: - name: Get wheel from CircleCI artifact run: | - WHEEL_PATH=$(python circleci.py artifact --job-id ${{ env.jobid }}) + WHEEL_PATH=$(python circleci.py artifact --job-number ${{ env.job_number }}) echo "wheel_path=$WHEEL_PATH" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 diff --git a/circleci.py b/circleci.py index 1da78f97..6065a0c3 100644 --- a/circleci.py +++ b/circleci.py @@ -13,7 +13,7 @@ def get_artifact( vcs: str = "github", org: str = "finsberg", project: str = "cppyy-backend", - job_id: int = 0, + job_number: int = 0, **kwargs, ) -> int: @@ -23,7 +23,7 @@ def get_artifact( conn.request( "GET", - f"/api/v2/project/{vcs}/{org}/{project}/{job_id}/artifacts", + f"/api/v2/project/{vcs}/{org}/{project}/{job_number}/artifacts", headers=headers, ) @@ -117,7 +117,7 @@ def main(argv: Sequence[str] | None = None) -> int: parser.add_argument("--vcs", default="github") parser.add_argument("--org", default="finsberg") parser.add_argument("--project", default="cppyy-backend") - parser.add_argument("--job-id", default=0) + parser.add_argument("--job-number", default=0) parser.add_argument("--build-aarch64-wheel", default=True) kwargs = vars(parser.parse_args(argv)) From 561c66f0f4d44ff3eae6481884bf8fc9aff750bc Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 11:33:52 +0100 Subject: [PATCH 65/69] Update path for built wheels in github action --- .github/workflows/cling-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index decabf8d..d9f47365 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -123,7 +123,7 @@ jobs: - uses: actions/upload-artifact@v3 with: - path: ./cling/wheelhouse/*.whl + path: ./wheelhouse/*.whl build_sdist: name: Build source distribution From 40a7af6a2bf4f2ec3819f50e28350f8da071d379 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 12:15:13 +0100 Subject: [PATCH 66/69] Update GITHUB_OUTPUT to share data between jobs --- .github/workflows/cling-wheels.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index d9f47365..6057f556 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -13,9 +13,10 @@ jobs: with: python-version: "3.10" - name: Trigger circleci build for ARM + id: aarch64-job-number run: | export JOB_NUMBER=$(python3 circleci.py job --token ${{ secrets.CIRCLE_API_TOKEN }}) - echo "job_number=$JOB_NUMBER" >> $GITHUB_ENV + echo "job_number=$JOB_NUMBER" >> $GITHUB_OUTPUT build_wheels: name: Build wheels on ${{ matrix.cibw.build }} @@ -153,7 +154,7 @@ jobs: - name: Get wheel from CircleCI artifact run: | - WHEEL_PATH=$(python circleci.py artifact --job-number ${{ env.job_number }}) + export WHEEL_PATH=$(python circleci.py artifact --job-number ${{ steps.aarch64-job-number.outputs.job_number }}) echo "wheel_path=$WHEEL_PATH" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 From ccf494103f01eef42bae4a98be2cc88dc36ef884 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 15:33:40 +0100 Subject: [PATCH 67/69] Try with outputs again --- .github/workflows/cling-wheels.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 6057f556..66c5068c 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -5,6 +5,8 @@ on: [push] jobs: build-aarch64-wheels: runs-on: ubuntu-latest + outputs: + job_number: ${{ steps.aarch64-job-number.outputs.job_number }} steps: - uses: actions/checkout@v3 @@ -140,7 +142,7 @@ jobs: path: ./cling/dist/*.tar.gz upload_aarch64_wheel: - needs: build_wheels # Just wait until this workflow is done - then aarch64 should be done + needs: [build_wheels, build-aarch64-wheels] # Just wait until this workflow is done - then aarch64 should be done runs-on: ubuntu-latest steps: @@ -153,8 +155,10 @@ jobs: python-version: "3.10" - name: Get wheel from CircleCI artifact + env: + JOB_NUMBER: ${{ needs.build-aarch64-wheels.outputs.job_number }} run: | - export WHEEL_PATH=$(python circleci.py artifact --job-number ${{ steps.aarch64-job-number.outputs.job_number }}) + export WHEEL_PATH=$(python circleci.py artifact --job-number $JOB_NUMBER) echo "wheel_path=$WHEEL_PATH" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 From b406bf8482f84aa32cdf3c1a07df3e12869efc82 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 19:39:24 +0100 Subject: [PATCH 68/69] Make sure to provde token to artifact command --- .github/workflows/cling-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 66c5068c..5078d0e5 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -158,7 +158,7 @@ jobs: env: JOB_NUMBER: ${{ needs.build-aarch64-wheels.outputs.job_number }} run: | - export WHEEL_PATH=$(python circleci.py artifact --job-number $JOB_NUMBER) + export WHEEL_PATH=$(python circleci.py artifact --job-number $JOB_NUMBER --token ${{ secrets.CIRCLE_API_TOKEN }})) echo "wheel_path=$WHEEL_PATH" >> $GITHUB_ENV - uses: actions/upload-artifact@v3 From a424091484c5f291f2b19b190c172230798bd80d Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Fri, 10 Mar 2023 22:37:29 +0100 Subject: [PATCH 69/69] Remove extra right paren --- .github/workflows/cling-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cling-wheels.yml b/.github/workflows/cling-wheels.yml index 5078d0e5..d4993040 100644 --- a/.github/workflows/cling-wheels.yml +++ b/.github/workflows/cling-wheels.yml @@ -158,7 +158,7 @@ jobs: env: JOB_NUMBER: ${{ needs.build-aarch64-wheels.outputs.job_number }} run: | - export WHEEL_PATH=$(python circleci.py artifact --job-number $JOB_NUMBER --token ${{ secrets.CIRCLE_API_TOKEN }})) + export WHEEL_PATH=$(python circleci.py artifact --job-number $JOB_NUMBER --token ${{ secrets.CIRCLE_API_TOKEN }}) echo "wheel_path=$WHEEL_PATH" >> $GITHUB_ENV - uses: actions/upload-artifact@v3