Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo: providing artifacts (for artifact dependencies) via build.rs #3035

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joshtriplett
Copy link
Member

@joshtriplett joshtriplett commented Dec 14, 2020

This RFC grew out of a discussion on the artifact dependencies
RFC
. As an extension of
that RFC, some crates will want to supply artifacts via build.rs, such
as by building them from sources or passing through an artifact
dependency from a different crate. Some crates may also want to make
decisions about how to supply a binary based on feature flags or
detection.

This RFC introduces a mechanism to do so, via targets with
manual = true. For such targets, Cargo expects build.rs to supply
the target, by placing it in a directory specified by Cargo.

cc @jyn514 @alexcrichton

Rendered

@joshtriplett joshtriplett added the T-cargo Relevant to the Cargo team, which will review and decide on the RFC. label Dec 14, 2020
@joshtriplett joshtriplett changed the title Cargo manual targets Cargo: providing artifacts (for artifact dependencies) via build.rs Dec 14, 2020
@jyn514 jyn514 added the A-build-scripts Proposals relating to build.rs scripts. label Dec 14, 2020
@kornelski
Copy link
Contributor

CARGO_ARTIFACT_DIR would be very useful for more things than just binaries (I've asked for it in rust-lang/cargo#5457). Crates currently can't build things like man pages or resource files to be bundled later. Having a known location for all build products would be great.

@kornelski
Copy link
Contributor

kornelski commented Dec 20, 2020

If a script is building dynamic library, what should it set as the rpath for the library? Can Cargo help with this?

Currently this is undefined/ignored in Cargo and makes dylibs painful to use when dylibs use a relative rpath, because Cargo isn't aware of it, so things like test/bench executables that are in a different directory than build products look for dylibs in a wrong place.

@joshtriplett
Copy link
Member Author

@kornelski I would love to have a mechanism like this for other kinds of artifacts, including manpages or completions. However, I'd prefer to keep that separate from this RFC. After this RFC goes through, I'd be happy to collaborate on an extension to other kinds of artifacts.

I also think it might make sense for Cargo to export information about other profile options. That seems like it'd be a good item for an RFC as well.

@joshtriplett
Copy link
Member Author

(Current status of this: waiting for a completed implementation of baseline artifact dependencies before moving forwards.)

@epage
Copy link
Contributor

epage commented May 21, 2024

@rfcbot postpone

I propose we postpone this until we have rust-lang/cargo#9096 stabilized so we have a better view of where things are at.

@rfcbot
Copy link
Collaborator

rfcbot commented May 21, 2024

Team member @epage has proposed to postpone this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. disposition-postpone This RFC is in PFCP or FCP with a disposition to postpone it. labels May 21, 2024
@joshtriplett

This comment was marked as resolved.

@rfcbot rfcbot added final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. and removed proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. labels Oct 1, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Oct 1, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-scripts Proposals relating to build.rs scripts. disposition-postpone This RFC is in PFCP or FCP with a disposition to postpone it. final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. T-cargo Relevant to the Cargo team, which will review and decide on the RFC.
Projects
Status: FCP postpone
Status: Unreviewed
Development

Successfully merging this pull request may close these issues.

5 participants