-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Migrate code from cargo-xbuild to -Zbuild-std
#835
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This gives use support for github's scoped annotations when there are errors or warnings.
phil-opp
force-pushed
the
post-02-Zbuild-std
branch
from
July 16, 2020 14:21
9c500f9
to
ffe1b6a
Compare
so that the components are installed for the nightly toolchain.
phil-opp
force-pushed
the
post-02-Zbuild-std
branch
from
July 16, 2020 15:04
e53020c
to
263e852
Compare
phil-opp
added
the
relnotes
"Release notes" – Notable changes that are rendered on the blog.
label
Jul 16, 2020
The additional changes required to the other |
phil-opp
changed the title
Migrate post-02 code from cargo-xbuild to
Migrate code from cargo-xbuild to Jul 17, 2020
-Zbuild-std
-Zbuild-std
I submitted #836 to update the blog posts for these changes. |
This was referenced Jul 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements building using cargo's new
build-std
instead of using thecargo-xbuild
crate.To enable the
build-std
functionality, we set theunstable.build-std
configuration key in the.cargo/config.toml
file. This flag was introduced very recently in rust-lang/cargo#8393, so it only works on the latest nightlies. Unfortunately, rustfmt doesn't build on these nightlies yet, so you have to userustup update nightly --force
to install them (results in skipping the rustfmt component).Functionality-wise, the
build-std
feature behaves almost identical tocargo-xbuild
. The only difference is that it doesn't enable themem
feature of thecompiler_builtins
crate, which defines thememcpy
,memset
, etc operations. This is a known issue, which is hopefully fixed soon. Until then, we can work around it by adding a dependency on therlibc
crate. To ensure that this crate is linked even though it is not directly used, we need to add anextern crate rlibc
statement to ourmain.rs
.After these changes, our kernel is buildable through a normal
cargo build
. Thecargo run
andcargo test
commands will also work as expected, provided the latest bootimage version is used.This PR additionally rewrites our CI script based on the GitHub Actions provided by the
actions-rs
organization. This makes Rust's error messages compatible with GitHubs annotations, so that any build errors and warnings are shown inline at the correct line.The required changes to the blog post will be done in a separate follow-up PR.