-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 thumb-none-cortex-m
to rmake
#128636
Conversation
This PR modifies cc @jieyouxu |
let target_dir = PathBuf::from("target"); | ||
let target = env_var("TARGET"); | ||
|
||
let manifest_path = PathBuf::from("Cargo.toml"); | ||
|
||
let path = env_var("PATH"); | ||
let rustc = env_var("RUSTC"); | ||
let bootstrap_cargo = env_var("BOOTSTRAP_CARGO"); | ||
let mut cmd = cmd(bootstrap_cargo); | ||
cmd.args(&[ | ||
"build", | ||
"--manifest-path", | ||
manifest_path.to_str().unwrap(), | ||
"-Zbuild-std=core", | ||
"--target", | ||
&target, | ||
]) | ||
.env("PATH", path) | ||
.env("RUSTC", rustc) |
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.
should this be extracted into some cargo
helper? it occurs a couple of times and is kind of inscrutable with all the env variables.
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.
I would actually prefer if we keep the current bootstrap cargo incantations because there's another test compiler_builtins
which does something similar but also subtly different. I want to investigate them together in a follow-up PR, so can you please leave me a FIXME pointing to #128734?
// Visual Studio 2022 requires that the LIB env var be set so it can | ||
// find the Windows SDK. | ||
.env("LIB", std::env::var("LIB").unwrap_or_default()); |
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.
is this required for these embedded targets? I guess it was in the makefile for a reason?
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.
We can always try to run try-jobs and see if they pass without this env var. But I don't know if the embedded targets need the LIB
env var.
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.
well the windows SDK just does not seem relevant. let's try removing it.
# HACK(eddyb) sets `RUSTC_BOOTSTRAP=1` so Cargo can accept nightly features. | ||
# These come from the top-level Rust workspace, that this crate is not a | ||
# member of, but Cargo tries to load the workspace `Cargo.toml` anyway. |
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.
is this comment still relevant?
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.
setting that environment variable is not relevant on my system anyway. It's still in the code right now to be a faithful translation, but maybe this can be dropped now?
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.
I believe RUSTC_BOOTSTRAP=1
is not needed if the crate and its transitive dependencies do not depend on nightly features. We can always try removing it and see if it fails.
Oof. Thank you for taking this one on, this is one of the tests I spoke with @Oneirical about being very |
yeah I figured that this one was a bit of an outlier. I and several of my colleagues are quite familiar with this target platform, so we're happy to help out where that expertise is required. |
…<try> migrate `thumb-none-qemu` to rmake tracking issue: rust-lang#121876 I think this one is actually simpler than rust-lang#128636, we invoke `cargo run` with the right target and see if the expected result appears. r? `@jieyouxu` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
Update: let me get back to you after discussing this test ( |
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.
Thank you for tackling this, I have some suggestions, but this LGTM in general.
//! How to run this | ||
//! $ ./x.py clean | ||
//! $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make | ||
//! | ||
//! Supported targets: | ||
//! - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1) | ||
//! - thumbv7em-none-eabi (Bare Cortex-M4, M7) | ||
//! - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat) | ||
//! - thumbv7m-none-eabi (Bare Cortex-M3) |
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.
Question: do we know if these instructions and support targets are up-to-date?
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.
it is correct, but today probably should also include
- thumbv8m.base-none-eabi
- thumbv8m.main-none-eabi
- thumbv8m.main-none-eabihf
I'm not sure whether CI even runs those though?
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.
based on https://hackmd.io/@thejpster/H1iTNJSRT the comment can be extended by
//! - thumbv8m.base-none-eabi (Bare Cortex-M23)
//! - thumbv8m.main-none-eabi (Bare Cortex-M33, M55, M85)
//! - thumbv8m.main-none-eabihf (Bare Cortex-M33, M55, M85, FPU, hardfloat)
this appears to work fine locally, but I think is only useful if CI actually runs these targets
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.
it is correct, but today probably should also include
* thumbv8m.base-none-eabi * thumbv8m.main-none-eabi * thumbv8m.main-none-eabihf
I'm not sure whether CI even runs those though?
cc @rust-lang/infra dear infra people, do we know if any of our CI jobs exercise these targets?
In the meantime, let's see what our CI try jobs say. |
…, r=<try> migrate `thumb-none-cortex-m` to rmake tracking issue: rust-lang#121876 I'll leave some comments/questions inline r? `@jieyouxu` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
☀️ Try build successful - checks-actions |
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.
@rustbot ready
I can squash the commits if that's better, but know that github's interface does not always work well with force pushes.
we might want to try this for a windows host (due to removing the LIB variable)
//! How to run this | ||
//! $ ./x.py clean | ||
//! $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make | ||
//! | ||
//! Supported targets: | ||
//! - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1) | ||
//! - thumbv7em-none-eabi (Bare Cortex-M4, M7) | ||
//! - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat) | ||
//! - thumbv7m-none-eabi (Bare Cortex-M3) |
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.
it is correct, but today probably should also include
- thumbv8m.base-none-eabi
- thumbv8m.main-none-eabi
- thumbv8m.main-none-eabihf
I'm not sure whether CI even runs those though?
// Visual Studio 2022 requires that the LIB env var be set so it can | ||
// find the Windows SDK. | ||
.env("LIB", std::env::var("LIB").unwrap_or_default()); |
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.
well the windows SDK just does not seem relevant. let's try removing it.
//! How to run this | ||
//! $ ./x.py clean | ||
//! $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make | ||
//! | ||
//! Supported targets: | ||
//! - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1) | ||
//! - thumbv7em-none-eabi (Bare Cortex-M4, M7) | ||
//! - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat) | ||
//! - thumbv7m-none-eabi (Bare Cortex-M3) |
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.
based on https://hackmd.io/@thejpster/H1iTNJSRT the comment can be extended by
//! - thumbv8m.base-none-eabi (Bare Cortex-M23)
//! - thumbv8m.main-none-eabi (Bare Cortex-M33, M55, M85)
//! - thumbv8m.main-none-eabihf (Bare Cortex-M33, M55, M85, FPU, hardfloat)
this appears to work fine locally, but I think is only useful if CI actually runs these targets
…<try> migrate `thumb-none-qemu` to rmake tracking issue: rust-lang#121876 I think this one is actually simpler than rust-lang#128636, we invoke `cargo run` with the right target and see if the expected result appears. r? `@jieyouxu` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
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.
Thanks, this looks good to me. I'll run try-jobs to check.
@bors try |
…, r=<try> migrate `thumb-none-cortex-m` to rmake tracking issue: rust-lang#121876 I'll leave some comments/questions inline r? `@jieyouxu` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
☀️ Try build successful - checks-actions |
@bors r+ rollup=iffy (thumb tests) |
…-m, r=jieyouxu migrate `thumb-none-cortex-m` to rmake tracking issue: rust-lang#121876 I'll leave some comments/questions inline r? `@jieyouxu` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
…-m, r=jieyouxu migrate `thumb-none-cortex-m` to rmake tracking issue: rust-lang#121876 I'll leave some comments/questions inline r? ``@jieyouxu`` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#128384 (Add tests to ensure MTE tags are preserved across FFI boundaries) - rust-lang#128407 (Migrate `min-global-align` and `no-alloc-shim` `run-make` tests to rmake) - rust-lang#128584 (Add a set of tests for LLVM 19) - rust-lang#128636 (migrate `thumb-none-cortex-m` to rmake) - rust-lang#128696 (Migrate `staticlib-dylib-linkage` `run-make` test to rmake) Failed merges: - rust-lang#128639 (migrate `thumb-none-qemu` to rmake) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#128363 (Migrate `pdb-buildinfo-cl-cmd` and `pgo-indirect-call-promotion` `run-make` tests to rmake) - rust-lang#128384 (Add tests to ensure MTE tags are preserved across FFI boundaries) - rust-lang#128636 (migrate `thumb-none-cortex-m` to rmake) - rust-lang#128696 (Migrate `staticlib-dylib-linkage` `run-make` test to rmake) Failed merges: - rust-lang#128407 (Migrate `min-global-align` and `no-alloc-shim` `run-make` tests to rmake) - rust-lang#128639 (migrate `thumb-none-qemu` to rmake) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128636 - folkertdev:rmake-thumb-none-cortex-m, r=jieyouxu migrate `thumb-none-cortex-m` to rmake tracking issue: rust-lang#121876 I'll leave some comments/questions inline r? ```@jieyouxu``` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
…jieyouxu migrate `thumb-none-qemu` to rmake tracking issue: rust-lang#121876 I think this one is actually simpler than rust-lang#128636, we invoke `cargo run` with the right target and see if the expected result appears. r? `@jieyouxu` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
…jieyouxu migrate `thumb-none-qemu` to rmake tracking issue: rust-lang#121876 I think this one is actually simpler than rust-lang#128636, we invoke `cargo run` with the right target and see if the expected result appears. r? `@jieyouxu` try-job: armhf-gnu try-job: dist-various-1 try-job: test-various
…-file, r=jieyouxu Remove unused script from run-make tests Its last usage was removed in rust-lang#128636. Tracking issue: rust-lang#121876 r? jieyouxu
…-file, r=jieyouxu Remove unused script from run-make tests Its last usage was removed in rust-lang#128636. Tracking issue: rust-lang#121876 r? jieyouxu
Rollup merge of rust-lang#129013 - Kobzol:remove-unused-git-clone-sha-file, r=jieyouxu Remove unused script from run-make tests Its last usage was removed in rust-lang#128636. Tracking issue: rust-lang#121876 r? jieyouxu
tracking issue: #121876
I'll leave some comments/questions inline
r? @jieyouxu
try-job: armhf-gnu
try-job: dist-various-1
try-job: test-various