From fcbbc5518e3afc44e737a6b3b883b88e9dcd05cb Mon Sep 17 00:00:00 2001 From: xavier2k6 <42386382+xavier2k6@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:44:25 +0000 Subject: [PATCH] Add macOS arm64 support --- .cirrus.yml | 2 +- .github/workflows/cibuildwheel.yml | 21 +++++++++++---------- .github/workflows/python.yml | 4 ++-- bindings/python/setup.py | 13 ++++++++----- pyproject.toml | 16 +++++++--------- simulation/libsimulator | 2 +- 6 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3856f66037d..90734228f0e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -28,7 +28,7 @@ build_and_store_wheels: &BUILD_AND_STORE_WHEELS delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} install_cibuildwheel_script: - - $PYTHON -m pip install cibuildwheel==2.16.5 + - $PYTHON -m pip install cibuildwheel==2.19.0 run_cibuildwheel_script: - cibuildwheel diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 1f9390eec3c..5ea20707bf1 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -6,7 +6,7 @@ name: cibuildwheel # sample. # The full list of cibuildwheel's build targets can be found here: -# https://github.com/pypa/cibuildwheel/blob/v2.16.5/cibuildwheel/resources/build-platforms.toml +# https://github.com/pypa/cibuildwheel/blob/v2.19.0/cibuildwheel/resources/build-platforms.toml # Notes on build targets we (don't) support: # - pypy: libtorrent doesn't build with pypy as of writing @@ -45,10 +45,11 @@ jobs: MATRIX_PULL_REQUEST: | { "include": [ - {"os": "ubuntu-latest", "CIBW_BUILD": "cp37-manylinux_*", "CIBW_ARCHS": "x86_64"}, - {"os": "ubuntu-latest", "CIBW_BUILD": "cp37-musllinux_*", "CIBW_ARCHS": "x86_64"}, - {"os": "macos-12", "CIBW_BUILD": "cp37-*", "CIBW_ARCHS": "x86_64"}, - {"os": "windows-2022", "CIBW_BUILD": "cp37-*", "CIBW_ARCHS": "AMD64"} + {"os": "ubuntu-latest", "CIBW_BUILD": "cp39-manylinux_*", "CIBW_ARCHS": "x86_64"}, + {"os": "ubuntu-latest", "CIBW_BUILD": "cp39-musllinux_*", "CIBW_ARCHS": "x86_64"}, + {"os": "macos-13", "CIBW_BUILD": "cp39-*", "CIBW_ARCHS": "x86_64"}, + {"os": "macos-14", "CIBW_BUILD": "cp39-*", "CIBW_ARCHS": "arm64"}, + {"os": "windows-2022", "CIBW_BUILD": "cp39-*", "CIBW_ARCHS": "AMD64"} ] } MATRIX_WORKFLOW_DISPATCH: | @@ -104,7 +105,7 @@ jobs: - uses: docker/setup-qemu-action@v3 if: steps.cache-wheel.outputs.cache-hit != 'true' && runner.os == 'Linux' - - uses: pypa/cibuildwheel@v2.16.5 + - uses: pypa/cibuildwheel@v2.19.0 if: steps.cache-wheel.outputs.cache-hit != 'true' - uses: actions/upload-artifact@v3 @@ -126,8 +127,8 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} - packages_dir: wheelhouse - skip_existing: true + packages-dir: wheelhouse + skip-existing: true upload_pypi_test: needs: build_wheels @@ -143,6 +144,6 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} - packages_dir: wheelhouse - skip_existing: true + packages-dir: wheelhouse + skip-existing: true repository_url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 6072e41e496..0feedc84bbb 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -31,7 +31,7 @@ jobs: - name: dependencies (MacOS) if: runner.os == 'macOS' run: | - brew install boost-build boost boost-python3 python@3.12 openssl@1.1 python-setuptools + brew install boost-build boost boost-python3 python@3.12 openssl@3.0 python-setuptools export PATH=$(brew --prefix)/opt/python@3.12/bin:$PATH - name: update package lists (linux) @@ -57,7 +57,7 @@ jobs: if: runner.os == 'Windows' shell: cmd run: | - git clone --depth=1 --recurse-submodules -j10 --branch=boost-1.78.0 https://github.com/boostorg/boost.git + git clone --depth=1 --recurse-submodules -j10 --branch=boost-1.82.0 https://github.com/boostorg/boost.git cd boost bootstrap.bat diff --git a/bindings/python/setup.py b/bindings/python/setup.py index d720c475beb..7880f9fd50e 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -97,7 +97,10 @@ def b2_escape(value: str) -> str: def write_b2_python_config( - include_dirs: Sequence[str], library_dirs: Sequence[str], config: IO[str] + include_dirs: Sequence[str], + library_dirs: Sequence[str], + ext_suffix: str, + config: IO[str], ) -> None: write = config.write # b2 keys python environments by X.Y version, breaking ties by matching @@ -150,9 +153,6 @@ def write_b2_python_config( # other words we apply debian's override everywhere, and hope no other # overrides ever disagree with us. - ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") - ext_suffix = str(ext_suffix or "") - # python.jam appends the platform-specific final suffix on its own. I can't # find a consistent value from sysconfig for this. for plat_suffix in (".pyd", ".dll", ".so", ".sl"): @@ -428,7 +428,10 @@ def _configure_b2_with_distutils(self) -> Iterator[None]: if self._maybe_add_arg(f"python={sysconfig.get_python_version()}"): config_writers.append( functools.partial( - write_b2_python_config, self.include_dirs, self.library_dirs + write_b2_python_config, + self.include_dirs, + self.library_dirs, + os.path.basename(self.get_ext_fullpath("")), ) ) diff --git a/pyproject.toml b/pyproject.toml index a3b0b8c6955..35579330ea8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,8 +17,8 @@ test-command = [ [tool.cibuildwheel.macos.environment] BOOST_BUILD_PATH = "/tmp/boost/tools/build" BOOST_ROOT = "/tmp/boost" -BOOST_VERSION = "1.81.0" -MACOSX_DEPLOYMENT_TARGET = "10.9" # required for full C++11 support +BOOST_VERSION = "1.82.0" +MACOSX_DEPLOYMENT_TARGET = "11" # required for full C++11 support PATH = "/tmp/boost:$PATH" [[tool.cibuildwheel.overrides]] @@ -38,7 +38,7 @@ test-command = [ [tool.cibuildwheel.overrides.environment] # sub-table of previous block! BOOST_BUILD_PATH = "/tmp/boost/tools/build" BOOST_ROOT = "/tmp/boost" -BOOST_VERSION = "1.81.0" +BOOST_VERSION = "1.82.0" PATH = "/usr/local/ccache/bin:/tmp/boost:$PATH" [[tool.cibuildwheel.overrides]] @@ -57,20 +57,18 @@ test-command = [ [tool.cibuildwheel.overrides.environment] # sub-table of previous block! BOOST_BUILD_PATH = "/tmp/boost/tools/build" BOOST_ROOT = "/tmp/boost" -BOOST_VERSION = "1.81.0" +BOOST_VERSION = "1.82.0" PATH = "/usr/lib/ccache/bin:/tmp/boost:$PATH" [[tool.cibuildwheel.overrides]] before-all = [ - "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", - "bash -c 'choco install --no-progress --x86 openssl'" # choco only allows EITHER 32 OR 64-bit version of a package + "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'" ] select = "*-win32" [[tool.cibuildwheel.overrides]] before-all = [ - "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", - "bash -c 'choco install --no-progress openssl'" # choco only allows EITHER 32 OR 64-bit version of a package + "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'" ] select = "*-win_amd64" @@ -80,7 +78,7 @@ test-command = '''bash -c "cd '{project}/bindings/python' && python test.py"''' [tool.cibuildwheel.windows.environment] BOOST_BUILD_PATH = 'c:/boost/tools/build' BOOST_ROOT = 'c:/boost' -BOOST_VERSION = "1.81.0" +BOOST_VERSION = "1.82.0" PATH = 'c:/boost;$PATH' [tool.isort] diff --git a/simulation/libsimulator b/simulation/libsimulator index c25c485a61d..66ac6cc0b24 160000 --- a/simulation/libsimulator +++ b/simulation/libsimulator @@ -1 +1 @@ -Subproject commit c25c485a61d22103910e5861946e33d7bcd36a31 +Subproject commit 66ac6cc0b248e4655b8d21004fd24e3b62b5908d