Skip to content

Turn stdarch into a Josh subtree #141899

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

Draft
wants to merge 2,457 commits into
base: master
Choose a base branch
from
Draft

Turn stdarch into a Josh subtree #141899

wants to merge 2,457 commits into from

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Jun 2, 2025

In a similar vein as #141229, this PR makes the stdarch repository a Josh subtree (it was previously a submodule). The initial commit of stdarch upon this is based is b6e2249e388f520627544812649b77b0944e1a2e, which is the previous commit SHA of the stdarch submodule. The sync was performed according to https://hackmd.io/7pOuxnkdQDaL1Y1FQr65xg.

This was decided in rust-lang/stdarch#1655.

Test pull PR on my fork: Kobzol/stdarch#1
Test push PR on my fork: Kobzol#59

I plan to use the same Rust (miri-inspired) tooling that we use for rustc-dev-guide to enable pulls/pushes on stdarch.

Note that this repository currently doesn't have any stdarch-specific tests, so before that, the subtree should only be modified through this repository only when dealing with changes that contain "cyclical dependencies" between stdarch and rustc. The long term vision is to integrate stdarch into rust-lang/rust completely.

CC @Amanieu

try-job: aarch64-apple
try-job: aarch64-gnu
try-job: x86_64-msvc-*
try-job: x86_64-gnu
try-job: x86_64-gnu-aux

@RalfJung
Copy link
Member

RalfJung commented Jun 3, 2025

Thanks a lot! However, I feel like this should be approved by t-libs... maybe r? @Amanieu ?

Also it my be a good idea to wait for compiler-builtins having their first successful syncs in both directions to ensure there's no hidden pitfalls in the setup.

How hard would it be to add a smoke test that at least checks that the crates build by themselves (i.e., outside of libcore)? That should be feasible wrt CI time and should catch some of the obvious issues -- the lib.rs file is otherwise entirely unused on the rustc side.

@rustbot rustbot assigned Amanieu and unassigned RalfJung Jun 3, 2025
@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 3, 2025

Also it my be a good idea to wait for compiler-builtins having their first successful syncs in both directions to ensure there's no hidden pitfalls in the setup.

Definitely agreed.

How hard would it be to add a smoke test that at least checks that the crates build by themselves (i.e., outside of libcore)? That should be feasible wrt CI time and should catch some of the obvious issues -- the lib.rs file is otherwise entirely unused on the rustc side.

Yeah, I think we should do at least some smoke test. I guess that we could do it in bootstrap, I'll take a look.

@bors
Copy link
Collaborator

bors commented Jun 4, 2025

☔ The latest upstream changes (presumably #141229) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 4, 2025
@Amanieu
Copy link
Member

Amanieu commented Jun 4, 2025

This is going to conflict with #141964 which updates the submodule.

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 9, 2025

How hard would it be to add a smoke test that at least checks that the crates build by themselves (i.e., outside of libcore)? That should be feasible wrt CI time and should catch some of the obvious issues -- the lib.rs file is otherwise entirely unused on the rustc side.

Is it required to build them using the in-tree rustc? Or is it enough to use stage0/beta compiler? Is it enough to just run cargo build in library/stdarch as a smoke test?

@RalfJung
Copy link
Member

RalfJung commented Jun 9, 2025

Well, the goal is to avoid multi-PR transitions for things like renaming an intrinsic that stdarch uses. So ideally the in-tree rustc is the only one that we require to be able to build stdarch.

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 9, 2025

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 9, 2025

⌛ Trying commit b644ddc with merge 171601d

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 9, 2025
Turn `stdarch` into a Josh subtree

In a similar vein as #141229, this PR makes the `stdarch` repository a Josh subtree (it was previously a submodule). The initial commit of `stdarch` upon this is based is `b6e2249e388f520627544812649b77b0944e1a2e`, which is the previous commit SHA of the `stdarch` submodule. The sync was performed according to https://hackmd.io/7pOuxnkdQDaL1Y1FQr65xg.

This was decided in rust-lang/stdarch#1655.

Test pull PR on my fork: Kobzol/stdarch#1
Test push PR on my fork: Kobzol#59

I plan to use the same Rust (miri-inspired) tooling that we use for `rustc-dev-guide` to enable pulls/pushes on stdarch.

Note that this repository currently doesn't have any stdarch-specific tests, so before that, the subtree should only be modified through this repository only when dealing with changes that contain "cyclical dependencies" between stdarch and rustc. The long term vision is to integrate stdarch into rust-lang/rust completely.

CC `@Amanieu`

try-job: aarch64-apple
try-job: aarch64-gnu
try-job: `x86_64-msvc-*`
try-job: x86_64-gnu
try-job: x86_64-gnu-aux
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[TIMING] core::build_steps::test::RustdocJson { compiler: Compiler { stage: 2, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu } -- 0.000
Skipping Set({test::src/tools/rust-installer}) because it is excluded
Testing stdarch stage1 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
    Updating crates.io index
error: the lock file /checkout/library/stdarch/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:51:07
  local time: Mon Jun  9 10:34:03 UTC 2025
  network time: Mon, 09 Jun 2025 10:34:04 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@rust-bors
Copy link

rust-bors bot commented Jun 9, 2025

💔 Test failed

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 9, 2025

error: the lock file /checkout/library/stdarch/Cargo.lock needs to be updated but --locked was passed to prevent this
If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.

Hmm. What to do about stdarchs lockfile? Should we always update it in the rustc repo? I wonder how this works for miri and other tools, it seems like it also has its own lockfile.

@RalfJung
Copy link
Member

RalfJung commented Jun 9, 2025

For Miri, we basically never change the lockfile in the rustc repo. I do manual cargo updates in the Miri repo every now and then.

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 9, 2025

Oh, nevermind, stdarch actually doesn't have a lockfile, that's what was causing the issue. Sorry! The same issue actually happens also for https://github.com/rust-lang/compiler-builtins, as it also misses a lockfile, and it also causes bootstrap problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.