Repository navigation
perf(ts): check std once per toolchain as a Nix sysroot #237
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
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
af6792f
chore(quest): claim quest/m2/ts-std-build.md
kixelated 4dcfc63
Merge remote-tracking branch 'origin/main' into quest/m2/ts-std-build
kixelated db398da
chore(quest): plan checking std once per toolchain as a Nix sysroot
kixelated a1ac238
perf(ts): check std once per toolchain as a Nix sysroot
kixelated 4232079
fix(ts): resolve a relative RUST2_TS_SYSROOT before cargo runs the wr…
kixelated d77d383
Merge remote-tracking branch 'origin/main' into HEAD
kixelated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # The profile every crate compiles with, one `--config` per line, which cargo's | ||
| # fingerprint sees, for a crate cached without it to compile again: the package and every | ||
| # crate it depends on translate as one program. flake.nix checks std with it too. | ||
| # | ||
| # Every function's MIR, which a `cargo check` encodes for no dependency's functions | ||
| # otherwise. Without the checks of undefined behavior that debug builds add around raw | ||
| # pointers, such as a box's: JS has no pointers to check. With every call where the source | ||
| # has it, as a release build's inlining would not keep it, since a call is what a binding | ||
| # or a std function's translation stands in for. And with `rust2_ts` set, so a crate can | ||
| # give translation a safe twin of its `unsafe`. | ||
| profile.dev.rustflags = ["-Zalways-encode-mir", "-Zub-checks=no", "-Zinline-mir=no", "--cfg=rust2_ts"] | ||
| # std's own crates, with every function's MIR, so the bodies of std's combinators lower as | ||
| # the crate's do: the target's prebuilt std encodes the MIR of few, optimized. The rest of | ||
| # std's take the flags above to no effect, since none translates. | ||
| profile.dev.package.core.rustflags = ["-Zalways-encode-mir"] | ||
| profile.dev.package.alloc.rustflags = ["-Zalways-encode-mir"] | ||
| profile.dev.package.std.rustflags = ["-Zalways-encode-mir"] |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the sysroot changes without a toolchain or shared-rustflags change, Cargo can reuse dependencies checked against the previous std because this flag is added inside the wrapper, after Cargo computes its fingerprints. For example, changing only
profile.dev.package.core.rustflagsinprofile.tomlrebuilds the Nix sysroot but leaves cached target dependencies intact.Check::runcleans only the configured package, so its subsequent compilation fails with E0460 against those dependencies until the target directory is manually cleaned. Include the resolved sysroot in Cargo-visible fingerprint inputs or isolate target artifacts by sysroot identity so updating the dev shell does not break an existing translation directory.Useful? React with 👍 / 👎.