Skip to content

Commit

Permalink
Fix macos build (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
Congyuwang authored Nov 2, 2024
1 parent c6e1695 commit 8bee8c6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
export CC=${HOMEBREW_PREFIX}/opt/llvm@19/bin/clang
export CXX=${HOMEBREW_PREFIX}/opt/llvm@19/bin/clang++
export AR=${HOMEBREW_PREFIX}/opt/llvm@19/bin/llvm-ar
export CFLAGS="-flto=thin -O3"
export CXXFLAGS="-flto=thin -O3"
export CFLAGS="-flto=thin -O3 --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
export CXXFLAGS="-flto=thin -O3 --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
export LLD=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld
export RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${LLD}"
maturin build --release --target aarch64-apple-darwin --out dist -i ${{ matrix.py_version }}
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
name: wheels-win-${{ matrix.py_version }}
path: dist

manylinux_2_28:
manylinux_2_28_x86_64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
name: wheels-manylinux_2_28-${{ matrix.target }}
path: dist

manylinux2014:
manylinux2014_x86_64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -275,13 +275,21 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-manylinux_2014-${{ matrix.target }}
name: wheels-manylinux2014-${{ matrix.target }}
path: dist

release:
name: Release
runs-on: ubuntu-latest
needs: [windows, manylinux_2_28, manylinux2014, macos, linux-cross]
needs:
[
windows,
macos,
manylinux_2_28_x86_64,
manylinux2014_x86_64,
manylinux_2_28_arm64,
manylinux2014_arm64,
]
steps:
- uses: actions/download-artifact@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
export CC=${HOMEBREW_PREFIX}/opt/llvm@19/bin/clang
export CXX=${HOMEBREW_PREFIX}/opt/llvm@19/bin/clang++
export AR=${HOMEBREW_PREFIX}/opt/llvm@19/bin/llvm-ar
export CFLAGS="-flto=thin -O3"
export CXXFLAGS="-flto=thin -O3"
export CFLAGS="-flto=thin -O3 --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
export CXXFLAGS="-flto=thin -O3 --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"
export LLD=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld
export RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${LLD}"
maturin build --release --target aarch64-apple-darwin --out dist -i ${{ matrix.py_version }}
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
name: wheels-win-${{ matrix.py_version }}
path: dist

manylinux_2_28:
manylinux_2_28_x86_64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
name: wheels-manylinux_2_28-${{ matrix.target }}
path: dist

manylinux2014:
manylinux2014_x86_64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -275,5 +275,5 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-manylinux_2014-${{ matrix.target }}
name: wheels-manylinux2014-${{ matrix.target }}
path: dist
12 changes: 6 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ develop:
CC=${HOMEBREW_PREFIX}/opt/llvm/bin/clang \
CXX=${HOMEBREW_PREFIX}/opt/llvm/bin/clang++ \
AR=${HOMEBREW_PREFIX}/opt/llvm/bin/llvm-ar \
CFLAGS="-flto=thin -O3" \
CXXFLAGS="-flto=thin -O3" \
CFLAGS="-flto=thin -O3 --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" \
CXXFLAGS="-flto=thin -O3 --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" \
RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld" \
maturin develop --release --verbose

Expand All @@ -20,8 +20,8 @@ build:
CC=${HOMEBREW_PREFIX}/opt/llvm/bin/clang \
CXX=${HOMEBREW_PREFIX}/opt/llvm/bin/clang++ \
AR=${HOMEBREW_PREFIX}/opt/llvm/bin/llvm-ar \
CFLAGS="-flto=thin -O3" \
CXXFLAGS="-flto=thin -O3" \
CFLAGS="-flto=thin -O3 --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" \
CXXFLAGS="-flto=thin -O3 --sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" \
RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld" \
maturin build --release --verbose

Expand All @@ -30,7 +30,7 @@ bin:
CC=${HOMEBREW_PREFIX}/opt/llvm/bin/clang \
CXX=${HOMEBREW_PREFIX}/opt/llvm/bin/clang++ \
AR=${HOMEBREW_PREFIX}/opt/llvm/bin/llvm-ar \
CFLAGS="-flto=thin -O3" \
CXXFLAGS="-flto=thin -O3" \
CFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" \
CXXFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" \
RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld" \
cargo build --release --bin create_cf_db

0 comments on commit 8bee8c6

Please sign in to comment.