From e2a26070c4e8b12bc3793b88794946f20490279c Mon Sep 17 00:00:00 2001 From: rob-p Date: Sat, 15 Aug 2026 13:25:16 -0400 Subject: [PATCH 1/2] ci: cache Rust builds and drop ineffective LTO --- .github/workflows/release.yml | 4 ++++ .github/workflows/test_simpleaf.yml | 15 ++++++++++++--- Cargo.lock | 1 - Cargo.toml | 7 ------- dist-workspace.toml | 4 ++++ 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9aa406..cb93b88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,6 +127,10 @@ jobs: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y echo "$HOME/.cargo/bin" >> $GITHUB_PATH fi + - uses: swatinem/rust-cache@v2 + with: + key: ${{ join(matrix.targets, '-') }} + cache-provider: ${{ matrix.cache_provider }} - name: Install dist run: ${{ matrix.install_dist.run }} # Get the dist-manifest diff --git a/.github/workflows/test_simpleaf.yml b/.github/workflows/test_simpleaf.yml index 5669507..ed27bf7 100644 --- a/.github/workflows/test_simpleaf.yml +++ b/.github/workflows/test_simpleaf.yml @@ -29,6 +29,15 @@ jobs: toolchain: stable override: true components: rustfmt + + # simpleaf has a large, stable dependency graph (notably Polars and + # HDF5). Cache dependency artifacts separately for each runner/toolchain; + # rust-cache derives the remaining key from Cargo.lock and the Rust + # environment, and deliberately excludes simpleaf itself. + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true # Cheap and compiles nothing, so it runs first. - name: Check formatting @@ -38,9 +47,9 @@ jobs: run: cargo build --verbose --release # Deliberately `--release`: it reuses the artifacts the Build step just - # produced, which makes this ~30s. A debug `cargo test` would rebuild the - # whole dependency graph in a second profile — including HDF5, which is - # compiled from source — and cost minutes. + # produced. A debug `cargo test` would rebuild the whole dependency graph + # in a second profile — including HDF5, which is compiled from source — + # and cost minutes. # # This job previously ran neither this nor `cargo fmt`, which is how a # test that did not compile, and a stale CLI snapshot, both reached main. diff --git a/Cargo.lock b/Cargo.lock index 4bc4d51..73c676c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4629,7 +4629,6 @@ dependencies = [ "af-anndata", "anyhow", "blake3", - "cc", "chrono", "clap", "cmd_lib", diff --git a/Cargo.toml b/Cargo.toml index a001972..0208e37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,8 +36,6 @@ categories = ["command-line-utilities", "science"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cc = "1.2.20" - # seq_geom_parser (chumsky-based, from the piscem-rs workspace) — used for # geometry validation and multiplex-quant. Published on crates.io; the # `.cargo/config.toml` patch this comment used to describe is long gone (there @@ -107,11 +105,6 @@ tempfile = "3.19.1" ureq = { version = "3.0.11", features = ["json"] } file-requirements = "0.1.0" -[profile.release] -lto = "thin" -opt-level = 3 - # The profile that 'cargo dist' will build with [profile.dist] inherits = "release" -lto = "thin" diff --git a/dist-workspace.toml b/dist-workspace.toml index 6d6b111..8d2e60a 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -13,6 +13,10 @@ installers = ["shell"] targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"] # Which actions to run on pull requests pr-run-mode = "plan" +# Preserve compiled dependency artifacts between release builds. This is most +# useful when rerunning a failed release or when dependencies stay fixed across +# patch releases; cargo-dist keys each target independently. +cache-builds = true # Whether to install an updater program install-updater = true # Path that installers should place binaries in From 8ee2edde6aca6537ab4626b606182cc27e9a257d Mon Sep 17 00:00:00 2001 From: rob-p Date: Sat, 15 Aug 2026 13:44:51 -0400 Subject: [PATCH 2/2] ci: update actions to supported runtimes --- .github/workflows/test_simpleaf.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_simpleaf.yml b/.github/workflows/test_simpleaf.yml index ed27bf7..0788883 100644 --- a/.github/workflows/test_simpleaf.yml +++ b/.github/workflows/test_simpleaf.yml @@ -21,13 +21,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout repository - uses: actions/checkout@v2.4.2 + uses: actions/checkout@v6 - name: Install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true components: rustfmt # simpleaf has a large, stable dependency graph (notably Polars and @@ -63,7 +61,7 @@ jobs: run: cargo doc --no-deps - name: Install conda env - uses: conda-incubator/setup-miniconda@v3 + uses: conda-incubator/setup-miniconda@v4 with: channels: conda-forge,default,bioconda channel-priority: true