Make PEP 517 profile tests more resilient to cargo profiles#2902
Merged
Make PEP 517 profile tests more resilient to cargo profiles#2902
Conversation
A trick for faster rust compilation from the official book is to avoid generating debug information by default (https://doc.rust-lang.org/cargo/guide/build-performance.html#reduce-amount-of-generated-debug-information). To apply this for globally, or to use this for projects that already have a `.cargo/config.toml`, we can add the following to `~/.cargo/config.toml`: ```toml [profile.dev] debug = "line-tables-only" [profile.dev.package."*"] debug = false [profile.debugging] inherits = "dev" debug = true ``` or simply: ```toml [profile.dev] debug = false ``` This effect is larger for more complex projects with more dependencies, but also noticeable for maturin. On my machine, a fresh debug build goes from 14.6s to 9s, `hyperfine --prepare "touch src/archive_source.rs" "cargo build"` goes from 960ms to 870ms. This breaks the PEP 517 profile test because the log message looks different: ``` Finished `dev` profile [unoptimized] target(s) in 8.84s ``` To make the test more resilient to all sorts of global profile changes, we instead check in the target directory which profiles were built.
ee4fed4 to
ea0677d
Compare
Member
Author
|
The emscripten failure is unrelated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A trick for faster rust compilation from the official book is to avoid generating debug information by default (https://doc.rust-lang.org/cargo/guide/build-performance.html#reduce-amount-of-generated-debug-information).
To apply this for globally, or to use this for projects that already have a
.cargo/config.toml, we can add the following to~/.cargo/config.toml:or simply:
This effect is larger for more complex projects with more dependencies, but also noticeable for maturin. On my machine, a fresh debug build goes from 14.6s to 9s,
hyperfine --prepare "touch src/archive_source.rs" "cargo build"goes from 960ms to 870ms.This breaks the PEP 517 profile test because the log message looks different:
To make the test more resilient to all sorts of global profile changes, we instead check in the target directory which profiles were built.