-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Change built-in kernel targets to be os = none throughout #77916
Conversation
r? @lcnr (rust_highfive has picked a reviewer for you, use r? to override) |
compiler/rustc_target/src/spec/x86_64_unknown_none_linuxkernel.rs
Outdated
Show resolved
Hide resolved
0ea520b
to
b93c597
Compare
maybe r? @Mark-Simulacrum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those names sounds much better
b93c597
to
86d860e
Compare
☔ The latest upstream changes (presumably #77943) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
Tentatively r? @joshtriplett |
Per the issue thread (just to make things easier for anyone just reading the PR), While I prefer this to the status quo, my first preference is removing these targets outright. having per-project targets baked into rustc seems like a layer violation and maintenance hazard anyways. |
LGTM. r=me when ready. |
@Ericson2314 I understand what you mean by a "layering violation", but given that we don't have stable support for custom targets, and given that it seems extremely unlikely we'll stabilize that because it's so dependent on specific details of LLVM internals, I think we need to have at least minimal scaffolding for important specialized targets. We also don't have full support for building std/core from source yet, let alone for replacing it with a crate from the ecosystem. Right now, there really isn't any path towards stable support for such targets without at least some infrastructure-level support like this. I'm not suggesting that we should have targets specific to using Rust as a plugin to arbitrary specific pieces of software, but the Linux kernel is a very popular and desirable target to be able to run Rust in, and it provides enough infrastructure that substantial portions of the standard library (including |
@joshtriplett This was the main thing we discussed on the call. It's my understanding that the plan for the How might this work? The tools merely need to authenticate that the crates being built are in fact the officials stdlib crates, and unlock the nightly features only for that code. Then there's no risk of user code using things it shouldn't. It was also discussed that given how the timeline LLVM Linux work as progressed, there ought to be be plenty of runway to be on Nightly until such functionality is worked out if Rust is held to the same standard. |
@Ericson2314 any updates? also you have a few conflicts to resolve |
I don't think users in the freestanding world would mind if the target spec options themselves are documented to not be compatible between Rust releases. Being able to use a stable release of the compiler in such environments is usually way more important. |
OK the merge conflicts are fixed. I would still advocate for these targets to be removed, but I think merging this PR is still a (less controversial) improvement over the status quo, so happy if we start with that and return to the question of removal after. |
compiler/rustc_target/src/spec/x86_64_unknown_none_linuxkernel.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_target/src/spec/x86_64_unknown_none_linuxkernel.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_target/src/spec/x86_64_unknown_none_linuxkernel.rs
Outdated
Show resolved
Hide resolved
feedaa0
to
b71a5a9
Compare
4bab995
to
9d25ccf
Compare
@bors r=joshtriplett |
📌 Commit 9d25ccf has been approved by |
…, r=joshtriplett Change built-in kernel targets to be os = none throughout Whether for Rust's own `target_os`, LLVM's triples, or GNU config's, the OS-related have fields have been for code running *on* that OS, not code hat is *part* of the OS. The difference is huge, as syscall interfaces are nothing like freestanding interfaces. Kernels are (hypervisors and other more exotic situations aside) freestanding programs that use the interfaces provided by the hardware. It's *those* interfaces, the ones external to the program being built and its software dependencies, that are the content of the target. For the Linux Kernel in particular, `target_env: "gnu"` is removed for the same reason: that `-gnu` refers to glibc or GNU/linux, neither of which applies to the kernel itself. Relates to rust-lang#74247
…, r=joshtriplett Change built-in kernel targets to be os = none throughout Whether for Rust's own `target_os`, LLVM's triples, or GNU config's, the OS-related have fields have been for code running *on* that OS, not code hat is *part* of the OS. The difference is huge, as syscall interfaces are nothing like freestanding interfaces. Kernels are (hypervisors and other more exotic situations aside) freestanding programs that use the interfaces provided by the hardware. It's *those* interfaces, the ones external to the program being built and its software dependencies, that are the content of the target. For the Linux Kernel in particular, `target_env: "gnu"` is removed for the same reason: that `-gnu` refers to glibc or GNU/linux, neither of which applies to the kernel itself. Relates to rust-lang#74247
⌛ Testing commit 9d25ccf with merge cc8aa2c31407e3a9c742ab7f865e8820cc104379... |
💥 Test timed out |
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
…, r=joshtriplett Change built-in kernel targets to be os = none throughout Whether for Rust's own `target_os`, LLVM's triples, or GNU config's, the OS-related have fields have been for code running *on* that OS, not code hat is *part* of the OS. The difference is huge, as syscall interfaces are nothing like freestanding interfaces. Kernels are (hypervisors and other more exotic situations aside) freestanding programs that use the interfaces provided by the hardware. It's *those* interfaces, the ones external to the program being built and its software dependencies, that are the content of the target. For the Linux Kernel in particular, `target_env: "gnu"` is removed for the same reason: that `-gnu` refers to glibc or GNU/linux, neither of which applies to the kernel itself. Relates to rust-lang#74247
Rollup of 13 pull requests Successful merges: - rust-lang#77916 (Change built-in kernel targets to be os = none throughout) - rust-lang#82130 (Make some Option, Result methods unstably const) - rust-lang#82292 (Prevent specialized ZipImpl from calling `__iterator_get_unchecked` twice with the same index) - rust-lang#82402 (Remove RefCell around `module_trait_cache`) - rust-lang#82592 (Improve transmute docs with further clarifications) - rust-lang#82651 (Cleanup rustdoc warnings) - rust-lang#82720 (Fix diagnostic suggests adding type `[type error]`) - rust-lang#82751 (improve offset_from docs) - rust-lang#82793 (Move some tests to more suitable subdirs) - rust-lang#82803 (rustdoc: Add an unstable option to print all unversioned files) - rust-lang#82808 (Sync rustc_codegen_cranelift) - rust-lang#82822 (Fix typo) - rust-lang#82837 (tweak MaybeUninit docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Whether for Rust's own
target_os
, LLVM's triples, or GNU config's, theOS-related have fields have been for code running on that OS, not code
hat is part of the OS.
The difference is huge, as syscall interfaces are nothing like
freestanding interfaces. Kernels are (hypervisors and other more exotic
situations aside) freestanding programs that use the interfaces provided
by the hardware. It's those interfaces, the ones external to the
program being built and its software dependencies, that are the content
of the target.
For the Linux Kernel in particular,
target_env: "gnu"
is removed forthe same reason: that
-gnu
refers to glibc or GNU/linux, neither ofwhich applies to the kernel itself.
Relates to #74247