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

Disable incremental for std crates #44

Closed
ehuss opened this issue Sep 11, 2019 · 3 comments · Fixed by rust-lang/cargo#8177
Closed

Disable incremental for std crates #44

ehuss opened this issue Sep 11, 2019 · 3 comments · Fixed by rust-lang/cargo#8177
Labels
implementation Implementation exploration and tracking issues

Comments

@ehuss
Copy link
Contributor

ehuss commented Sep 11, 2019

Incremental is not needed for std crates, so it should probably not be used.

I'm torn on exactly how to implement. Some options:

  • Pass a flag to Profiles::get_profile
  • Add an is_std flag to Unit, and check that when generating flags. This flag may be needed for other reasons, and would end up being the simplest change, but a bit of a hack.
  • Mutate the std unit profiles after they have all been created (very hacky).
@ehuss ehuss added the implementation Implementation exploration and tracking issues label Sep 11, 2019
@alexcrichton
Copy link
Member

Heh an excellent point! I think you're referring to this block, right? I think that this sort of logic (is_path()) is taken into account in at least one other place (passing --cap-lints allow vs not), but that may be the only other place that it's passed.

I wonder if the Package could be updated here? Perhaps something like a "can this package be edited" property which enables/disables incremental/warnings and is default to true for is_path, but for libstd deps we can go through and rewrite these fields to "no, you can't edit this"

@ehuss
Copy link
Contributor Author

ehuss commented Sep 12, 2019

Sounds like a good idea to me.

bors added a commit to rust-lang/cargo that referenced this issue Apr 28, 2020
build-std: Don't treat std like a "local" package.

This changes it so that build-std will not treat the std crates like a "local" package. This has the following changes:

- std does not build with incremental. This generally shouldn't be needed, and incremental has various bugs with std crates.
- Cargo's dep-info fingerprint tracking will not track the std crate sources, these are tracked via other means.
- Cargo's `.d` dep-info file does not include std crate sources.
- Lints are capped to "allow" for std crates, and warnings are not shown by default.

Closes rust-lang/wg-cargo-std-aware#44
Closes rust-lang/wg-cargo-std-aware#55
@ehuss
Copy link
Contributor Author

ehuss commented Apr 28, 2020

Closed by rust-lang/cargo#8177.

@ehuss ehuss closed this as completed Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implementation Implementation exploration and tracking issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants