Repository navigation
Description
Summary
RFC: #3028
Related Issues: #4316, #8311
Implementation: #9992
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#artifact-dependencies
Issues:
Z-bindeps
Allow Cargo packages to depend on bin, cdylib, and staticlib crates, and use the artifacts built by those crates.
Unresolved issues
- Make a list of any known implementation or design issues.
- Add support for inheriting the source of an artifact dependency
- Ensure we have a test for an artifact dep on a bin with
required-featureswithout specifying the features; ensure the behavior is reasonable -
cargo treesupport: Display artifact dependency information incargo tree#14804 - Should
cargo checkjust check artifact deps, rather than build them? - Integrate with profile
trim-paths
Notes
- Once implemented, reopen Cargo: providing artifacts (for artifact dependencies) via build.rs rfcs#3035
- When stabilizing, be sure to update INDEX_V_MAX.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Progress
Activity
retep998 commentedon Mar 2, 2021
Please note that a cargo package only being able to provide a single cdylib or staticlib is a limitation imposed by cargo which technically could be lifted in the future. I'd prefer for this feature to be able to accommodate multiple cdylib or staticlib artifacts from a single package.
npmccallum commentedon Aug 13, 2021
@joshtriplett @jyn514 I found a problem in the original RFC that makes it unfit for our use case. Specifically, it is presumed that a given dependency crate will be built for one and only one architecture producing one binary artifact. We have need to build a given crate for multiple architectures producing one artifact per architecture.
bjorn3 commentedon Aug 13, 2021
Are package renames allowed? That is something like:
joshtriplett commentedon Aug 13, 2021
DrChat commentedon Oct 16, 2021
Is there anyone actively working on this RFC?
Could a
cargomaintainer post a brief write-up of how they'd implement this? E.g. relevant files in this repository, gotchas, etc.bjorn3 commentedon Oct 17, 2021
The followup RFC is rust-lang/rfcs#3176.
npmccallum commentedon Oct 17, 2021
@Byron plans to start work on this tomorrow.
DrChat commentedon Oct 17, 2021
👍 Thanks for the updates!
Byron commentedon Oct 18, 2021
Thank you @npmccallum for the introduction. Even though I am delayed, I believe a draft PR should be submitted in the next couple of days as I am ramping up.
Person-93 commentedon Nov 29, 2021
Another thing to consider is a binary crate that depends on other binary crates and expects its dependencies to be available in
PATH.add support for artifact dependencies (rust-lang#9096)
Auto merge of #9992 - Byron:rfc-3028, r=ehuss
27 remaining items
refactor: split integration tests from CLI (part 1) (#22308)
refactor: split integration tests from CLI (part 1) (#22308)
epage commentedon Mar 1, 2025
weihanglo commentedon Mar 1, 2025
peppergrayxyz commentedon Oct 31, 2025
Please also expose the feature via
cargo add --artifactcargo runfrom a build script #6412 as a duplicate of this issueTranslate smoketests from Python to Rust (#4102)
feat: add rust_bindgen example with LLVM toolchain and edition 2024 s…
feat: add rust_bindgen example with LLVM toolchain and edition 2024 s…
sylveon commentedon Jun 1, 2026
I just spent an embarrassing amount of time debugging a failure because
cargo build --bin foowill not rebuild anycdylibdependencies that thefoocrate depends on. I need thiscdylibdependency to be rebuilt as well so that I can change things in tandem.What's the status on this?
refactor(test)!: deprecate inline pre-test cdylib build
epage commentedon Jul 27, 2026
Looking at the docs: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html
can be the same as
but I think a person would read
"bin"as selecting the one and only bin in the package. I think it should instead be"bins"or"bin:*".I could see us supporting
"bin"for what I think users would read it as. The problem is adding a second bin could be a breaking change. We could (ab)usepackage.default-runto have"bin"resolve to that.refactor(ui): upgrade Leptos to 0.8 and build the dashboard with Carg…