fix: Cargo.lock generation matches LF/CRLF line endings#13339
Closed
JarlEvanson wants to merge 1 commit intorust-lang:masterfrom
JarlEvanson:issue-#12897
Closed
fix: Cargo.lock generation matches LF/CRLF line endings#13339JarlEvanson wants to merge 1 commit intorust-lang:masterfrom JarlEvanson:issue-#12897
JarlEvanson wants to merge 1 commit intorust-lang:masterfrom
JarlEvanson:issue-#12897
Conversation
Collaborator
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @epage (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
epage
added a commit
to epage/cargo
that referenced
this pull request
Mar 4, 2024
This is preparation for rust-lang#13339 and covers hot spots I found as well as areas currently covered by `profile::start(...)`. This is split out to avoid conflicts while working through the remaining issues for rust-lang#13339. Maybe it will also serve to help debugging...
bors
added a commit
that referenced
this pull request
Mar 4, 2024
fix(cli): Trace core cargo operations ### What does this PR try to resolve? This is preparation for #13339 and covers hot spots I found as well as areas currently covered by `profile::start(...)`. This is split out to avoid conflicts while working through the remaining issues for #13339. Maybe it will also serve to help debugging... ### How should we test and review this PR? ### Additional information ```console $ rg profile::start src/ src/cargo/ops/cargo_compile/mod.rs: let _p = profile::start("compiling"); src/cargo/ops/resolve.rs: let _p = profile::start("resolving with overrides..."); src/cargo/util/rustc.rs: let _p = profile::start("Rustc::new"); src/cargo/core/global_cache_tracker.rs: let _p = crate::util::profile::start("cleaning global cache files"); src/cargo/core/global_cache_tracker.rs: let _p = crate::util::profile::start("global cache db sync"); src/cargo/core/global_cache_tracker.rs: let _p = crate::util::profile::start(format!( src/cargo/core/global_cache_tracker.rs: let _p = crate::util::profile::start(format!("update db for removed {table_name}")); src/cargo/core/global_cache_tracker.rs: let _p = crate::util::profile::start(format!( src/cargo/core/global_cache_tracker.rs: let _p = crate::util::profile::start("populate untracked crate"); src/cargo/core/global_cache_tracker.rs: let _p = crate::util::profile::start(format!("populate untracked {table_name}")); src/cargo/core/global_cache_tracker.rs: let _p = crate::util::profile::start(format!("update NULL sizes {table_name}")); src/cargo/core/global_cache_tracker.rs: let _p = crate::util::profile::start("saving last-use data"); src/cargo/core/resolver/features.rs: let _p = profile::start("resolve features"); src/cargo/core/resolver/mod.rs: let _p = profile::start("resolving"); src/cargo/core/compiler/fingerprint/mod.rs: let _p = profile::start(format!( src/cargo/core/compiler/mod.rs: let p = profile::start(format!("preparing: {}/{}", unit.pkg, unit.target.name())); src/cargo/core/compiler/build_runner/mod.rs: let _p = profile::start("preparing layout"); src/cargo/core/compiler/custom_build.rs: let _p = profile::start(format!( src/cargo/core/compiler/job_queue/mod.rs: let _p = profile::start("executing the job graph"); ```
charmitro
pushed a commit
to charmitro/cargo
that referenced
this pull request
Sep 13, 2024
This is preparation for rust-lang#13339 and covers hot spots I found as well as areas currently covered by `profile::start(...)`. This is split out to avoid conflicts while working through the remaining issues for rust-lang#13339. Maybe it will also serve to help debugging...
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.
What does this PR try to resolve?
This PR attempts to resolve issue #12897. If a Cargo.toml is present, it detects if a CRLF line ending ends the first line, and then outputs the corresponding line ending when generating the lockfile.
How should we test and review this PR?
The additional test should test for the CRLF adherence, just as the
preserve_line_endings_issue_2076test used to do before we started testing for equality based on lines.Additional Notes
If this approach proves successful, the
Emitterstruct could be used to ensure compliance in other auto-generated files that contain line endings that should maintain the previous line ending style, such as thecargo addbug discussed in the issue #12897 thread.