Skip to content

Commit

Permalink
Add macOS arm64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
xavier2k6 committed Jun 12, 2024
1 parent fda33cf commit fcbbc55
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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/
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: dependencies (MacOS)
if: runner.os == 'macOS'
run: |
brew install boost-build boost boost-python3 [email protected] openssl@1.1 python-setuptools
brew install boost-build boost boost-python3 [email protected] openssl@3.0 python-setuptools
export PATH=$(brew --prefix)/opt/[email protected]/bin:$PATH
- name: update package lists (linux)
Expand All @@ -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
Expand Down
13 changes: 8 additions & 5 deletions bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"):
Expand Down Expand Up @@ -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("")),
)
)

Expand Down
16 changes: 7 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -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]]
Expand All @@ -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"

Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion simulation/libsimulator
Submodule libsimulator updated 1 files
+9 −4 Jamfile

0 comments on commit fcbbc55

Please sign in to comment.