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

migrate thumb-none-cortex-m to rmake #128636

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

folkertdev
Copy link
Contributor

@folkertdev folkertdev commented Aug 4, 2024

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

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 4, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2024

This PR modifies tests/run-make/. If this PR is trying to port a Makefile
run-make test to use rmake.rs, please update the
run-make port tracking issue
so we can track our progress. You can either modify the tracking issue
directly, or you can comment on the tracking issue and link this PR.

cc @jieyouxu

tests/run-make/thumb-none-cortex-m/rmake.rs Show resolved Hide resolved
tests/run-make/thumb-none-cortex-m/rmake.rs Show resolved Hide resolved
Comment on lines 29 to 47
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)
Copy link
Contributor Author

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.

Copy link
Member

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?

Comment on lines 53 to 55
// 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());
Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

Comment on lines -35 to -37
# 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.
Copy link
Contributor Author

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?

Copy link
Contributor Author

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?

Copy link
Member

@jieyouxu jieyouxu Aug 6, 2024

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.

@jieyouxu
Copy link
Member

jieyouxu commented Aug 4, 2024

Oof. Thank you for taking this one on, this is one of the tests I spoke with @Oneirical about being very cursed interesting. Expect some delay from me, because I probably will also be asking around for help about what this is trying to test and in particular how it achieves that 😅

@folkertdev
Copy link
Contributor Author

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.

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 6, 2024
…<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
@jieyouxu
Copy link
Member

jieyouxu commented Aug 6, 2024

Update: let me get back to you after discussing this test (thumb-none-cortex-m) and thumb-none-qemu with the compiler people regarding needing internet connection (due to cargo external deps) in order to run the test...
@rustbot blocked (pending T-compiler discussion)

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 6, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Aug 6, 2024

I don't want to block this PR on the external dep challenges, they can be done separately (cc #128733).
@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Aug 6, 2024
Copy link
Member

@jieyouxu jieyouxu left a 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.

tests/run-make/thumb-none-cortex-m/rmake.rs Show resolved Hide resolved
Comment on lines +1 to +9
//! 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)
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

@folkertdev folkertdev Aug 6, 2024

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

Copy link
Member

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?

tests/run-make/thumb-none-cortex-m/rmake.rs Outdated Show resolved Hide resolved
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 6, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Aug 6, 2024

In the meantime, let's see what our CI try jobs say.
@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 6, 2024
…, 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
@bors
Copy link
Contributor

bors commented Aug 6, 2024

⌛ Trying commit f71a627 with merge e493763...

@bors
Copy link
Contributor

bors commented Aug 6, 2024

☀️ Try build successful - checks-actions
Build commit: e493763 (e49376372b0e6d6c3b34a248d3049fd33027dae9)

Copy link
Contributor Author

@folkertdev folkertdev left a 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)

Comment on lines +1 to +9
//! 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)
Copy link
Contributor Author

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?

tests/run-make/thumb-none-cortex-m/rmake.rs Show resolved Hide resolved
Comment on lines 53 to 55
// 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());
Copy link
Contributor Author

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.

Comment on lines +1 to +9
//! 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)
Copy link
Contributor Author

@folkertdev folkertdev Aug 6, 2024

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 7, 2024
…<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
Copy link
Member

@jieyouxu jieyouxu left a 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.

@jieyouxu
Copy link
Member

jieyouxu commented Aug 7, 2024

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 7, 2024
…, 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
@bors
Copy link
Contributor

bors commented Aug 7, 2024

⌛ Trying commit 201ca3f with merge 5f8274c...

@bors
Copy link
Contributor

bors commented Aug 7, 2024

☀️ Try build successful - checks-actions
Build commit: 5f8274c (5f8274c1a3b38f75938f5069ff39e543b83acfe8)

@jieyouxu
Copy link
Member

jieyouxu commented Aug 7, 2024

@bors r+ rollup=iffy (thumb tests)

@bors
Copy link
Contributor

bors commented Aug 7, 2024

📌 Commit 201ca3f has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2024
tgross35 added a commit to tgross35/rust that referenced this pull request Aug 7, 2024
…-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
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 7, 2024
…-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
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 7, 2024
…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
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 7, 2024
…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
@bors bors merged commit 38dc3b2 into rust-lang:master Aug 8, 2024
7 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 8, 2024
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
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 8, 2024
…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
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 8, 2024
…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
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 12, 2024
…-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
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 12, 2024
…-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
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 13, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants