From ee94243a52e956d0078883be4ed4a18e9ed50f6a Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Mon, 31 Aug 2026 09:25:02 +1000 Subject: [PATCH] Separate fast local and optimized distribution builds --- .github/workflows/ci.yml | 2 +- Cargo.toml | 16 +++++++++++----- DEV.md | 12 ++---------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7648a88..12882cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v7 - uses: PyO3/maturin-action@v1 with: - args: --release --out dist -i python3.10 -i python3.11 -i python3.12 -i python3.13 + args: --profile dist --out dist -i python3.10 -i python3.11 -i python3.12 -i python3.13 manylinux: auto - uses: actions/upload-artifact@v7 with: diff --git a/Cargo.toml b/Cargo.toml index 2fcf2c6..591b649 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,15 +17,21 @@ path = "src/lib.rs" crate-type = ["cdylib", "rlib"] [profile.release] +lto = false +codegen-units = 16 + +[profile.release.package.mdhtml-crate] +incremental = true + +[profile.dist] +inherits = "release" lto = true +incremental = false codegen-units = 1 strip = true -[profile.play] -inherits = "release" -lto = false -incremental = true -codegen-units = 16 +[profile.dist.package.mdhtml-crate] +incremental = false [dependencies] base64 = "0.23.0" diff --git a/DEV.md b/DEV.md index c2eab1a..7e3d48c 100644 --- a/DEV.md +++ b/DEV.md @@ -12,18 +12,10 @@ For local development, build and install the extension into your environment: ```bash -maturin develop +maturin develop --release ``` -For performance-sensitive iteration, use the incremental optimized profile: - -```bash -maturin develop --profile play -``` - -Its first build creates a separate cache; subsequent crate rebuilds retain -optimization but skip release LTO. Use `--release` only for final production -measurements and wheels. +The `release` profile is optimized and incremental for fast local iteration. CI builds wheels with `dist`, which enables full LTO with one codegen unit, disables incremental compilation, and strips the result. Use `maturin develop --profile dist` to reproduce that artifact locally. `ship-rs-build` builds the distributable wheel. The `md2mdhtml` and `md2html` commands are Python console scripts (`python/mdhtml/__main__.py` and `python/mdhtml/md2html.py`, sharing `_cli.py`) over the `md2mdhtml` and `mdhtml2html` APIs; there is no separate Rust binary.