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

Tracking issue for --extern noprelude #98398

Open
1 of 5 tasks
ehuss opened this issue Jun 22, 2022 · 2 comments
Open
1 of 5 tasks

Tracking issue for --extern noprelude #98398

ehuss opened this issue Jun 22, 2022 · 2 comments
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC

Comments

@ehuss
Copy link
Contributor

ehuss commented Jun 22, 2022

This is a tracking issue for the noprelude CLI option for --extern.

Docs: https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/extern-options.html

This option prevents adding the given crate to the extern prelude.

The syntax is [opts ':'] name ['=' path] where opts is a comma separated list of options:

--extern noprelude:core=/path/to/libcore.rlib

This is used by the build-std project to simulate compatibility with sysroot-only crates.

See also #98399 and #98400 which share this syntax extension.

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.

Steps

Unresolved Questions

  • This probably shouldn't be stabilized until build-std is closer to stabilization, or there are other users where this is a clear benefit.

  • The syntax for adding options to --extern flags was added without much bikeshedding or discussion. It may need adjusting to be more flexible for more complex options.

Implementation history

@ehuss ehuss added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Jun 22, 2022
@petrochenkov
Copy link
Contributor

Stabilization blocked on "Tracking Issue --extern crate modifiers".

@jsgf
Copy link
Contributor

jsgf commented Jun 25, 2022

This probably shouldn't be stabilized until build-std is closer to stabilization, or there are other users where this is a clear benefit.

I have a use-case when Rust is built with a non-Cargo build system, where all dependencies - including the prebuilt standard library - must be explicitly specified. This is implemented by invoking rustc with --sysroot /empty/directory --extern std=/path/to/libstd-XXX/rlib. Certain prelude crates (eg alloc) are assumed to be available but are not in the prelude by default, hence requiring --extern noprelude:alloc=/path/to/liballoc-XXX.rlib.

(I describe this in more detail here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC
Projects
None yet
Development

No branches or pull requests

3 participants