Skip to content

Use Cargo's trim-paths profile option - #428

Draft
kleisauke wants to merge 1 commit into
lovell:mainfrom
kleisauke:cargo-trim-paths
Draft

kleisauke wants to merge 1 commit into
lovell:mainfrom
kleisauke:cargo-trim-paths

Conversation

@kleisauke

Copy link
Copy Markdown
Collaborator

profile.trim-paths was stabilized via commit rust-lang/cargo@784be26 (as available in Rust nightly-2026-10-09).

Context: #283 (comment).

@kleisauke

Copy link
Copy Markdown
Collaborator Author

This reminds me that we could also set the SOURCE_DATE_EPOCH env as a possible follow-up (see e.g. commit libvips/build-win64-mxe@8c9838e). I also came across PR imgproxy/imgproxy-docker-base#13, which looks interesting (though I'm not sure how we'd distribute those *.cdx.json files in that case).

FWIW, there's been a lot of issue noise around provenance/SBOM/reproducibility lately, probably from AI agents (judging by how new these accounts are). This could help reduce it.

@kleisauke

Copy link
Copy Markdown
Collaborator Author

Marking as a draft, as this doesn't work yet. cargo-c needs to bump its cargo crate dependency to a future 0.101.0 release first.

Error: CliError { error: Some(config profile `release` is not valid (defined in `environment variable `CARGO_PROFILE_RELEASE``)

Caused by:
    feature `trim-paths` is required
    
    The package requires the Cargo feature called `trim-paths`, but that feature is not stabilized in this version of Cargo (1.99.0).
    Consider adding `cargo-features = ["trim-paths"]` to the top of Cargo.toml (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
    See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#profile-trim-paths-option for more information about the status of this feature.
    ), exit_code: 101 }

(I assumed this would work because it was possible in wasm-vips, but that uses libresvg and plain cargo build).

@kleisauke
kleisauke marked this pull request as draft October 13, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant