Skip to content

Commit

Permalink
optimize windows and mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
Congyuwang committed Feb 20, 2024
1 parent a713c75 commit 4ab683e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,23 @@ jobs:
with:
python-version: ${{ matrix.py_version }}
architecture: x64
- name: Install llvm-17
run: brew install llvm@17
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- name: Build wheels - universal2
- name: Build wheels
run: |
eval "$(brew shellenv)"
export MACOSX_DEPLOYMENT_TARGET=10.14
export LIBCLANG_PATH=${HOMEBREW_PREFIX}/opt/llvm/lib
rustup target add aarch64-apple-darwin
pip install maturin
maturin build --release --target universal2-apple-darwin --out dist
- name: Install built wheel - universal2
maturin build --release --target aarch64-apple-darwin --out dist
maturin build --release --target x86_64-apple-darwin --out dist
- name: Install built wheel
run: |
pip install rocksdict --no-index --find-links dist --force-reinstall || true
pip install speedict --no-index --find-links dist --force-reinstall || true
Expand Down Expand Up @@ -57,8 +62,8 @@ jobs:
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: 11.0
directory: ${{ runner.temp }}/llvm-11.0
version: 17.0
directory: ${{ runner.temp }}/llvm-17.0
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -70,7 +75,7 @@ jobs:
target: ${{ matrix.target }}
args: --release --out dist
env:
LIBCLANG_PATH: ${{ runner.temp }}/llvm-11.0/lib
LIBCLANG_PATH: ${{ runner.temp }}/llvm-17.0/lib
- name: Install built wheel and test
run: |
pip install rocksdict --no-index --find-links dist --force-reinstall || true
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,23 @@ jobs:
with:
python-version: ${{ matrix.py_version }}
architecture: x64
- name: Install llvm-17
run: brew install llvm@17
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- name: Build wheels - universal2
- name: Build wheels
run: |
eval "$(brew shellenv)"
export MACOSX_DEPLOYMENT_TARGET=10.14
export LIBCLANG_PATH=${HOMEBREW_PREFIX}/opt/llvm/lib
rustup target add aarch64-apple-darwin
pip install maturin
maturin build --release --target universal2-apple-darwin --out dist
- name: Install built wheel - universal2
maturin build --release --target aarch64-apple-darwin --out dist
maturin build --release --target x86_64-apple-darwin --out dist
- name: Install built wheel
run: |
pip install rocksdict --no-index --find-links dist --force-reinstall || true
pip install speedict --no-index --find-links dist --force-reinstall || true
Expand Down Expand Up @@ -57,8 +62,8 @@ jobs:
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: 11.0
directory: ${{ runner.temp }}/llvm-11.0
version: 17.0
directory: ${{ runner.temp }}/llvm-17.0
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -70,7 +75,7 @@ jobs:
target: ${{ matrix.target }}
args: --release --out dist
env:
LIBCLANG_PATH: ${{ runner.temp }}/llvm-11.0/lib
LIBCLANG_PATH: ${{ runner.temp }}/llvm-17.0/lib
- name: Install built wheel and test
run: |
pip install rocksdict --no-index --find-links dist --force-reinstall || true
Expand Down
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ libc = "0.2.112"
[dependencies.pyo3]
version = "0.20"
features = ["extension-module", "num-bigint"]

[profile.release]
codegen-units = 1
debug = false
lto = true
opt-level = 3

0 comments on commit 4ab683e

Please sign in to comment.