Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
- name: Stage native binary
if: runner.os != 'Linux'
run: |
cargo build --release --bins
python tools/stage_binaries.py
cargo build --profile dist --bins
python tools/stage_binaries.py dist
- uses: PyO3/maturin-action@v1
with:
args: --release --out dist -i python3.10 -i python3.11 -i python3.12 -i python3.13 -i python3.14
args: --profile dist --out dist -i python3.10 -i python3.11 -i python3.12 -i python3.13 -i python3.14
manylinux: auto
before-script-linux: cargo build --release --bins && python3.10 tools/stage_binaries.py
before-script-linux: cargo build --profile dist --bins && python3.10 tools/stage_binaries.py dist
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
Expand Down
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,22 @@ path = "src/bin/fbz.rs"
test = false

[profile.release]
lto = false
codegen-units = 16

[profile.release.package.fbz]
incremental = true

[profile.dist]
inherits = "release"
lto = true
incremental = false
codegen-units = 1
strip = true

[profile.dist.package.fbz]
incremental = false

[dependencies]
blake3 = "1.8.7"
clap = { version = "4.6.6", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ CI tests and builds Linux on x86-64 and ARM64, and macOS on ARM64. macOS Intel r

The canonical version lives in `Cargo.toml`. `pyproject.toml` gets the Python package version from Cargo via `dynamic = ["version"]`.

The thin PEP 517 backend delegates to Maturin after building and staging the native executable, so repository and editable builds contain the same native CLI as CI-built wheels. Releases publish platform wheels rather than a Python sdist; the Rust source package is published separately to crates.io.
The thin PEP 517 backend delegates to Maturin after building and staging the native executable, so repository and editable builds contain the same native CLI as CI-built wheels. Ordinary builds use the incremental `release` profile; CI builds distributed wheels and executables with the full-LTO, single-codegen-unit, stripped `dist` profile. Releases publish platform wheels rather than a Python sdist; the Rust source package is published separately to crates.io.

## Release

Expand Down
5 changes: 3 additions & 2 deletions tools/stage_binaries.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os, shutil
import os, shutil, sys
from pathlib import Path

root = Path(__file__).resolve().parents[1]
source = root / "target" / "release"
profile = sys.argv[1] if len(sys.argv) > 1 else "release"
source = root / "target" / profile
destination = root / "target" / "wheel-data" / "scripts"
destination.mkdir(parents=True, exist_ok=True)
suffix = ".exe" if os.name == "nt" else ""
Expand Down