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

Add builtin:$path option to the -L flag #659

Closed
1 of 3 tasks
pietroalbini opened this issue Jul 31, 2023 · 3 comments
Closed
1 of 3 tasks

Add builtin:$path option to the -L flag #659

pietroalbini opened this issue Jul 31, 2023 · 3 comments
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@pietroalbini
Copy link
Member

Proposal

Ferrocene is going to ship some prebuilt libraries as part of its offering, and we need a way to make them available when invoking rustc. For most of those libraries, the easy solution will be to add the .rlib files (compiled as part of ./x) to the sysroot, so that --extern foo or extern crate foo; work as expected.

For some libraries though we need to ship multiple variants of it. The library that is prompting this is fairly hard to build and its source code is not public, but let's take reqwest as an example. You might want to ship reqwest prebuilt both with the native-tls feature and with the rustls-tls feature, so that users of your distribution can choose which prebuilt version to use. You cannot put both of them into the sysroot, as you'd encounter conflicts.

This MCP proposes a new variant for the -L flag: builtin:$path. The flag means $path is located inside of the distribution of rustc you are using. This would allow you to pass -L builtin:reqwest-native-tls or -L builtin:reqwest-rustls, without having to worry where in the distribution files the .rlibs are located.

In practice, builtin:$path will add lib/rustlib/$target/lib/builtin/$path inside of the sysroot to the search path, but this is an internal implementation detail that can change at any time (for example if the sysroot structure changes).

No builtin set of libraries is proposed to be shipped by the Rust project: this flag is meant to standardize how downstream distributions can provide such a feature.

The flag will be compatible with the kind of search path: -L all=builtin:foo or -L crate=builtin:bar will be supported.

Mentors or Reviewers

If you have a reviewer or mentor in mind for this work, mention them
here. You can put your own name here if you are planning to mentor the
work.

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@pietroalbini pietroalbini added T-compiler Add this label so rfcbot knows to poll the compiler team major-change A proposal to make a major change to rustc labels Jul 31, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jul 31, 2023

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/compiler @rust-lang/compiler-contributors

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Jul 31, 2023
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Aug 4, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Aug 28, 2023

@rustbot second

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Aug 28, 2023
@WaffleLapkin
Copy link
Member

Closing as accepted

@WaffleLapkin WaffleLapkin added major-change-accepted A major change proposal that was accepted and removed final-comment-period The FCP has started, most (if not all) team members are in agreement labels Sep 19, 2023
@rustbot rustbot added the to-announce Announce this issue on triage meeting label Sep 19, 2023
@WaffleLapkin WaffleLapkin removed the to-announce Announce this issue on triage meeting label Sep 19, 2023
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Mar 26, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Mar 27, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 27, 2024
Rollup merge of rust-lang#121843 - ferrocene:builtin-path, r=petrochenkov

Implement `-L KIND=@RUSTC_BUILTIN/...`

Implements rust-lang/compiler-team#659
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

5 participants