Skip to content

Add support for cargo-args=["-Zbuild-std"] #2107

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

Merged
merged 1 commit into from
May 31, 2023
Merged

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Apr 15, 2023

  • Update to a version of rustwide that supports fetch_build_std_targets

  • Don't try to download rust-std for tier 3 targets

  • Add a local test

  • Don't try to make API calls to crates.io for local crates

    This shaves 16 seconds off the build, and also avoids some unnecessary network calls.

Note that this calls cargo fetch -Zbuild-std unconditionally just because it was easier; I doubt it'll cause any trouble but I can change it if you like.

Fixes #1561. Blocked on rust-lang/rustwide#66.

@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Apr 15, 2023
@jyn514 jyn514 changed the title Add support for -Zbuild-std Add support for cargo-args=["-Zbuild-std"] Apr 15, 2023
Copy link
Member

@syphar syphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know enough about the build-process itself to do a proper review, perhaps @Nemo157 can help here?

From the code, I only had two small comments.

@jyn514
Copy link
Member Author

jyn514 commented May 3, 2023

@syphar syphar added the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. label May 3, 2023
- Update to a version of rustwide that supports `fetch_build_std_targets`
- Don't try to download rust-std for tier 3 targets
- Add a local test
- Don't try to make API calls to crates.io for local crates

  This shaves 16 seconds off the build, and also avoids some unnecessary
  network calls.

Note that this calls `cargo fetch -Zbuild-std` unconditionally just
because it was easier; I doubt it'll cause any trouble but I can change
it if you like.
@jyn514 jyn514 removed the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. label May 24, 2023
@jyn514
Copy link
Member Author

jyn514 commented May 24, 2023

This is unblocked now :)

Copy link
Member

@syphar syphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve, the change makes sense to me looking at the code.

I have two caveats:

  • is there a build speed impact? ( see comment )
  • I don't know much about the build specifics and can't know possible side-effects, perhaps @Nemo157 knows more?

@Nemo157
Copy link
Member

Nemo157 commented May 30, 2023

I don't think there should be any bad side effects from this, we don't change the build step at all it's up to the user to pass -Zbuild-std still, we just install an extra rustup component and fetch some extra crates (I'm surprised these aren't part of rust-src actually, but if that's how it's designed now I guess we gotta work with it 🤷).

@jyn514
Copy link
Member Author

jyn514 commented May 30, 2023

I don't think there should be any bad side effects from this, we don't change the build step at all it's up to the user to pass -Zbuild-std still

ah hmm, I guess an alternative approach would be to pass -Zbuild-std automatically if rustup target add fails. That seems a little too magic, though, I think especially since build-std is still unstable it makes sense to have people opt-in explicitly.

I'm surprised these aren't part of rust-src actually, but if that's how it's designed now I guess we gotta work with it 🤷

these are dependencies of the standard library - although I suppose infra could vendor them in the rust-src tarball 🤔
anyway, not something we need to fix here.

@jyn514 jyn514 merged commit f2aad30 into rust-lang:master May 31, 2023
@jyn514 jyn514 deleted the build-std branch May 31, 2023 03:43
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels May 31, 2023
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build-std not properly supported
3 participants