instance_id stringlengths 10 65 | repo stringlengths 5 59 | pr_number int64 1 313k | task_type stringclasses 1
value | base_commit stringlengths 40 40 | review_commit stringlengths 40 40 | title stringlengths 2 282 | body stringlengths 7 3k | patch stringlengths 202 204k | n_defects int64 1 72 | n_supported int64 1 65 | n_major int64 0 32 | defects stringlengths 140 18.8k | certifier_count int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rust-lang__annotate-snippets-rs__235 | rust-lang/annotate-snippets-rs | 235 | defect | c195b836696312ee80880c1fe4edf6003222aade | be29d33d44cd102250ce682a514226b830fb4efb | feat: Allow setting the primary level for a group | This should allow users to create a `Group` without a `Title` and control the primary `Level` for that `Group`. | diff --git a/examples/elide_header.rs b/examples/elide_header.rs
new file mode 100644
index 00000000..716f8e56
--- /dev/null
+++ b/examples/elide_header.rs
@@ -0,0 +1,21 @@
+use annotate_snippets::{AnnotationKind, Group, Level, Renderer, Snippet};
+
+fn main() {
+ let source = r#"# Docstring followed by a newline
+
... | 1 | 1 | 1 | [{"id": "G0", "claim": "The docs say the primary level falls back to \"error\", but cyan (the fallback level shown in the example) is not an error, so the fallback documentation and behaviour should be corrected.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
rust-lang__annotate-snippets-rs__251 | rust-lang/annotate-snippets-rs | 251 | defect | ca9f5e5ac7dc758cfa0acdf127e48f7ff2695d1d | 1e326f95cf3885a35472a3ed4f32317f0e40466e | fix: Show Group/File start for Snippets without a path | fixes #244 | diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs
index 31712339..80a88110 100644
--- a/src/renderer/mod.rs
+++ b/src/renderer/mod.rs
@@ -288,10 +288,14 @@ impl Renderer {
}
let mut message_iter = group.elements.iter().enumerate().peekable();
let mut last_was_sugg... | 3 | 1 | 0 | [{"id": "G0", "claim": "The issue_9 example output looks like multiple snippets for the same file trying to pretend to be the same thing, and its manual folding seems unrelated to issue #9, so the example may want updating to stop manual folding.", "category": "testing", "verdict": "uncertain", "priority": "P2", "scope... | null |
rust-lang__annotate-snippets-rs__254 | rust-lang/annotate-snippets-rs | 254 | defect | 475dca6c838ba25599e6b0f8f97ec1684ac6b03c | a6be8a31401387dcc468a8b545bfc5eb2112fdea | fix: Match rustc's annotation overlap | While working on `rustc`, I saw that `annotate-snippets` and `rustc` had different outputs for [`unsafe_extern_suggestion`](https://github.com/rust-lang/rust/blob/f838cbc06de60819faff3413f374706b74824ca2/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs). I spent some time digging into this, and it tu... | diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs
index 5754dc7c..70b252c4 100644
--- a/src/renderer/mod.rs
+++ b/src/renderer/mod.rs
@@ -1167,7 +1167,7 @@ impl Renderer {
// otherwise the lines would end up needing to go over a message.
let mut annotations = line_info.annotations.clone();
- ... | 2 | 2 | 0 | [{"id": "G0", "claim": "The hand-written PartialEq/Ord/PartialOrd impls for Loc need a call out with an explanation.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The trait impls would be easier to maintain if they were implemented via a Loc::key... | null |
rust-lang__annotate-snippets-rs__3 | rust-lang/annotate-snippets-rs | 3 | defect | 61a75cad5667c8da0146f95abbd05902c39a831a | e898d57dd0abdbc9f47750642f2fd451db8da1b8 | Add option to anonymize line numbers | With the current diagnostics emitter of Rust, the `-Z ui-testing` flag
allows to 'anonymize' line numbers in the UI test output.
This means that a line such as:
2 | concat!(b'f');
is turned into:
LL | concat!(b'f');
This is done because it makes the diff of UI test output changes much
... | diff --git a/examples/expected_type.rs b/examples/expected_type.rs
index 6c6ed012..6ad3c365 100644
--- a/examples/expected_type.rs
+++ b/examples/expected_type.rs
@@ -37,6 +37,6 @@ fn main() {
};
let dl = DisplayList::from(snippet);
- let dlf = DisplayListFormatter::new(true);
+ let dlf = DisplayListF... | 2 | 2 | 1 | [{"id": "G0", "claim": "In `line_max` the hardcoded width `2` should be replaced by the length of `ANONYMIZED_LINE_NUM` so it stays in sync with the constant it duplicates.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "With `anonymized_line_num... | null |
rust-lang__annotate-snippets-rs__32 | rust-lang/annotate-snippets-rs | 32 | defect | 40cec7a334c76ca5e6c328cbf5d97631cc15ad37 | 80e4c4095a7560dadb9340e251d352cd3a4e95d4 | Fix no copy when cast `Snippet` to `DisplayList` and #29 | With this pull request the "no copy" process is completed. All the crate is free copy :smile:
I have changed from `yaml` to `toml` because `yaml` does not implement `serde::Deserialize`
| diff --git a/Cargo.toml b/Cargo.toml
index 086db9dd..d205c635 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,7 @@ yansi-term = { version = "0.1", optional = true }
[dev-dependencies]
glob = "0.3"
-serde_yaml = "0.8"
+toml = "0.5"
serde = { version = "1.0", features = ["derive"] }
difference = "2.0"
yansi-... | 1 | 1 | 0 | [{"id": "G0", "claim": "Remove the unexplained `#[repr(u8)]` on `EndLine` and rename its variants to CRLF, LF and EOF (all capitals) instead of One, Two and EoF.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__annotate-snippets-rs__357 | rust-lang/annotate-snippets-rs | 357 | defect | d225a68fdc74341b2d4db90f0bc292feb044385e | 1578f540c3502a93b7deab69ed9c8d6b1144ad6a | fix: Fix Unicode highlight alignment in patches | ### Summary of Changes
This PR fixes a defect in the `annotate-snippets` library where patch highlighting becomes misaligned when handling Unicode characters. Currently, when a source line contains Unicode characters (either before the patch location or within the patch content itself), the color highlighting (e.g.,... | diff --git a/src/renderer/render.rs b/src/renderer/render.rs
index 283fe770..56c67e1d 100644
--- a/src/renderer/render.rs
+++ b/src/renderer/render.rs
@@ -1622,6 +1622,8 @@ fn emit_suggestion_default(
let (span_start, span_end) = sm.span_to_locations(part.span.clone());
let span_start_pos = sp... | 2 | 2 | 2 | [{"id": "G0", "claim": "Using char spans for removal highlight ranges will misalign when the source contains tab characters, since normalize_whitespace expands '\\t' to four spaces; the reviewer asks that the addition-line tab handling be taken into account here too.", "category": "correctness", "verdict": "supported",... | null |
rust-lang__annotate-snippets-rs__90 | rust-lang/annotate-snippets-rs | 90 | defect | 027c95b74cb74c1c5880a7d316abcbd743190260 | d858aa9ea3434b23227e4d58706c4ce39cb1c499 | fix!: Take in byte spans | BREAKING CHANGE: This switches from char spans to byte spans
This PR is a draft implementation to address #77. While I think I fixed every issue in moving from char spans to byte spans, I am not entirely certain. I may look into adding more tests to ensure we are doing the write thing. This also doesn't address the ... | diff --git a/Cargo.lock b/Cargo.lock
index 034e18cd..e507736f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -25,6 +25,7 @@ dependencies = [
"criterion",
"difference",
"glob",
+ "itertools 0.12.1",
"serde",
"snapbox",
"toml",
@@ -241,7 +242,7 @@ dependencies = [
"clap",
"criterion-plot",
"is-terminal",
-... | 1 | 1 | 0 | [{"id": "G0", "claim": "The added expression `slice.source.as_bytes().iter().count()` should simply be `slice.source.len()`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__annotate-snippets-rs__94 | rust-lang/annotate-snippets-rs | 94 | defect | 666b2b9ac7f43f79167de3d3579163cf06c752fa | d9212de5a219cb99aebeabaf036c381c3d5b3402 | fix!: Clarify Snippet API | This is a batch API change from talking to @Muscraft about what would make the clearer, what will make it more easily adapt to rustc, and what will make it better encoded the design in the type system.
Renames:
- `Snippet` -> `Message`
- `Slice` -> `Snippet`
- `Slice::new` to `Snippet::source`
- `SourceAnnotat... | diff --git a/examples/expected_type.rs b/examples/expected_type.rs
index adcbeff1..df20e3ec 100644
--- a/examples/expected_type.rs
+++ b/examples/expected_type.rs
@@ -1,22 +1,21 @@
-use annotate_snippets::{Label, Renderer, Slice, Snippet};
+use annotate_snippets::{Level, Renderer, Snippet};
fn main() {
let sour... | 6 | 5 | 0 | [{"id": "G0", "claim": "The struct initialization in Level::title uses redundant field names (title: title) and should use field shorthand instead.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "With the rename applied to the fixture's embedded ... | null |
rust-lang__backtrace-rs__126 | rust-lang/backtrace-rs | 126 | defect | a73a6232d3fe519296b3c490d8f1a70ff9b30112 | 5a4f807f4b84a71c9a447831a9602f3988b33a35 | Add no_std support | This is a renewed version of #50 for [rust-lang/#39503](https://github.com/rust-lang/rust/issues/39503).
cc @Mark-Simulacrum | diff --git a/Cargo.toml b/Cargo.toml
index 45c737f62..351edeea9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,6 +11,9 @@ documentation = "https://docs.rs/backtrace"
description = """
A library to acquire a stack trace (backtrace) at runtime in a Rust program.
"""
+autoexamples = true
+autotests = true
+
[dependen... | 16 | 16 | 11 | [{"id": "G0", "claim": "The entire capture module should be removed in no_std mode, with only the bare-bones stack-based API provided.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "unclear"}, {"id": "G1", "claim": "resolve and trace should not switch signatures based on features; instead u... | null |
rust-lang__backtrace-rs__31 | rust-lang/backtrace-rs | 31 | defect | 42190274bfb2d6b5a1d05535b319a8c659c00158 | 9aea35710b64f3a68ae255d2616d0ea078516698 | Add support for demangling C++ frames' symbols | This adds a new optional (but on-by-default) dependency on the `cpp_demangle` crate. When this feature is enabled, if demangling a frame's symbol as a Rust symbol fails, then we attempt to demangle it as a C++ symbol.
r? @alexcrichton
I didn't add any tests because I am lazy. Don't hesitate to push back on this ... | diff --git a/Cargo.toml b/Cargo.toml
index 89b3e3c52..9bbe769dc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,6 +22,9 @@ rustc-demangle = "0.1"
serde = { version = "0.8", optional = true }
rustc-serialize = { version = "0.3", optional = true }
+# Optionally demangle C++ frames' symbols in backtraces.
+cpp_demangl... | 5 | 3 | 3 | [{"id": "G0", "claim": "SymbolName::as_str should keep its existing Option<&'a str> return type instead of the breaking Option<Cow<'a, str>> change, leaving a TODO to make the change at the next major version.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim"... | null |
rust-lang__backtrace-rs__317 | rust-lang/backtrace-rs | 317 | defect | df444be1b325a30b4e0a1d033d500248edaf29cb | a425c10cba5b37a42b718a5f1c8448c34c52148e | Remove dladdr fallback and implementation | This has been present for a very long time but I believe this has never
actually been that necessary. Non-MSVC platforms all use libbacktrace by
default, and libbacktrace will consult symbol tables of object files to
do what `dladdr` does, just inside of libbacktrace. Additionally gimli
implements the same logic. I... | diff --git a/Cargo.toml b/Cargo.toml
index 9b07523a2..ddcf5fcd3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,12 @@ cpp_demangle = { default-features = false, version = "0.2.3", optional = true }
# Optional dependencies enabled through the `gimli-symbolize` feature
addr2line = { version = "0.11.0", optional... | 1 | 1 | 0 | [{"id": "G0", "claim": "In the new macOS bias comment on src/symbolize/gimli.rs, one of the two occurrences of 'correct' should be 'incorrect' - the text as written says the calculations are correct for both cases.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__backtrace-rs__486 | rust-lang/backtrace-rs | 486 | defect | 8b83ba10fc8ccfc12ff75fcc3277286c0b9fad62 | a86313cd548c7fd46efa37a9339d1fecda2cadfe | Apply clippy::uninlined_format_args fixes | This is the result of running `clippy::uninlined_format_args` lint. Currently the lint is in `pedantic`, but there are plans/hopes to move it to `style`.
How can I add this specific lint to the current build/CI tools, or is this not possible? It would be ideal not to make the lint as the default style and then end ... | diff --git a/build.rs b/build.rs
index 812fbb1fe..dcb22d9b2 100644
--- a/build.rs
+++ b/build.rs
@@ -13,7 +13,7 @@ fn build_android() {
let expansion = match cc::Build::new().file("src/android-api.c").try_expand() {
Ok(result) => result,
Err(e) => {
- println!("failed to run C compiler... | 4 | 4 | 0 | [{"id": "G0", "claim": "In examples/raw.rs the inlined print! format string 'frame #{cnt:<2} - {:#0HEX_WIDTH$x}' makes the arguments read out of order (no longer strictly left to right), introducing active confusion into the print statement.", "category": "maintainability", "verdict": "supported", "priority": "P2", "sc... | null |
rust-lang__backtrace-rs__488 | rust-lang/backtrace-rs | 488 | defect | 8b83ba10fc8ccfc12ff75fcc3277286c0b9fad62 | 79f81874192a47caee147279f87c29888cee5379 | Use /proc/self/maps when available instead of std::env::current_exe | rust-lang/rust#101913 illustrates a scenario on Linux where backtraces fail because of their reliance on `std::env::current_exe()` always yielding the path to the *Rust* binary that is driving execution.
This PR changes that strategy, by first trying to parse `/proc/self/maps` and extract from it the path to the Rus... | diff --git a/Cargo.toml b/Cargo.toml
index f5d6119c1..1bbfe3e11 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -130,3 +130,8 @@ edition = '2018'
name = "concurrent-panics"
required-features = ["std"]
harness = false
+
+[[test]]
+name = "current-exe-mismatch"
+required-features = ["std"]
+harness = false
diff --git a/sr... | 5 | 5 | 4 | [{"id": "G0", "claim": "The new /proc/self/maps parsing logic only applies to linux and is compiled in for unix targets where it does not apply (NetBSD has /proc/curproc/ and macOS has no /proc at all), so it should be limited to the targets that actually have /proc/self/maps.", "category": "correctness", "verdict": "s... | null |
rust-lang__backtrace-rs__538 | rust-lang/backtrace-rs | 538 | defect | e1c49fbd6124a1b626cdf19871aff68c362bdf07 | ead14a885b1813a5d78473b0bb2967578c70aa26 | Upgrade to 2021 ed and inline panics | Panics and asserts do not work the same way with inlined format args, so this updates all crates to 2021 edition.
This PR complements #486, but is independent of it
Note that just like #486, the MSRV must be at least 1.58 (which introduced inline format args) | diff --git a/Cargo.toml b/Cargo.toml
index cff2c9e66..52abdc5bb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ A library to acquire a stack trace (backtrace) at runtime in a Rust program.
"""
autoexamples = true
autotests = true
-edition = "2018"
+edition = "2021"
[workspace]
members = ['crates/cpp_s... | 1 | 1 | 1 | [{"id": "G0", "claim": "The fallback panic added in tests/accuracy/main.rs passes the message as a literal argument, so it prints the un-substituted text 'failed to find {file}:{line}' instead of the actual file and line.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
rust-lang__backtrace-rs__641 | rust-lang/backtrace-rs | 641 | defect | bdf8bba8b64d6fb1f452037d76e4b93a0e274085 | dfa7d9b3617565cda8b733f1dd69bde9cd676b95 | test cleanup for nightly | A collage of random bugfixes.
- `format!` now has `#[must_use]`: https://github.com/rust-lang/rust/pull/127355
- miri randomizes inlineable fn addrs: https://github.com/rust-lang/rust/pull/123781
- my own petard: https://github.com/rust-lang/rust/pull/125834
- some permissive provenance warnings became louder and... | diff --git a/src/capture.rs b/src/capture.rs
index f7d4b4fe..f2154995 100644
--- a/src/capture.rs
+++ b/src/capture.rs
@@ -2,7 +2,7 @@
use crate::resolve;
use crate::PrintFmt;
use crate::{resolve_frame, trace, BacktraceFmt, Symbol, SymbolName};
-use std::ffi::c_void;
+use core::ffi::c_void;
use std::fmt;
use std::... | 3 | 2 | 0 | [{"id": "G0", "claim": "The test backtrace_new_should_start_with_call_site_trace fails on CI, and its failure output is indistinguishable from the other output, so the test gives no signal about what went wrong.", "category": "testing", "verdict": "supported", "priority": "P0", "scope": "pre_existing"}, {"id": "G1", "c... | null |
rust-lang__book__3284 | rust-lang/book | 3,284 | defect | 36383b4da21dbd0a0781473bc8ad7ef0ed1b6751 | 0e9980e4295df3462b26f8c42547d6cb906c86ab | ch11-03: Unnecessary import removal | Qualified call to `add_two` is sufficient. There is no need to import `adder` with `use adder;`. | diff --git a/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs b/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs
index e26fa71096..336c5ec54b 100644
--- a/listings/ch11-writing-automated-tests/listing-11-13/tests/integration_test.rs
+++ b/listings/ch11-writing-a... | 1 | 1 | 0 | [{"id": "G0", "claim": "Listing 11-13 could instead be changed to `use adder::add_two;` and call `add_two(2)` directly, which would demonstrate scoping, since the purpose of the removed article text is unclear to the author.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}... | null |
rust-lang__book__3533 | rust-lang/book | 3,533 | defect | f2a78f64b668f63f581203c6bac509903f7c00ee | bb7aa19d9dc6fd9c9a2128e9526ae861602651d9 | Update listings in ch 11-01 to reflect current output from cargo new | Ref this PR in cargo: https://github.com/rust-lang/cargo/pull/10706 | diff --git a/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs b/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs
index 1b4a90c938..7d12d9af81 100644
--- a/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs
+++ b/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs
@@ -1... | 1 | 1 | 0 | [{"id": "G0", "claim": "The sentence this pull request adds to ch11-01 should keep the typographic (curly) apostrophe in \"let's\" instead of the straight apostrophe, matching the style used elsewhere in the book.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
rust-lang__bors__203 | rust-lang/bors | 203 | defect | 417c8e7e3b0f9a2d6cc98b99d9bbb4ba9789ee7c | bedaab52180bd6a6f94d9ec688471199b8294038 | fix: ignore unrelated comments | Fixes #124 | diff --git a/src/bors/handlers/mod.rs b/src/bors/handlers/mod.rs
index 7b76da532..82aa88fcb 100644
--- a/src/bors/handlers/mod.rs
+++ b/src/bors/handlers/mod.rs
@@ -185,6 +185,11 @@ async fn handle_comment(
let pr_number = comment.pr_number;
let commands = ctx.parser.parse_commands(&comment.text);
+ // B... | 3 | 3 | 0 | [{"id": "G0", "claim": "Add a comment on the new pull_request_error field explaining what it does.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Remove the #[tracing_test::traced_test] attribute from the new test since it is only for local debugg... | null |
rust-lang__bors__217 | rust-lang/bors | 217 | defect | daad9a8d2bfe432b97cdc5b9009eb17e5c9cbc04 | 2f574865fd7245ffa3b8f41db13c311907a784f0 | Improve tests regarding permissions | Fixes #212 | diff --git a/src/bors/handlers/review.rs b/src/bors/handlers/review.rs
index 0b705c1ab..dc2971c64 100644
--- a/src/bors/handlers/review.rs
+++ b/src/bors/handlers/review.rs
@@ -230,7 +230,7 @@ mod tests {
use crate::{
github::PullRequestNumber,
tests::mocks::{
- default_pr_number, defa... | 1 | 1 | 1 | [{"id": "G0", "claim": "Try permissions always imply review, so a reviewer should have both review and try permissions; the try_reviewer_insufficient_permissions test, which expects a user with review but not try to be rejected, does not make sense and the tests should reflect that.", "category": "testing", "verdict": ... | null |
rust-lang__bors__221 | rust-lang/bors | 221 | defect | 1f773b343df49ae0fac310cf9d928d93f0804f98 | cac0d4849e327acc7320cc731e110e059e815b33 | Add rollup mode management | Closes #208 | diff --git a/.sqlx/query-ad1e4676b67caa18bd10c4d9e727950e437d538a747b18ecbf1206ef6b148dc9.json b/.sqlx/query-7efe43b9bd54cc798a81cfe8c4a1ef396044c382b6f5172fb389175d8ce1346e.json
similarity index 63%
rename from .sqlx/query-ad1e4676b67caa18bd10c4d9e727950e437d538a747b18ecbf1206ef6b148dc9.json
rename to .sqlx/query-7efe... | 4 | 4 | 2 | [{"id": "G0", "claim": "The rollup field on the Approve command should be Option<RollupMode> rather than String, so that an unset rollup is distinguishable and the default value is chosen elsewhere.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The Roll... | null |
rust-lang__bors__269 | rust-lang/bors | 269 | defect | 0bf0f67f232c9b9206b0468d3fdf8d605366ff41 | 0933f4be6b35419383be7e39a2d1d7bb71e9d787 | Add database migrations population tests | Fixes #257
This PR adds tests that incrementally populate the database with test data for every migration. | diff --git a/docs/development.md b/docs/development.md
index 147bc6149..2b4cdc3f8 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -118,6 +118,7 @@ Make sure to also run `cargo sqlx migrate run` to apply the migrations to the da
```console
$ cargo sqlx migrate run
```
+4) Add sample data to ... | 7 | 7 | 2 | [{"id": "G0", "claim": "The migration-file detection should match files ending in `.up.sql` (via `to_string_lossy().ends_with`) instead of the looser `contains(\".up.sql\")`.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The tests stay green even w... | null |
rust-lang__bors__276 | rust-lang/bors | 276 | defect | c888edaa5021b2fd398518b047a028ca08b6b395 | 2dba623c9ddecd923d6282d918eb2f96f8f2f2ae | Synchorize pr state periodically | Closes #266. | diff --git a/.sqlx/query-e40b6dacb8063ecda3fea4843735198cd96ff206dab2ee203581e50c6b3b7be1.json b/.sqlx/query-e40b6dacb8063ecda3fea4843735198cd96ff206dab2ee203581e50c6b3b7be1.json
new file mode 100644
index 000000000..ce4263d74
--- /dev/null
+++ b/.sqlx/query-e40b6dacb8063ecda3fea4843735198cd96ff206dab2ee203581e50c6b3b7... | 5 | 5 | 1 | [{"id": "G0", "claim": "fetch_prs downloads every PR in the repository (more than 80 thousand on rust-lang/rust); it should only download the open/draft PRs, and PRs in the DB that are not amongst those open ones should be assumed closed.", "category": "performance", "verdict": "supported", "priority": "P1", "scope": "... | null |
rust-lang__bors__281 | rust-lang/bors | 281 | defect | 48c30e35a06016795bcab46a821a152ec0df3a80 | a290eb16205f90c77c5eaf19d84961727df213e2 | Bootstrap website | This PR adds the website's home page, where it displays the repos. It also displays "[TREECLOSED]" is the tree is closed for the corresponding repo.
The HTML is essentially the same as it was 11 years ago with slight differences:
- Homu -> Bors
- The section on "Customizing the Queue's Contents" has not been adde... | diff --git a/Cargo.lock b/Cargo.lock
index 6baac6559..7a655c227 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -108,6 +108,56 @@ version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
+[[package]]
+name = "askama"... | 4 | 2 | 0 | [{"id": "G0", "claim": "askama should be taken from crates.io as a normally published crate instead of a git dependency.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The askama_axum git dependency is not needed because the template can be rend... | null |
rust-lang__bors__305 | rust-lang/bors | 305 | defect | a83e32bd2b5940a8a91b2c44bcfb7a5feb682c49 | 887e455ea64892d1afa477d252081cadd0328d62 | Replace asserts with `.wait_for_pr` | There's some old code that utilises assertions where it could be updated to use `.wait_for_pr(...)`.
| diff --git a/src/bors/handlers/refresh.rs b/src/bors/handlers/refresh.rs
index 14ef94f1..6e7dec70 100644
--- a/src/bors/handlers/refresh.rs
+++ b/src/bors/handlers/refresh.rs
@@ -325,15 +325,11 @@ timeout = 3600
})
.await?;
tester.refresh_prs().await;
- assert_e... | 1 | 1 | 1 | [{"id": "G0", "claim": "Replacing the immediate `assert_eq!` with `wait_for_pr` is not 100% equivalent, since the test must ensure the PR already has the specific status right after the refresh rather than sometime in the future; instead a helper like `get_pr_from_db(pr_number)` should be added to the tester to load an... | null |
rust-lang__bors__330 | rust-lang/bors | 330 | defect | 28f7f4707fdf3731e043ca44dd6ddff3e9cd00e4 | 9c0fe722dc44466cdf8d16820603959bfe5f8de9 | Merge queue | This PR adds the complete merge queue process from auto build -> merge to master.
The merge queue works like so:
- Every 30s `handle_merge_queue(...)` is called
- It selects a PR that can be merged (based on a set of merge queue priority rules)
- As part of the sorts, successful auto builds come first and pendi... | diff --git a/.sqlx/query-a4aa51a2c1dd32da2861dbedb1d8734dda14d4e90e20bdc807e49d7dc61406f3.json b/.sqlx/query-a4aa51a2c1dd32da2861dbedb1d8734dda14d4e90e20bdc807e49d7dc61406f3.json
new file mode 100644
index 000000000..ab91e12c8
--- /dev/null
+++ b/.sqlx/query-a4aa51a2c1dd32da2861dbedb1d8734dda14d4e90e20bdc807e49d7dc6140... | 2 | 1 | 0 | [{"id": "G0", "claim": "Add a comment on top of get_merge_queue_prs explaining what the function does.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The approval comparison may need .reverse() so that approved PRs come before non-approved ones.",... | null |
rust-lang__bors__350 | rust-lang/bors | 350 | defect | 1069a467b941b8f207a637f5f3d3f67d3d5ca030 | 4db3c467175ae60d73fa09077a02388bb112e879 | Merge queue skeleton | This PR adds the "skeleton" of the merge queue. No logic or processing but just the event itself.
It adds the background process and the refresh event. | diff --git a/.sqlx/query-a4aa51a2c1dd32da2861dbedb1d8734dda14d4e90e20bdc807e49d7dc61406f3.json b/.sqlx/query-a4aa51a2c1dd32da2861dbedb1d8734dda14d4e90e20bdc807e49d7dc61406f3.json
new file mode 100644
index 000000000..47405de7e
--- /dev/null
+++ b/.sqlx/query-a4aa51a2c1dd32da2861dbedb1d8734dda14d4e90e20bdc807e49d7dc6140... | 11 | 11 | 3 | [{"id": "G0", "claim": "The merge queue should be opt-in: add a config option in `rust-bors.toml` so that when it is not enabled the queue does nothing.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The panic message in the merge queue loop should read ... | null |
rust-lang__bors__434 | rust-lang/bors | 434 | defect | 14d1076a7ac35756cf4793279f36d479c17501b2 | cbf754d2f140b931ef26c91d243da494675628d6 | Add workflow links to try build started comments | This PR introduces support for adding workflow links to the comment that gets created when a try build starts.
### Implementation details
Within `handle_workflow_started`, we now invoke a new function:
`add_workflow_links_to_try_build_start_comment`.
That function performs the following steps:
1. Retrieve... | diff --git a/src/bors/comment.rs b/src/bors/comment.rs
index 5eeac044c..816c9eca5 100644
--- a/src/bors/comment.rs
+++ b/src/bors/comment.rs
@@ -198,6 +198,19 @@ pub fn try_build_started_comment(
Comment::new(msg)
}
+pub fn append_work_flow_links_to_comment(
+ comment_content: &mut String,
+ workflow_link... | 8 | 8 | 3 | [{"id": "G0", "claim": "Pass the already-loaded BuildModel to add_workflow_links_to_try_build_start_comment instead of loading it again from the DB and dealing with extra error handling.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Because race co... | null |
rust-lang__bors__57 | rust-lang/bors | 57 | defect | debf50e88584a5d6d1f982ddd26863b81350105d | 6d56a8660c0e432f6903845e6b3d3f78cb2d853a | feat: display workflow url | # What
Fix #46 | diff --git a/src/bors/handlers/trybuild.rs b/src/bors/handlers/trybuild.rs
index 08866e579..68f1d14d3 100644
--- a/src/bors/handlers/trybuild.rs
+++ b/src/bors/handlers/trybuild.rs
@@ -1,4 +1,5 @@
use anyhow::{anyhow, Context};
+use octocrab::models::RunId;
use crate::bors::command::Parent;
use crate::bors::handle... | 7 | 7 | 1 | [{"id": "G0", "claim": "The build should still be marked as cancelled in the DB even when workflow cancellation fails — keep the original logic and store the workflow IDs in an Option, including them in the comment when Some.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"},... | null |
rust-lang__bors__594 | rust-lang/bors | 594 | defect | 1a7197044d4ef0a653d805e2efd20ceb596ca960 | 23035645eb859da06befdfbe01c319e6b03bc867 | Implement a `@bors cancel` command | This command allows cancelling a currently running auto build on a given PR, thus "yielding" its slot in the queue. The usual motivation is to start testing a different PR, which has gotten to the front of the queue in the meantime.
| diff --git a/src/bors/command/mod.rs b/src/bors/command/mod.rs
index 1d351d3b..ace701f3 100644
--- a/src/bors/command/mod.rs
+++ b/src/bors/command/mod.rs
@@ -113,7 +113,7 @@ pub enum BorsCommand {
/// The CI workflow to run.
jobs: Vec<String>,
},
- /// Cancel a try build.
+ /// Cancel a tr... | 1 | 1 | 0 | [{"id": "G0", "claim": "The doc comment of the new `Cancel` command should say that cancelling does not remove the PR from the merge queue.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__bors__675 | rust-lang/bors | 675 | defect | a44ef2cef558ecacacc932e644163d1491b0a633 | f4f6be4f76f242ffb5d9dde0b77f48ceb1e26c16 | Warn about unknown reviewers when approving | part of #191
Check for invalid reviewers and include a warning in comments. | diff --git a/src/bors/comment.rs b/src/bors/comment.rs
index ec0efab6..6b200db1 100644
--- a/src/bors/comment.rs
+++ b/src/bors/comment.rs
@@ -291,6 +291,7 @@ pub fn approved_comment(
repo: &GithubRepoName,
commit_sha: &CommitSha,
reviewer: &str,
+ unknown_reviewers: Option<String>,
tree_state: T... | 3 | 3 | 0 | [{"id": "G0", "claim": "The tests that approve normalized usernames should mock the usernames foo, ... as existing users instead of leaving the unknown-reviewer warning to fire in those tests.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "normalize_app... | null |
rust-lang__bors__682 | rust-lang/bors | 682 | defect | 1b924da6c42f892ce7f5ac690f5cfa949197498e | 2c08e828a8499f9575c248614ea8478192c95fd2 | Add TeamDirectory and load people/teams names | Follow up to: https://github.com/rust-lang/bors/issues/675
The logic that previously checked with r+ permission has been changed to a method that checks by retrieving people and team names from the team API.
Fixes: https://github.com/rust-lang/bors/issues/191 | diff --git a/data/permissions/people.json.example b/data/permissions/people.json.example
new file mode 100644
index 000000000..4dd10e237
--- /dev/null
+++ b/data/permissions/people.json.example
@@ -0,0 +1,3 @@
+{
+ "people": {}
+}
diff --git a/data/permissions/teams.json.example b/data/permissions/teams.json.example... | 2 | 2 | 0 | [{"id": "G0", "claim": "The lowercasing of usernames/teams should be moved into `TeamDirectory` directly, since it is inconsistent that `TeamDirectory` checks names without lowercasing while the lowercasing happens in the callers.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"},... | null |
rust-lang__bors__94 | rust-lang/bors | 94 | defect | 4daf79993c46614fd26c3be26840f24ea1eb09e5 | daed793179fd7d1ab65edd3a1f5c1c22d00a52f0 | tests: mock app and repositories retrieval | This PR initiates the HTTP mocking implementation mentioned in #93, by mocking the following route:
- GET /app
- GET /app/installations
- GET /installation/repositories
- POST /app/installations/{...}/access_tokens
- GET /repos/{owner}/{name}/contents/rust-bors.toml
I'd like to include team permission retrieval... | diff --git a/Cargo.lock b/Cargo.lock
index 6f0b3996..0b6c0f64 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -120,6 +120,16 @@ version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
+[[package]]
+name = "assert-js... | 3 | 1 | 0 | [{"id": "G0", "claim": "Use octocrab's models directly (e.g. octocrab::models::Installation) for returning data from the mock instead of custom structs, keeping own small structs only for describing our state on GH.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "cl... | null |
rust-lang__cargo__15221 | rust-lang/cargo | 15,221 | defect | 1d1d646c06a84c1aa53967b394b7f1218f85db82 | b1e9cca01af1e3a5a616d6d35cca38a3225922f2 | Make sure search paths inside OUT_DIR precede external paths | If a library exists both in an added folder inside OUT_DIR and in the OS, prefer to use the one within OUT_DIR. Folders within OUT_DIR and folders outside OUT_DIR do not change their relative order between themselves.
This is accomplished by sorting by whether we think the path is inside the search path or outside.
... | diff --git a/src/cargo/core/compiler/build_runner/mod.rs b/src/cargo/core/compiler/build_runner/mod.rs
index 1a55d2110685..f8a907745217 100644
--- a/src/cargo/core/compiler/build_runner/mod.rs
+++ b/src/cargo/core/compiler/build_runner/mod.rs
@@ -301,7 +301,9 @@ impl<'a, 'gctx> BuildRunner<'a, 'gctx> {
... | 9 | 8 | 2 | [{"id": "G0", "claim": "Test the -L flag ordering by running cargo with --verbose and asserting the order of -L flag occurrences in rustc arguments, writing the test first against a snapshot of the current behavior and then adding a separate commit with the actual fix and test update.", "category": "testing", "verdict"... | null |
rust-lang__cargo__15317 | rust-lang/cargo | 15,317 | defect | 437ff042f46a2de66260cb0fb097d48a94f56429 | 1609e0222dc196ff0983086a9866dcc2d57d8633 | do not pass cdylib link args to test | <!--
Thanks for submitting a pull request 🎉! Here are some tips for you:
* If this is your first contribution, read "Cargo Contribution Guide" first:
https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to review.
... | diff --git a/src/cargo/core/compiler/build_runner/mod.rs b/src/cargo/core/compiler/build_runner/mod.rs
index 164766937843..ec8d6bd1ebc2 100644
--- a/src/cargo/core/compiler/build_runner/mod.rs
+++ b/src/cargo/core/compiler/build_runner/mod.rs
@@ -262,7 +262,7 @@ impl<'a, 'gctx> BuildRunner<'a, 'gctx> {
... | 5 | 5 | 1 | [{"id": "G0", "claim": "The change to `Bin`, `SingleBin` and `Example` in `LinkArgTarget::applies_to` should be justified or reverted, since a flag required to link a bin would likely also be required to link the bin's unittest and suppressing it there could break bare-metal/custom-test-framework use cases.", "category... | null |
rust-lang__cargo__15341 | rust-lang/cargo | 15,341 | defect | 307cbfda3119f06600e43cd38283f4a746fe1f8b | 5fedc01ef8d48fbc1ad186b02c8fb75ed2e2a0f4 | fix: revert the behavior checking lockfile's VCS status | ### What does this PR try to resolve?
Fixes #15339
Lockfile might be gitignore'd,
So it never shows up in `git status`.
However, `cargo packag` vcs checks actually performs `git status --untracked --ignored`.
It is a bit confusing that lockfile is ignored but still counts as dirty from the report of `cargo p... | diff --git a/src/cargo/ops/cargo_package/vcs.rs b/src/cargo/ops/cargo_package/vcs.rs
index b936c6583fa2..f051e93794be 100644
--- a/src/cargo/ops/cargo_package/vcs.rs
+++ b/src/cargo/ops/cargo_package/vcs.rs
@@ -11,7 +11,6 @@ use tracing::debug;
use crate::core::Package;
use crate::core::Workspace;
-use crate::ops::... | 1 | 1 | 1 | [{"id": "G0", "claim": "The revert is incomplete: the doc-comment change from f0907fca (the lockfile bullet and its [^1] footnote on dirty_files_outside_pkg_root) was not reverted in this commit.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
rust-lang__cargo__15429 | rust-lang/cargo | 15,429 | defect | 307cbfda3119f06600e43cd38283f4a746fe1f8b | 07b541305b7e096f66efece2db6e07107155e5af | test(rustfix): Use `snapbox` for snapshot testing | ### What does this PR try to resolve?
- separates each test into different test cases
- `snapbox` is used to test the snapshots
- difference in `.json` file alone should never cause a test to fail
- `.json` files updated only if expected fix != actual fix && `SNAPSHOTS=overwrite`
- when `.json` files are upd... | diff --git a/Cargo.lock b/Cargo.lock
index 4106030a1d97..66a2eb4eed59 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3425,10 +3425,13 @@ name = "rustfix"
version = "0.9.0"
dependencies = [
"anyhow",
+ "cargo-test-macro",
+ "cargo-test-support",
"proptest",
"serde",
"serde_json",
"similar",
+ "snapbox",
"tem... | 6 | 4 | 0 | [{"id": "G0", "claim": "Since each test is now its own #[test] case, the compile-failure path should drop the logging on lines 75-79 and print the captured stderr directly in the anyhow error (suggested bail).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1"... | null |
rust-lang__cargo__15438 | rust-lang/cargo | 15,438 | defect | 185c6952617bcdb73d9082ad145d4f0b46a0dbfc | 32330f63e51805dbd2cf658c8a061670c2491808 | feat(add): suggest similarly named features | ### What does this PR try to resolve?
Fixes #15436
### How should we test and review this PR?
There are 3 tests for each test case:
- there are no feature suggestions
- there's only one feature suggestion (most common)
- there are several feature suggestions | diff --git a/src/cargo/ops/cargo_add/mod.rs b/src/cargo/ops/cargo_add/mod.rs
index d872e2f00967..eb1da56c2c08 100644
--- a/src/cargo/ops/cargo_add/mod.rs
+++ b/src/cargo/ops/cargo_add/mod.rs
@@ -29,6 +29,7 @@ use crate::core::Summary;
use crate::core::Workspace;
use crate::sources::source::QueryKind;
use crate::util... | 4 | 4 | 1 | [{"id": "G0", "claim": "The pull request should be restructured so the tests are added in their own commit before the change (with them passing) and the feature commit then updates the tests, so the diff between the commits highlights the change in behavior.", "category": "maintainability", "verdict": "supported", "pri... | null |
rust-lang__cargo__15441 | rust-lang/cargo | 15,441 | defect | 8ddf3676d15d6c3464c5eb16dbff4346d1a8db87 | 17372c38df2a1ffbc57edf1708e0abfb1013d927 | feat(add/install): check if given crate argument would be valid with inserted @ symbol | Suggest to user to use a crate name with an inserted @ before the first invalid package name character
Fixes #15318
<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:
* If this is your first contribution, read "Cargo Contribution Guide" first:
https://doc.crates.io/contrib/
* Run `c... | diff --git a/Cargo.lock b/Cargo.lock
index 0abdc8f8109a..f86b90795c8f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -376,6 +376,7 @@ dependencies = [
"tracing-subscriber",
"unicase",
"unicode-width",
+ "unicode-xid",
"url",
"walkdir",
"windows-sys 0.59.0",
diff --git a/Cargo.toml b/Cargo.toml
index 174044345d... | 5 | 5 | 2 | [{"id": "G0", "claim": "The new missing-`@` detection in CrateSpec::from_package_id_spec (cargo add path) is missing a test.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "In crate_spec.rs the `format!` wrapping the error message is redundant.", "catego... | null |
rust-lang__cargo__15484 | rust-lang/cargo | 15,484 | defect | 8b5c35155010279d68e47ca79e19261f37f39f7e | 3c388cd74c96905bd91314f8b13a13c5c96faf52 | Improved error message for versions prefixed with `v` | ### What does this PR try to resolve?
- Added an error message when version in `CRATE[@<VER>]` or `--version <VER>` starts with 'v' for `install`, `add`, `yank` and `update --precise <VER>`
- Check if version is valid in `cargo yank`
Fixes #12331
### How should we test and review this PR?
Added tests for ... | diff --git a/src/bin/cargo/commands/install.rs b/src/bin/cargo/commands/install.rs
index 5fefb7adfff9..0f97071e69aa 100644
--- a/src/bin/cargo/commands/install.rs
+++ b/src/bin/cargo/commands/install.rs
@@ -286,6 +286,12 @@ fn parse_semver_flag(v: &str) -> CargoResult<VersionReq> {
.next()
.ok_or_else... | 1 | 1 | 0 | [{"id": "G0", "claim": "The pull request's commits should follow the atomic commit pattern from the contributor guide: first a new test capturing the current (pre-fix) behavior, followed by a commit containing both the fix and the test change.", "category": "maintainability", "verdict": "supported", "priority": "P2", "... | null |
rust-lang__cargo__15525 | rust-lang/cargo | 15,525 | defect | 966229a4c9e7d999e8feeb0af8418daecc37a728 | c8ee8101f698d18bae47e308c1844dc85d815498 | feat: skip `publish=false` pkg when publishing entire workspace | ### What does this PR try to resolve?
Fixes #15006
This changes how cargo-publish works with the unstable
`-Zpackage-workspace` feature.
Before this, when publishing the entire workspace,
like `cargo publish --workspace`,
if there is a package with `package.pulibsh=false,
it'll fail the entire publish proc... | diff --git a/src/cargo/ops/registry/publish.rs b/src/cargo/ops/registry/publish.rs
index 85cb6118023c..681cb88ce812 100644
--- a/src/cargo/ops/registry/publish.rs
+++ b/src/cargo/ops/registry/publish.rs
@@ -93,6 +93,46 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
.filter(|... | 4 | 3 | 1 | [{"id": "G0", "claim": "The rewritten multiple_unpublishable_package test no longer serves its purpose because nothing is published in it; it should get a publishable package and a separate new test should cover the case where all packages are unpublishable.", "category": "testing", "verdict": "supported", "priority": ... | null |
rust-lang__cargo__15633 | rust-lang/cargo | 15,633 | defect | a7be79bca83296de0ef02d1802d8dd4851fb95d3 | 64834d86277566858ca738a0609dae1574a94995 | fix(workspace): reload current manifest path member only | ### What does this PR try to resolve?
As of #15625, the manifest path argument in `cargo clippy --manifest-path foo/Cargo.toml --fix` will be ignored. All the workspace members will be built. The cause is due to the `reload` usage in `cargo::ops::fix`. We reload the `root_manifest` in the function, which contains al... | diff --git a/src/cargo/core/workspace.rs b/src/cargo/core/workspace.rs
index 4f28a4efb14a..57e50ebefee0 100644
--- a/src/cargo/core/workspace.rs
+++ b/src/cargo/core/workspace.rs
@@ -306,7 +306,7 @@ impl<'gctx> Workspace<'gctx> {
/// This is useful if the workspace has been updated, such as with `cargo
/// fi... | 2 | 2 | 0 | [{"id": "G0", "claim": "The new test should assert full stderr with a snapshot assertion (with_stderr) instead of with_stderr_contains/with_stderr_does_not_contain, which don't allow snapshot updating and can easily test for the wrong thing.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "i... | null |
rust-lang__cargo__15674 | rust-lang/cargo | 15,674 | defect | 2251525ae503fa196f6d7f9ce6d32eccb2d5f044 | eeb71b23948b17bdb649279be5cc20cda9388d5e | feat: Introduce perma unstable `--compile-time-deps` option for `cargo build` | Resolves #14434 | diff --git a/src/bin/cargo/commands/build.rs b/src/bin/cargo/commands/build.rs
index adfc4844f62c..f32546ac7ee5 100644
--- a/src/bin/cargo/commands/build.rs
+++ b/src/bin/cargo/commands/build.rs
@@ -38,6 +38,7 @@ pub fn cli() -> Command {
.arg_build_plan()
.arg_unit_graph()
.arg_timings()
+ ... | 6 | 6 | 3 | [{"id": "G0", "claim": "The new tests should use `check` runs instead of `build` to speed tests up and take up less disk space.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "A blank line should separate the new `is_compile_time_dependency` method from ... | null |
rust-lang__cargo__15764 | rust-lang/cargo | 15,764 | defect | 5b295b77ee4379dec14242ead7b75c84ec4e9f75 | b37eb5004a82e0fc9d3bd6a4f5e40fdcb8c373d2 | fix: `no-proc-macro` is overridden by subsequent edges | ### What does this PR try to resolve?
To close #15763.
### How to test and review this PR?
See steps in #15763.
| diff --git a/src/bin/cargo/commands/tree.rs b/src/bin/cargo/commands/tree.rs
index 367dfd9ed84a..274a3f9cf457 100644
--- a/src/bin/cargo/commands/tree.rs
+++ b/src/bin/cargo/commands/tree.rs
@@ -254,8 +254,12 @@ fn parse_edge_kinds(
|es| {
es.flat_map(|e| e.split(','))
... | 1 | 1 | 1 | [{"id": "G0", "claim": "Would you like to add a test for this fix, structured as one commit adding a passing test of the current buggy behavior followed by a commit with the fix and the test change?", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
rust-lang__cargo__16027 | rust-lang/cargo | 16,027 | defect | 35775fa8008910b7d8186d2f90332cfc7b76e151 | 1ff0cad1b7b6da74c02faf3c4015c12cec9fb4ea | fix(run): Override arg0 for cargo scripts | ### What does this PR try to resolve?
Fixes #12870
### How to test and review this PR?
| diff --git a/crates/cargo-util/src/process_builder.rs b/crates/cargo-util/src/process_builder.rs
index 0e1236c09117..29ac01cbdbe7 100644
--- a/crates/cargo-util/src/process_builder.rs
+++ b/crates/cargo-util/src/process_builder.rs
@@ -20,6 +20,8 @@ use std::process::{Command, ExitStatus, Output, Stdio};
pub struct Pro... | 2 | 1 | 0 | [{"id": "G0", "claim": "The doc comment on the new `arg0` method should read \"(chainable) Overrides `arg0` for this program.\" instead of the copy-pasted \"(chainable) Adds `arg` to the args list.\".", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": ... | null |
rust-lang__cargo__16075 | rust-lang/cargo | 16,075 | defect | ed20c817851c79cacbf2641ab6064ddf35b68272 | 45cba7ac62691a21b9173db70b7aaf1d4969e020 | Fix regression that swallowed json diagnostic explanations | Fixes #16074
| diff --git a/tests/testsuite/test.rs b/tests/testsuite/test.rs
index 1ea32fba5d03..bc1e9f71387e 100644
--- a/tests/testsuite/test.rs
+++ b/tests/testsuite/test.rs
@@ -4455,6 +4455,46 @@ fn json_artifact_includes_executable_for_library_tests() {
.run();
}
+#[cargo_test]
+fn json_diagnostic_includes_explanati... | 1 | 1 | 0 | [{"id": "G0", "claim": "The test's expected JSON should elide the contents of the verbose diagnostic fields (e.g. \"message\" and \"rendered\") to reduce pain points when rustc changes them.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__cargo__16127 | rust-lang/cargo | 16,127 | defect | 9d63ae211b3f2d1fd215f47166cba37e443b254e | 7c5366be449ea218ba92898942623c2a085d49f3 | fix(check): Fix suggested command for bin package | fixes #15982
This PR fixes the suggested command for a bin package and fixes a comment while in the area. | diff --git a/src/cargo/core/compiler/job_queue/mod.rs b/src/cargo/core/compiler/job_queue/mod.rs
index a6d96e2ccbbe..d52f5fbd3dc6 100644
--- a/src/cargo/core/compiler/job_queue/mod.rs
+++ b/src/cargo/core/compiler/job_queue/mod.rs
@@ -1087,9 +1087,12 @@ impl<'gctx> DrainState<'gctx> {
};
... | 2 | 1 | 1 | [{"id": "G0", "claim": "The lib/bin special-case means the suggested command tests more Cargo targets than the actual failed one, and the reviewer proposes always appending `-p` to cover all failing target cases.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "cla... | null |
rust-lang__cargo__16131 | rust-lang/cargo | 16,131 | defect | 367fd9f213750cd40317803dd0a5a3ce3f0c676d | 9006944bc724500d9b189fa498ce7d676aa66ee1 | Warn when installing with a non-default toolchain | *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/cargo/pull/16131)*
This PR implements the cargo changes for #11036. The rustup changes were implemented in https://github.com/rust-lang/rustup/pull/4518.
The PR is currently organized as four commits:
- The first expands the rustup ... | diff --git a/src/cargo/ops/cargo_install.rs b/src/cargo/ops/cargo_install.rs
index 466702903f1e..0ee96f86684d 100644
--- a/src/cargo/ops/cargo_install.rs
+++ b/src/cargo/ops/cargo_install.rs
@@ -1,7 +1,7 @@
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::path::{Path, PathBuf};
use std::sync::A... | 19 | 15 | 1 | [{"id": "G0", "claim": "Render the install warning with the annotate-snippets style diagnostics - a warning message plus a separate `help:` message - instead of a single warn string.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Tests for the behavior c... | null |
rust-lang__cargo__16160 | rust-lang/cargo | 16,160 | defect | 284eefc52359280b174bf6106d6b01ead9f1fe71 | ab2ba7ee0d9f338e63d5c070c63b7103fd3374f9 | Enable CARGO_CFG_DEBUG_ASSERTIONS in build scripts based on profile | Build scripts need to know whether debug assertions are enabled to properly configure dependencies with matching assertion behavior. Previously, `CARGO_CFG_DEBUG_ASSERTIONS` was filtered out because the cfg query to rustc doesn't include profile settings.
This PR manually sets `CARGO_CFG_DEBUG_ASSERTIONS` based on t... | diff --git a/crates/build-rs/src/input.rs b/crates/build-rs/src/input.rs
index d8a75d419221..f2e92383ba88 100644
--- a/crates/build-rs/src/input.rs
+++ b/crates/build-rs/src/input.rs
@@ -172,11 +172,6 @@ mod cfg {
}
/// If we are compiling with debug assertions enabled.
- ///
- /// Build scripts are n... | 6 | 4 | 2 | [{"id": "G0", "claim": "crates/build-rs-test-lib/build.rs needs to be updated to exercise the newly un-gated cargo_cfg_debug_assertions helper.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "CARGO_CFG_DEBUG_ASSERTIONS should be injected into cfg_map... | null |
rust-lang__cargo__16207 | rust-lang/cargo | 16,207 | defect | 0f14d9d2fa4ca7ebee982e6015e98b0d28495390 | 87f00a3fd1b9b5cdc012c93243e04113ebc1d4a8 | feat: emit help messages for github pull request url in dependency | Succeeding #15003.
Piror to this, using a GitHub pull request URLs as dependencies would just fail because of HTTP errors as it's simply not a git repository. This PR implements some help messages on such cases for users to know why it's failing, and how to fix it.
Close #15001. | diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs
index 0b9d8ba2c03d..851da4029082 100644
--- a/src/cargo/util/toml/mod.rs
+++ b/src/cargo/util/toml/mod.rs
@@ -2389,6 +2389,8 @@ fn to_dependency_source_id<P: ResolveToPath + Clone>(
.unwrap_or(GitReference::DefaultBranch);
... | 7 | 5 | 2 | [{"id": "G0", "claim": "The GitHub pull request guidance should be surfaced as context (a note) on the existing fetch error instead of a standalone warning emitted beforehand, which puts the message out of order and reads like an error.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introdu... | null |
rust-lang__cargo__16221 | rust-lang/cargo | 16,221 | defect | 0436f86288a4d9bce1c712c4eea5b05eb82682b9 | 8a99fa688e958671bc80099a2c4e222d90c164ed | fix: update `resolve_all_features()` to filter pkg deps | ### What does this PR try to resolve?
Before, [`resolve_all_features()`](https://github.com/rust-lang/cargo/blob/13695497cd3060ba2700a5552b3397c451456a89/src/cargo/ops/cargo_compile/mod.rs#L1001-L1032) isn't filtering dependencies, as it uses the set returned by [`Resolve::deps()`](https://github.com/rust-lang/cargo... | diff --git a/src/cargo/core/compiler/unit_dependencies.rs b/src/cargo/core/compiler/unit_dependencies.rs
index 947fb17e8419..a05163cc6281 100644
--- a/src/cargo/core/compiler/unit_dependencies.rs
+++ b/src/cargo/core/compiler/unit_dependencies.rs
@@ -28,8 +28,8 @@ use crate::core::compiler::{
};
use crate::core::depe... | 6 | 6 | 3 | [{"id": "G0", "claim": "A test is needed for the behavior this pull request changes.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The test should be added in its own commit that shows the failing behavior, with the commit removing it on top, so the ch... | null |
rust-lang__cargo__16262 | rust-lang/cargo | 16,262 | defect | 8363559a4d19d8aee53bbd9a7e063a4f1e3ec230 | 9e7e29e56da473c60d821764dea57fbca5ca18df | fix(fingerprint): force update mtime of cargo-check artifacts | ### What does this PR try to resolve?
This mtime shift for .rmeta is a workaround as rustc incremental build
since rust-lang/rust#114669 (1.90.0) skips unnecessary rmeta generation.
The situation is like this:
1. When build script execution's external dependendies
(rerun-if-changed, rerun-if-env-changed) ... | diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs
index a9b588c016c..a425a3bda26 100644
--- a/src/cargo/core/compiler/mod.rs
+++ b/src/cargo/core/compiler/mod.rs
@@ -477,6 +477,25 @@ fn rustc(
paths::set_file_time_no_err(dep_info_loc, timestamp);
}
+ // This mti... | 1 | 1 | 0 | [{"id": "G0", "claim": "It would make sense to apply the mtime-update workaround for all modes, not just check mode, and the rustc/cargo contract on whether rustc must update output mtimes should be clarified.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__cargo__16272 | rust-lang/cargo | 16,272 | defect | b5354b56860cd74469be873eb06220a4a5137c99 | 4d928f4086d6d4d53995970dbea7fb690838e92d | fix(package): exclude target/package from backups | ### What does this PR try to resolve?
The target directory is not excluded from backups when created with
`cargo package` or `cargo publish`. This causes the `target/package`
directory to be included in Time Machine backups on macOS and other
backup systems that respect CACHEDIR.TAG files.
The issu... | diff --git a/src/cargo/ops/cargo_package/mod.rs b/src/cargo/ops/cargo_package/mod.rs
index 92282751f819..79b89440a1b1 100644
--- a/src/cargo/ops/cargo_package/mod.rs
+++ b/src/cargo/ops/cargo_package/mod.rs
@@ -162,6 +162,7 @@ fn create_package(
let filename = pkg.package_id().tarball_name();
let dir = ws.b... | 7 | 7 | 4 | [{"id": "G0", "claim": "The exclusion call in TmpRegistry::new is redundant because the root directory is already created by one of the two call sites above it.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "A wrapper method should not be create... | null |
rust-lang__cargo__16276 | rust-lang/cargo | 16,276 | defect | 5c0343317ce45d2ec17ecf41eaa473a02d73e29c | e4ba48cbfbaff0168f3e620755b191798e7dc9be | update: silent failure on non-matching package specs with --breaking | When using 'cargo update -Zunstable-options --breaking <spec>', package specifications that don't match any dependency in the workspace or lockfile are silently ignored instead of reporting an error. This leads to confusing behavior where users think they're updating a package that doesn't exist.
Fix this by trackin... | diff --git a/src/cargo/ops/cargo_update.rs b/src/cargo/ops/cargo_update.rs
index ccbbfa01bfd9..f01898c002de 100644
--- a/src/cargo/ops/cargo_update.rs
+++ b/src/cargo/ops/cargo_update.rs
@@ -238,6 +238,9 @@ pub fn upgrade_manifests(
let mut registry = ws.package_registry()?;
registry.lock_patches();
+ //... | 8 | 6 | 2 | [{"id": "G0", "claim": "Tests demonstrating the old behavior, and splits of existing test cases, should be added in a commit before the commit that changes the behavior, as the contrib docs encourage.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Specs... | null |
rust-lang__cargo__16338 | rust-lang/cargo | 16,338 | defect | e0dd406b88933e82136bbc9073e06d029db8da45 | dbb4d910780a536ca98479f8838c08be5e062d6a | Validate target source paths before compilation with clearer errors | ### What does this PR try to resolve?
Closes #10173
This PR adds early validation of target source paths with clearer error messages.
For context, I tried to solve this issue before ( #16329 ) but ended up making an oversight, I would recommend reading [this](https://github.com/rust-lang/cargo/issues/10173#is... | diff --git a/tests/testsuite/bad_config.rs b/tests/testsuite/bad_config.rs
index ca90a7eaa9ad..4687ab5bf5b7 100644
--- a/tests/testsuite/bad_config.rs
+++ b/tests/testsuite/bad_config.rs
@@ -3755,3 +3755,448 @@ please set bin.path in Cargo.toml
"#]])
.run();
}
+
+#[cargo_test]
+fn nonexistent_target_path() {... | 2 | 2 | 0 | [{"id": "G0", "claim": "The new target-path validation scenarios should be written as separate tests rather than combined into a few multi-case tests.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G4", "claim": "The pull request's commits should be atomic with tests ... | null |
rust-lang__cargo__16407 | rust-lang/cargo | 16,407 | defect | e3643075742a7d2c5c1d05117109da91a8ceb907 | c3922a514336b46cf980239deb0cdbcf2e27707a | feat (patch): Display where the patch was defined in patch-related error messages | ### What does this PR try to resolve?
Closes #13952
This PR adds location information of where each 'patch' was defined to the dependency override algorithm. Currently there're three possible sources: manifest `Cargo.toml`, one of the configuration files (listed [here](https://doc.rust-lang.org/cargo/reference/c... | diff --git a/src/cargo/core/dependency.rs b/src/cargo/core/dependency.rs
index 216c6fba9f3e..9b7cc2f61cc7 100644
--- a/src/cargo/core/dependency.rs
+++ b/src/cargo/core/dependency.rs
@@ -4,13 +4,15 @@ use serde::Serialize;
use serde::ser;
use std::borrow::Cow;
use std::fmt;
-use std::path::PathBuf;
+use std::fmt::{D... | 8 | 7 | 0 | [{"id": "G0", "claim": "For `[patch]` defined through configuration (including CLI), the PR should reuse cargo's existing `Definition` type rather than a bespoke patch-location representation that separates config files from CLI.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "unclear"}, {"i... | null |
rust-lang__cargo__16423 | rust-lang/cargo | 16,423 | defect | 3861f60f6b58f57524c0e7aab1f5c1ad83e35409 | af4174a060c1be336c4d4c8a9ae65481d819abbf | Optimize cargo locate-project --workspace | ### Summary
Optimize cargo locate-project --workspace by adding a fast path that avoids full workspace loading when possible.
### Problem
Previously, ```cargo locate-project --workspace``` always performed full workspace loading, which includes:
Parsing all member manifests
Resolving path dependencies
Vali... | diff --git a/src/bin/cargo/commands/locate_project.rs b/src/bin/cargo/commands/locate_project.rs
index 49d6e6ca2563..ecfb8e0806a2 100644
--- a/src/bin/cargo/commands/locate_project.rs
+++ b/src/bin/cargo/commands/locate_project.rs
@@ -27,15 +27,17 @@ pub struct ProjectLocation<'a> {
pub fn exec(gctx: &mut GlobalCont... | 4 | 3 | 3 | [{"id": "G0", "claim": "The pull request changes behavior without a test; add a test first that demonstrates the current behavior (loading and verifying all members) and then the fix showing the behavior change.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "cla... | null |
rust-lang__cargo__16430 | rust-lang/cargo | 16,430 | defect | 3861f60f6b58f57524c0e7aab1f5c1ad83e35409 | 60d5645f68eb38087170aa460b1c0bfefecedd3f | docs(report): enhance man pages for `cargo report *` | ### [FCP](https://github.com/rust-lang/cargo/pull/16430#issuecomment-3697735409)
### What does this PR try to resolve?
Make space for future report kinds iun `cargo report` documentations.
* A new sub-section of "report commands" in the Cargo book.
* Fixed that `cargo report` man page didn't match its `--help... | diff --git a/.ignore b/.ignore
index e51dabef3e87..716739c37d64 100644
--- a/.ignore
+++ b/.ignore
@@ -13,6 +13,7 @@ src/etc/man
!src/doc/src/commands/manifest-commands.md
!src/doc/src/commands/package-commands.md
!src/doc/src/commands/publishing-commands.md
+!src/doc/src/commands/report-commands.md
# Snapshots o... | 2 | 2 | 1 | [{"id": "G0", "claim": "The new sub-subcommand man pages should be called out in `--help`/`cargo help`, and how such man pages are normally named and handled should be settled.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G2", "claim": "The new man pages ship ... | null |
rust-lang__cargo__16455 | rust-lang/cargo | 16,455 | defect | 5d927cd53cbb3548ded28f35bb2b2b051172568b | b577f224cc66b2d94229bf77a6d2a96824251012 | fix(info): resolve underscore vs hyphen mismatch in schema lookup | ### What does this PR try to resolve?
_This PR makes `cargo info` handle crate names with underscores (`_`) the same way as cargo add, by translating underscores to_ _hyphens (`-`) and emitting a warning and also the other way around._
_Currently, `cargo info my_package` and `cargo info my-crate` fails even when ... | diff --git a/tests/testsuite/cargo_info/mod.rs b/tests/testsuite/cargo_info/mod.rs
index 918dcdbcc220..982b5c8c8fba 100644
--- a/tests/testsuite/cargo_info/mod.rs
+++ b/tests/testsuite/cargo_info/mod.rs
@@ -16,6 +16,7 @@ mod specify_version_with_url_but_registry_is_not_matched;
mod specify_version_within_ws_and_confli... | 3 | 3 | 1 | [{"id": "G0", "claim": "The new test module should not be named `underscore_alias` — the behavior is name normalization, not aliasing, so a name like `crate_name_normalization` would be more descriptive.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "cla... | null |
rust-lang__cargo__16524 | rust-lang/cargo | 16,524 | defect | 85eff7c80277b57f78b11e28d14154ab12fcf643 | 98aa7c2af098f394d2bcdd018668ca2271ada236 | feat(lints): Add non_kebab_case_bin lint | ### What does this PR try to resolve?
Fixes #15586
### How to test and review this PR?
Regarding lint naming:
- I didn't go with `non_kebab_case` because we had received
encouragement to be more specific than `non_camel_case` when
discussing this at the All Hands
- I went with `bin` rather than `bin_na... | diff --git a/Cargo.lock b/Cargo.lock
index f7727eca4d01..329f6232e063 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -351,6 +351,7 @@ dependencies = [
"gix",
"gix-transport",
"glob",
+ "heck",
"hex",
"hmac",
"home 0.5.12 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2291,6 +2292,12 @@ dependenc... | 1 | 1 | 0 | [{"id": "G0", "claim": "The lint's `help` text should be rendered as its own `Group` rather than as a label on the primary annotation.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__cargo__16552 | rust-lang/cargo | 16,552 | defect | efcd9f58636c1990393d495159045d9c35e43b8f | f4b364fa08413a695eb6fa576f16fcbe77ea44bb | feat(lint): Add redundant_readme lint | ### What does this PR try to resolve?
Name and styling was inspired by
[redundant_static_lifetimes](https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes)
Fixes #15869
### How to test and review this PR?
| diff --git a/src/cargo/core/workspace.rs b/src/cargo/core/workspace.rs
index 2a1b8e28555a..8e5afc79912c 100644
--- a/src/cargo/core/workspace.rs
+++ b/src/cargo/core/workspace.rs
@@ -26,6 +26,7 @@ use crate::lints::rules::blanket_hint_mostly_unused;
use crate::lints::rules::check_im_a_teapot;
use crate::lints::rules:... | 2 | 2 | 1 | [{"id": "G0", "claim": "The lint docs' corrected example should drop the `readme = \"README.md\"` line — the \"Should be written as\" snippet must not keep the very field the lint flags as redundant.", "category": "documentation", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "... | null |
rust-lang__cargo__16554 | rust-lang/cargo | 16,554 | defect | 0d08b955e5f6171f81e5268b91a7d70f2e94b62f | a4583a729a0f87b9e0c995f106caa94b10e28bcb | feat(lints): Add mutually exclusive `non_{kebab,snake}_case_packages` | ### What does this PR try to resolve?
Fixes #15585
### How to test and review this PR?
Modeled off of
- https://rust-lang.github.io/rust-clippy/master/index.html?search=mod#self_named_module_files
- https://rust-lang.github.io/rust-clippy/master/index.html?search=mod#mod_module_files | diff --git a/tests/testsuite/lints/mod.rs b/tests/testsuite/lints/mod.rs
index ddef717b8d44..15123cc5ec61 100644
--- a/tests/testsuite/lints/mod.rs
+++ b/tests/testsuite/lints/mod.rs
@@ -8,6 +8,8 @@ mod error;
mod implicit_minimum_version_req;
mod inherited;
mod non_kebab_case_bins;
+mod non_kebab_case_packages;
+mo... | 2 | 1 | 1 | [{"id": "G0", "claim": "Asks whether the rendered binary path (`.../foo_bar`) in the test's expected stderr works on Windows.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Suggests adding `edition = \"2021\"` to the inline script manifest so the te... | null |
rust-lang__cargo__16561 | rust-lang/cargo | 16,561 | defect | b529dab275ce2cc26c984903d49ebd1fb9881ac6 | f4b456ec20af4e44f0d5c8f67c6007b96b35a210 | feat(lints): Add redundant_homepage lint | ### What does this PR try to resolve?
Fixes #15871
### How to test and review this PR?
| diff --git a/src/cargo/core/workspace.rs b/src/cargo/core/workspace.rs
index 805c38983e2..24b1832ce50 100644
--- a/src/cargo/core/workspace.rs
+++ b/src/cargo/core/workspace.rs
@@ -30,6 +30,7 @@ use crate::lints::rules::non_kebab_case_features;
use crate::lints::rules::non_kebab_case_packages;
use crate::lints::rules... | 1 | 1 | 1 | [{"id": "G0", "claim": "The new redundant_homepage lint should also check workspace inheritance, as should redundant_readme; the reviewer asks whether to address that in this PR or merge now and fix it in a follow-up.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
rust-lang__cargo__16566 | rust-lang/cargo | 16,566 | defect | 0f3a1e9099aecdf95f144e842d96dc1827c19852 | 5bb9078aad9a420987eaf9775bc3f4446591f8ef | Prevent `cargo init` in home directory | Resolves #16562
Running `cargo init` in the home directory can lead to confusing states, particularly for new users experimenting with Cargo. A `Cargo.toml` in the home directory causes issues with file discovery, as Cargo will treat the entire home directory as a package root when running commands from any subdirec... | diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs
index 4c10201209d7..153a35e940e4 100644
--- a/src/cargo/ops/cargo_new.rs
+++ b/src/cargo/ops/cargo_new.rs
@@ -4,6 +4,7 @@ use crate::util::important_paths::find_root_manifest_for_wd;
use crate::util::{FossilRepo, GitRepo, HgRepo, PijulRepo, existing_... | 4 | 2 | 0 | [{"id": "G0", "claim": "The error headline would likely read better as \"cannot create package in the home directory\" instead of \"`cargo init` cannot be run in the home directory\".", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The second line of the ... | null |
rust-lang__cargo__16631 | rust-lang/cargo | 16,631 | defect | 06b4f3eed3711ad7c59e2559235a9f52bbd62848 | f3f96bef430e22945d685a7f5944b51700bdbdf3 | fix: apply `host.runner` only when `host-config` enabled | ### What does this PR try to resolve?
This is a regression found in rust-lang/compiler-builtins#1087
and introduced by rust-lang/cargo#16599
There are other regression that `host.runner` and `host.linker`
are accidentally applied to target builds which I plan to fix
both in a follow-up PR.
(rust-lang/cargo#12... | diff --git a/src/cargo/core/compiler/compilation.rs b/src/cargo/core/compiler/compilation.rs
index 7ac26dc8bc59..ebda418f1fb8 100644
--- a/src/cargo/core/compiler/compilation.rs
+++ b/src/cargo/core/compiler/compilation.rs
@@ -235,7 +235,11 @@ impl<'gctx> Compilation<'gctx> {
cmd: T,
pkg: &Package,
... | 1 | 1 | 0 | [{"id": "G0", "claim": "The regression test's reference comment should cite rust-lang/miri#4855 instead of the compiler-builtins PR, as the same underlying issue with a more canonical reference.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__cargo__16641 | rust-lang/cargo | 16,641 | defect | 312145c006c53906c7bd6c585e52f2639d37a191 | 7a1443577dd274b32c986b05d513fe05d9a7e687 | fix(host-config): host.linker should not apply to non host unit | ### What does this PR try to resolve?
Similar to <https://github.com/rust-lang/cargo/pull/16638>,
this prevents `host.linker` from applying to non-host build targets.
### How to test and review this PR?
This behavior has been there since the integration of host-config, so it _might_ break somebody's assumptio... | diff --git a/src/cargo/core/compiler/build_runner/mod.rs b/src/cargo/core/compiler/build_runner/mod.rs
index dd06f63b24e..957fecf55eb 100644
--- a/src/cargo/core/compiler/build_runner/mod.rs
+++ b/src/cargo/core/compiler/build_runner/mod.rs
@@ -282,7 +282,10 @@ impl<'a, 'gctx> BuildRunner<'a, 'gctx> {
... | 2 | 2 | 0 | [{"id": "G0", "claim": "The inline block computing the linker value passed as a parameter to `opt` in `build_base_args` is a bit too complicated.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Tracking the known FIXME that host.linker incorrectl... | null |
rust-lang__cargo__16694 | rust-lang/cargo | 16,694 | defect | 019a9b04563d713ee14f2d7bacba3846f722b26f | 1878e851c142190a7c4ce0c43f8de5801bde5757 | feat(config): Stabilize `resolver.lockfile-path` config | *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/cargo/pull/16694)*
### What does this PR try to resolve?
Closes #14421
Overall, this seems like a low policy knob for users to tweak in config (ie out of the way) so this seems relatively safe to stabilize.
`resolver.lockfile-pat... | diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs
index d71d20619ef3..e72f49adfa9f 100644
--- a/src/cargo/core/features.rs
+++ b/src/cargo/core/features.rs
@@ -887,7 +887,6 @@ unstable_cli_options!(
gitoxide: Option<GitoxideFeatures> = ("Use gitoxide for the given git interactions, or all of the... | 4 | 3 | 2 | [{"id": "G0", "claim": "The PR author raises that the `resolver` table being applied to `cargo install` is inconsistent with its documented local-development scope and asks whether to remove install support or keep it inconsistent.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}... | null |
rust-lang__cargo__16712 | rust-lang/cargo | 16,712 | defect | 292e9c29a4cf3b1fd005b88a96efcd5f7e290be9 | 803e3f1be79e6712ee4289b522d1febee7aa0626 | cargo clean: Add target directory validation | *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/cargo/pull/16712)*
### What does this PR try to resolve?
Fixes #9192
Implements the checks mentioned in [this comment](https://github.com/rust-lang/cargo/issues/9192#issuecomment-3517689516)
To summarise, when `cargo clean` is... | diff --git a/src/bin/cargo/commands/clean.rs b/src/bin/cargo/commands/clean.rs
index d801ee6607de..e9ee35fdf205 100644
--- a/src/bin/cargo/commands/clean.rs
+++ b/src/bin/cargo/commands/clean.rs
@@ -163,6 +163,7 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
profile_specified: args.... | 8 | 7 | 1 | [{"id": "G0", "claim": "A file path passed via --target-dir is deleted by cargo clean without validation, and the new validator silently skips non-directory paths; the discussants ask whether this case should be checked (warn or hard-error).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope"... | null |
rust-lang__cargo__16742 | rust-lang/cargo | 16,742 | defect | 17627c4f546412d575045f6b3c473482a2884f34 | 5319efa81624ee527dd077bf3d1fb46da826d6bc | feat: add frame-pointers profile option | ### What does this PR try to resolve?
Allow turning on frame pointers for a particular profile in `Cargo.toml` by add `frame-pointers` as a profile setting that maps to `-C force-frame-pointers`.
Values:
- `"force-on"` -> `-C force-frame-pointers=yes`
- `"force-off"` -> `-C force-frame-pointers=no`
- `"default... | diff --git a/crates/cargo-util-schemas/src/manifest/mod.rs b/crates/cargo-util-schemas/src/manifest/mod.rs
index c08ea423d621..2e3298203036 100644
--- a/crates/cargo-util-schemas/src/manifest/mod.rs
+++ b/crates/cargo-util-schemas/src/manifest/mod.rs
@@ -941,6 +941,7 @@ pub struct TomlProfile {
pub trim_paths: Opt... | 6 | 3 | 2 | [{"id": "G0", "claim": "The new frame-pointers profile option probably needs a value that means \"use the default\", since lacking one has caused problems before.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Adding the `frame_pointers` field to cargo-u... | null |
rust-lang__cargo__16773 | rust-lang/cargo | 16,773 | defect | d81735547e5f2844322f36380ab66f549cda11b9 | 04024f40b39500cbac35a6169fe773c5416ab78a | fix: rebuild rustdoc json for different versions of a same crate | *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/cargo/pull/16773)*
Fix #16291.
### What does this PR try to resolve?
As discussed in the linked issue, `cargo rustdoc --output-format=json` doesn't rebuild for same crate name but with different versions. This is because current car... | diff --git a/src/cargo/core/compiler/build_runner/compilation_files.rs b/src/cargo/core/compiler/build_runner/compilation_files.rs
index 46329f947cd..ed912efeb2d 100644
--- a/src/cargo/core/compiler/build_runner/compilation_files.rs
+++ b/src/cargo/core/compiler/build_runner/compilation_files.rs
@@ -513,8 +513,12 @@ im... | 8 | 7 | 1 | [{"id": "G0", "claim": "The rustdoc JSON output placement should leverage the per-unit directory layout (build/<pkg_name>/<hash>/out) rather than the doc directory the PR originally wrote to.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Doc-parts JSON ... | null |
rust-lang__cargo__16796 | rust-lang/cargo | 16,796 | defect | 418aed5315cc9eccc7e45b2d64a14b0f0f99b4cc | da169f3dc7e2f37b11b7a9f1e09d5e28bc2fd410 | feat(compile): Stabilize `build.warnings` | *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/cargo/pull/16796)*
### What does this PR try to resolve?
This allows users to either
- hide warnings (#14258)
- error on warnings (#8424)
`build.warnings` serves a similar purpose as `RUSTFLAGS=-Dwarnings` / `RUSTFLAGS=-Awarnings`... | diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs
index d71d20619ef3..1a09b13fe475 100644
--- a/src/cargo/core/features.rs
+++ b/src/cargo/core/features.rs
@@ -914,7 +914,6 @@ unstable_cli_options!(
target_applies_to_host: bool = ("Enable the `target-applies-to-host` key in the .cargo/config.tom... | 10 | 4 | 1 | [{"id": "G0", "claim": "With `build.warnings = \"allow\"` hard warnings are handled inconsistently (rustc warnings are hidden while cargo warnings are shown), the Cargo Script warning should not be hidden, and the author leans towards making `allow` show hard warnings always.", "category": "design", "verdict": "uncerta... | null |
rust-lang__cargo__16818 | rust-lang/cargo | 16,818 | defect | ddb37b06aba4dcf791fde56dd9fcf73ae7d05f7f | 5f6b2ea5d82101d6641af181efcd446c7b56491d | fix(tree): clarify error message when `-i` is used without a package name | *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/cargo/pull/16818)*
Fixes #8840
Clarify the error message when `-i` is used without a package name,
and add tests for both the basic and `--workspace` cases | diff --git a/src/bin/cargo/commands/tree.rs b/src/bin/cargo/commands/tree.rs
index f7af78263bda..8e27817e5ad2 100644
--- a/src/bin/cargo/commands/tree.rs
+++ b/src/bin/cargo/commands/tree.rs
@@ -204,18 +204,17 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
}
_ => {
... | 3 | 3 | 1 | [{"id": "G0", "claim": "The literal `help:`/`Note:` prefixes inside the string should be lowercased (`help:`, `note:`) so the renderer can style them as `[HELP]`/`[NOTE]` instead of printing the bare words.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "cl... | null |
rust-lang__cargo__16843 | rust-lang/cargo | 16,843 | defect | 906fa6ccd82010e7dbc1bb99869de84e77197a21 | a2d39d2b2cf10b8cad2db9084baf5fc7675fe7bd | Warn on invalid jobserver file descriptors | ### What does this PR try to resolve?
Cargo will currently load a jobserver from file descriptors if `MAKEFLAGS`, `MFLAGS`, `RUST_MAKEFLAGS` environment variables contain `--jobserver-auth=N,N`.
The jobserver crate provides a method to attempt to validate whether these descriptors are actually pipes, which cargo ... | diff --git a/src/cargo/util/context/mod.rs b/src/cargo/util/context/mod.rs
index fed1d94c0ae9..e3ff7644cd72 100644
--- a/src/cargo/util/context/mod.rs
+++ b/src/cargo/util/context/mod.rs
@@ -72,7 +72,7 @@ use std::io::prelude::*;
use std::mem;
use std::path::{Path, PathBuf};
use std::str::FromStr;
-use std::sync::{A... | 1 | 1 | 1 | [{"id": "G0", "claim": "The new test's expected stderr assumes the Unix \"cannot open file descriptor 200001...\" message, which differs on Windows where the jobserver crate uses a named semaphore, so the test fails on Windows CI.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduc... | null |
rust-lang__cargo__16844 | rust-lang/cargo | 16,844 | defect | 1ad92f77a819953bcef75a24019b66681ff28b1c | ee944b891243cad3b9562d87cc2cf427546ae7dd | fix(core): use `closest_msg` to suggest similar member name for mistyped `-p` | Fixes: #15561
Use `closest_msg` to suggest similar workspace member name when `-p <typo>` triggers the outside-of-workspace features error. | diff --git a/src/cargo/core/workspace.rs b/src/cargo/core/workspace.rs
index 357381cf8226..7d9e4effd506 100644
--- a/src/cargo/core/workspace.rs
+++ b/src/cargo/core/workspace.rs
@@ -1890,7 +1890,24 @@ impl<'gctx> Workspace<'gctx> {
&& !cli_features.all_features
&& cli_features.uses_de... | 1 | 1 | 0 | [{"id": "G0", "claim": "The hint should reuse the shared `closest`/`closest_msg` logic from `edit_distance.rs` instead of hand-rolled distance-2 matching, keeping the closest-matching logic consistent across cargo (e.g. by updating the affected test assertions rather than keeping a divergent variant, since making `clos... | null |
rust-lang__cargo__16846 | rust-lang/cargo | 16,846 | defect | ddb37b06aba4dcf791fde56dd9fcf73ae7d05f7f | 69fb1ca6a45a3ffc3fcdfaa98bec62d0492542ad | Support target.'cfg(..)'.rustdocflags analogously to rustflags | ### What does this PR try to resolve?
Resolves #16761 by supporting `target.'cfg(..)'.rustdocflags` with behavior analogous to `target.'cfg(..)'.rustflags`.
Before this change, `target.'cfg(..)'.rustdocflags` was ignored and warned as an unused key. This PR brings cfg-based `rustdocflags` support to parity with e... | diff --git a/tests/testsuite/rustdocflags.rs b/tests/testsuite/rustdocflags.rs
index 588c5aa5f952..2603f5fcb2ee 100644
--- a/tests/testsuite/rustdocflags.rs
+++ b/tests/testsuite/rustdocflags.rs
@@ -193,6 +193,83 @@ fn not_affected_by_target_rustflags() {
.run();
}
+#[cargo_test]
+fn target_cfg_rustdocflags... | 1 | 1 | 0 | [{"id": "G0", "claim": "The rustdocflags cfg test cases should use just `cfg(true)` instead of a platform-conditional cfg value.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__cargo__16855 | rust-lang/cargo | 16,855 | defect | 35f8202bfe47f954a4613a846cfd406bda9d3b8c | 2a4d0fdf1141dcfab10b3c58829e95125a9097ef | Never include use extra-filename in build scripts |
### What does this PR try to resolve?
See: #16854
This is that in #16812 we stopped adding the metadata hash to build script names and just call them `build_script_build[EXE]` since they are already contained within a directory with the hash.
However, I didn't take into consideration `__CARGO_DEFAULT_LIB_MET... | diff --git a/src/cargo/core/compiler/build_runner/compilation_files.rs b/src/cargo/core/compiler/build_runner/compilation_files.rs
index 8cb56d22adb1..5f7dec3ce0bd 100644
--- a/src/cargo/core/compiler/build_runner/compilation_files.rs
+++ b/src/cargo/core/compiler/build_runner/compilation_files.rs
@@ -914,9 +914,14 @@ ... | 2 | 2 | 0 | [{"id": "G0", "claim": "The duplicated word in the added comment should read \"Build scripts never use metadata\".", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The new test's doc comment should say \"used by rustc bootstrap and Miri\" instead of... | null |
rust-lang__cargo__16879 | rust-lang/cargo | 16,879 | defect | 3185f58bbb76877cb80a8d39225eb70bd50f590b | 80b911766df3d6c699617f71b04ad445bdf40b43 | fix: Prefer defined lint levels over default | The current logic for selecting a level for a lint does not prioritize defined lint levels over the default one. This led to cases where the wrong level, or `LintLevelReason`, was chosen. To address this, I did two things. The first was renaming `LintLevelReason` to `LintLevelSource`, this was done to better align the ... | diff --git a/src/cargo/lints/mod.rs b/src/cargo/lints/mod.rs
index def2a46f240d..1e3aa46fca73 100644
--- a/src/cargo/lints/mod.rs
+++ b/src/cargo/lints/mod.rs
@@ -44,7 +44,7 @@ pub enum ManifestFor<'a> {
}
impl ManifestFor<'_> {
- fn lint_level(&self, pkg_lints: &TomlToolLints, lint: &Lint) -> (LintLevel, LintLe... | 3 | 2 | 0 | [{"id": "G0", "claim": "The max_by_key tie-break should test the lint's source (e.g. `s == LintLevelSource::Default`) instead of the forbid flag, so selection stays correct if other LintLevelSources are added, ideally with a test of the package/default interaction to catch it.", "category": "maintainability", "verdict"... | null |
rust-lang__cargo__16934 | rust-lang/cargo | 16,934 | defect | c4dabdc36319ade77535cc64a5b9202ff589312e | 5774dc442769492068b52780e634f5c0c1b0821a | cargo clean: do not error if explicitly specified target-dir does not exist | Fixes #16925
Regressed in #16712 which added validation for explicitly specified target directories by checking if they contain a valid `CACHEDIR.TAG`.
This PR makes it so that cargo skips this validation if the target-dir doesn't exist. | diff --git a/src/cargo/ops/cargo_clean.rs b/src/cargo/ops/cargo_clean.rs
index 34c74afed5b5..cbe2141e2327 100644
--- a/src/cargo/ops/cargo_clean.rs
+++ b/src/cargo/ops/cargo_clean.rs
@@ -73,15 +73,18 @@ pub fn clean(ws: &Workspace<'_>, opts: &CleanOptions<'_>) -> CargoResult<()> {
if opts.explicit_target_dir_arg {... | 1 | 1 | 0 | [{"id": "G0", "claim": "The nested existence check and validate_target_dir_tag error check could be collapsed into a single if-let chain statement.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
rust-lang__cargo__16936 | rust-lang/cargo | 16,936 | defect | 06ac0e7c05770a8c7bbf67bdd12fa1a1eefdc8ae | e34a3233e30ce0b0fed69cba4ecaaef6a7b48a4c | Remove curl dependency from crates-io crate | ### What does this PR try to resolve?
Converts the crates-io crate to be HTTP Client agnostic. It now uses a trait to execute HTTP requests. This enables users of the library to use any HTTP library they like, rather than only supporting `curl`.
Within cargo, an `HttpClient` using `http_async` is added (which use... | diff --git a/crates/crates-io/lib.rs b/crates/crates-io/lib.rs
index d95ce91c8887..86312b235c9e 100644
--- a/crates/crates-io/lib.rs
+++ b/crates/crates-io/lib.rs
@@ -179,9 +179,8 @@ pub enum Error {
body: String,
},
- /// Reason why the token was invalid.
- #[error("{0}")]
- InvalidToken(&'sta... | 3 | 2 | 1 | [{"id": "G0", "claim": "The public Error enum added in this PR should get #[non_exhaustive], taking advantage of the major release to add it to some public enums.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The documentation should perhaps be enhanced... | null |
rust-lang__cargo__16940 | rust-lang/cargo | 16,940 | defect | 3c4678d6a93a072f0a6cf379ea673e35abbe415f | 28046b7e77a1b1fc7fea9a1f806ccd4329a2f53a | fix(compile): Where possible, hint about misplaced deps | ### What does this PR try to resolve?
Sometimes a normal dependency is actually a dev-dependency.
For any of the dev-dependencies we build, we can let users know that an
unused dep might be a misplaced dep. This check came from #8437 but I originally punted on it due to the complexity of having the right informati... | diff --git a/src/cargo/core/compiler/job_queue/job_state.rs b/src/cargo/core/compiler/job_queue/job_state.rs
index 05b9627e4b85..378bca1fa070 100644
--- a/src/cargo/core/compiler/job_queue/job_state.rs
+++ b/src/cargo/core/compiler/job_queue/job_state.rs
@@ -9,6 +9,7 @@ use crate::core::compiler::locking::LockKey;
use... | 2 | 2 | 0 | [{"id": "G0", "claim": "The commit that holds the core data-model change is buried in the middle of the series and its message does not explain why the refactor is needed or how it unblocks the later behavior change, and it should say more.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope... | null |
rust-lang__cargo__16957 | rust-lang/cargo | 16,957 | defect | 4f9b52075316e9ced380c8fa492858048d5758b6 | 255bff338de0ade34725d6c7d7f6b51f93fe124d | fix(config): `[env]` relative paths definition | ### What does this PR try to resolve?
`EnvConfigValue` was wrapped in `Value<T>`,
which captured the table-level `Definition` for path resolution.
1. In `merge_helper`,
we merge all keys in a table but not the definition of the table itself:
<https://github.com/rust-lang/cargo/blob/60960cbe4148295890ccd0... | diff --git a/src/cargo/util/context/mod.rs b/src/cargo/util/context/mod.rs
index e6e41ef71e71..bcf095f01545 100644
--- a/src/cargo/util/context/mod.rs
+++ b/src/cargo/util/context/mod.rs
@@ -2347,6 +2347,7 @@ impl ConfigInclude {
Definition::Environment(_) | Definition::Cli(None) | Definition::BuiltIn => g... | 4 | 2 | 1 | [{"id": "G0", "claim": "An [env] value with relative = true defined in a config pulled in by include is resolved against the unnormalized path of the including config, so a config included from foo/.cargo/config.toml yields foo/outer where outer is expected.", "category": "correctness", "verdict": "supported", "priorit... | null |
rust-lang__cc-rs__1000 | rust-lang/cc-rs | 1,000 | defect | 2a0bf2b0234a538f96a064bde2b50e6677b27c9c | f3b594642f14cb6aab1e37cd2c3b2c5fbd636901 | Fix compile family detection: Use C macros instead of `$compiler -v` | Fixed #958 | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 653c6d12a..fef9cb8cd 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -4,6 +4,7 @@ on: [push, pull_request]
env:
CARGO_INCREMENTAL: 0
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
+ CC_ENABLE_DEBUG_OUTPUT: true
... | 3 | 1 | 0 | [{"id": "G0", "claim": "Copying detect_compiler_family.c into a named tempfile may be unnecessary; the reviewer asks to use `env!(\"CARGO_MANIFEST_DIR\")/src/detect_compiler_family.c` instead.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The `disable_deb... | null |
rust-lang__cc-rs__1029 | rust-lang/cc-rs | 1,029 | defect | f313ff54b86c97794f10e5058a6c123b5a50b575 | ce088c5ee98cd3dee4d67aee0e0f7a0f1ae76466 | Add visionOS support | I haven't added this to CI, as the Rust builds themselves are still somewhat broken until https://github.com/rust-lang/libc/pull/3568 lands.
CC @BlackHoleFox | diff --git a/src/lib.rs b/src/lib.rs
index 17a9c057d..2b7af7ca2 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1892,6 +1892,7 @@ impl Build {
if !target.contains("apple-ios")
&& !target.contains("apple-watchos")
&& !target.contains("apple-tvos")
+ ... | 2 | 2 | 2 | [{"id": "G0", "claim": "The visionOS deployment target should be read from the XROS_DEPLOYMENT_TARGET environment variable, not VISIONOS_DEPLOYMENT_TARGET.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The PR should not emit -m{}os-version-min for ... | null |
rust-lang__cc-rs__1047 | rust-lang/cc-rs | 1,047 | defect | 2c85112e1476fa10014dd47b0c6451e5fed2ffdd | 0fea8e197fbd9bfc9b72ae2dccb1bdd1b5742be4 | Don't use the value of SDKROOT if it doesn't match the target. | The SDKROOT environment variable can be problematic on Mac. In cases where you are compiling for multiple targets, SDKROOT cannot be right for all of them. Furthermore, the system Python interpreter sets SDKROOT to the MacOSX SDK if not already set.
So, if you are using a Python script to run a build, and you need t... | diff --git a/src/lib.rs b/src/lib.rs
index 99c2fd9c8..ff114fcb6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3653,8 +3653,42 @@ impl Build {
}
fn apple_sdk_root(&self, sdk: &str) -> Result<OsString, Error> {
- if let Some(sdkroot) = env::var_os("SDKROOT") {
- return Ok(sdkroot);
+ /... | 2 | 2 | 2 | [{"id": "G0", "claim": "Use env::var_os instead of env::var to read SDKROOT so that a non-UTF-8 SDKROOT path is handled.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add `let sdkroot = sdkroot.to_string_lossy();` after binding `p` so the string-lo... | null |
rust-lang__cc-rs__1088 | rust-lang/cc-rs | 1,088 | defect | ca1f5f9d48c0d917ab27901cd54ed665793d0ddf | 8d3b6956147012417d24c857c5011ede0e7d631a | Fix clippy warnings on Windows | This is likely best reviewed commit-by-commit. The first commit simply uses `cargo clippy --fix` to automatically fix warnings so there almost certainly aren't any behavioural changes. The other commits are manual fixes but should be fine too. The most tricky one is probably 397dd22 because it's rearranging boolean exp... | diff --git a/dev-tools/cc-test/build.rs b/dev-tools/cc-test/build.rs
index 6fa3c1cfb..d8fc08c03 100644
--- a/dev-tools/cc-test/build.rs
+++ b/dev-tools/cc-test/build.rs
@@ -169,7 +169,7 @@ fn main() {
#[track_caller]
fn run_forked_capture_output(out: &Path, action: &str) {
let program = env::current_exe().unwrap... | 3 | 3 | 1 | [{"id": "G0", "claim": "In command_add_output_file the last operand of the rewritten condition needs parentheses so that `args.is_asm && args.is_arm` is grouped explicitly (e.g. when `args.cuda` is true the expression should be false without evaluating the rest).", "category": "correctness", "verdict": "supported", "pr... | null |
rust-lang__cc-rs__1103 | rust-lang/cc-rs | 1,103 | defect | a1e291a4f5bb7ef7f75bb6606ad2149827721946 | a48587b603377f2e9cc08e9213e1618dc15848fc | Use `Build::getenv` instead of `env::var*` in anywhere that makes sense | So that we would get:
- recompilation when the env is changed
- cached env
Also some optimisation | diff --git a/src/lib.rs b/src/lib.rs
index dbeb44685..ff7ce04de 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -221,7 +221,7 @@ use std::path::{Component, Path, PathBuf};
#[cfg(feature = "parallel")]
use std::process::Child;
use std::process::Command;
-use std::sync::{Arc, Mutex, RwLock};
+use std::sync::{Arc, RwLock};... | 2 | 2 | 0 | [{"id": "G0", "claim": "The new `ios_support` line should use `Path::new(&sdk_path)` instead of `PathBuf::from(&sdk_path)` to avoid building an owned PathBuf.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G2", "claim": "It might make sense to ban `std::env::var` ... | null |
rust-lang__cc-rs__1181 | rust-lang/cc-rs | 1,181 | defect | eb3390615747fde57f7098797b2acb1aec80f539 | ff441330513644e91df25236e3c966d99b72d876 | Add support for parsing `*FLAGS` with `shlex` | Hello,
This PR adds support for parsing `*FLAGS` with the `shlex` crate. This effectively fixes #847, and means `*FLAGS` with spaces designed for `meson`, `make` and `cmake` will work with no extra configuration.
In order to preserve compatibility with existing setups, the behavior must be opted into with `CC_PARSE_F... | diff --git a/Cargo.toml b/Cargo.toml
index a67464387..c7be77ee2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,6 +21,7 @@ rust-version = "1.63"
[dependencies]
jobserver = { version = "0.1.30", default-features = false, optional = true }
+shlex = "1.3.0"
[target.'cfg(unix)'.dependencies]
# Don't turn on the fea... | 3 | 2 | 0 | [{"id": "G0", "claim": "Add a newline between the mod declarations and the new `use shlex::Shlex;` import.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The new `shlex` dependency would preferably be optional (e.g. gated behind a feature) rathe... | null |
rust-lang__cc-rs__1364 | rust-lang/cc-rs | 1,364 | defect | a8c9dc0187367bcecd9a59585153ff71859dd8ed | 172da47fc1c34754c55273386787e3967bfe82e0 | Fix compilation on macOS using clang and fix compilation using zig-cc | Fixed #1362 #1360 | diff --git a/src/tool.rs b/src/tool.rs
index af43a918e..e1307c041 100644
--- a/src/tool.rs
+++ b/src/tool.rs
@@ -428,10 +428,7 @@ impl Tool {
/// Supports using `--` delimiter to separate arguments and path to source files.
pub(crate) fn supports_path_delimiter(&self) -> bool {
- matches!(
- ... | 1 | 1 | 0 | [{"id": "G0", "claim": "Add a comment on supports_path_delimiter explaining that Homebrew's clang does not support the flag, and that this is why the flag is not enabled for Clang.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__cc-rs__1378 | rust-lang/cc-rs | 1,378 | defect | bf4dcf7c19fb2ed84c403b27715ba7bcc9f2dece | c5c1a91ad6532e70081ead71ffc81485df116932 | Include wrapper args. in `stdout` family heuristics to restore classifying `clang --driver-mode=cl` as `Msvc { clang_cl: true }` | I'm not sure which version exactly broke this, but between 1.0.89 and latest releases, this case had broken for the primary tool family heuristic. This forces Firefox/[`mozilla-central`](https://hg.mozilla.org/mozilla-central) to work around breakage in a `cc` upgrade a la [D236305](https://phabricator.services.mozilla... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 69d6b33b9..a6765006b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+- Include compiler wrapper arguments (i.e., `CC=compiler arg1 arg2`) in the classificati... | 4 | 4 | 1 | [{"id": "G0", "claim": "The pull request's changed compiler-family detection ships without any test; the reviewers asked the author to add one (suggesting a clang-shim like the existing gcc-shim) so future changes cannot silently break it.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "int... | null |
rust-lang__cc-rs__1389 | rust-lang/cc-rs | 1,389 | defect | 9a9c248928ea71de85a0c9339b5500b8b1b5408f | bfdf3d5cdf520cbfbf21742094210eae71b1c3cb | Fix cross-compiling for Apple platforms | (So, of course we weren't done here...)
Basically, the only difference between this and pre-https://github.com/rust-lang/cc-rs/pull/1384 is that on visionOS and Mac Catalyst, we pass a versioned `--target` instead of unversioned `--target` + `-mtargetos=`.
This is similar to the alternative I noted in that PR, and ... | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 110551e44..5c89a3499 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -86,6 +86,16 @@ jobs:
rust: stable
target: x86_64-apple-ios-macabi
no_run: --no-run # FIXME(madsmtm): Fix run... | 3 | 1 | 1 | [{"id": "G0", "claim": "It is unclear why installing llvm tools for llvm-ar is required in the Apple cross-compilation CI jobs; the author would expect the default ar to work, though omitting llvm-ar fails the link with \"archive has no index; run ranlib to add one\".", "category": "maintainability", "verdict": "uncert... | null |
rust-lang__cc-rs__1403 | rust-lang/cc-rs | 1,403 | defect | 0dd683ca4c57fff1d8701d5a780749fcf09a5e75 | 7a651f74aedef60439bbac11bef9e63dc91b1cab | Change flag ordering | To allow flags set on the builder with `Build::flag`/`Build::flag_if_supported` to override other flags, and to allow `CFLAGS` to override _all_ other flags.
Found while doing https://github.com/rust-lang/cc-rs/pull/1401.
Now the order of flags are as follows, with later flags overriding previous ones. I've also ... | diff --git a/src/lib.rs b/src/lib.rs
index f059d4f44..6f39e0e3f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1892,13 +1892,39 @@ impl Build {
let mut cmd = self.get_base_compiler()?;
+ // The flags below are added in roughly the following order:
+ // 1. Default flags
+ // - Controlle... | 4 | 1 | 0 | [{"id": "G0", "claim": "The `-std` flag should be classified as a Builder flag (specified in the Builder) rather than sitting under default flags.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "There should be another issue or PR tracking the disabled `CAR... | null |
rust-lang__cc-rs__1447 | rust-lang/cc-rs | 1,447 | defect | 59578addda0233c8e9a0b399769cedb538ac8052 | 1ef467d4eda1cd431513676637d26ef45650401e | Use `std::thread::available_parallelism` for determining the default number of jobs | The function was stabilized in 1.59, while the current MSRV is 1.63. | diff --git a/src/parallel/job_token.rs b/src/parallel/job_token.rs
index 5528e1f8b..a5bc3d81c 100644
--- a/src/parallel/job_token.rs
+++ b/src/parallel/job_token.rs
@@ -238,9 +238,10 @@ mod inprocess_jobserver {
// Note that we could use `num_cpus` here but it's an extra
// dependency that wil... | 5 | 3 | 0 | [{"id": "G0", "claim": "Do not invoke std::thread::available_parallelism when NUM_JOBS is set.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Update the comments above the fallback, which became outdated once the code no longer uses num_cpus.", "category... | null |
rust-lang__cc-rs__1456 | rust-lang/cc-rs | 1,456 | defect | 0f8834db2022ec57e7a1be06f7aafd2688d4b57c | 91646cebfa462e79c9f9aaac2f0df9af7c92402e | support "vxworks" and "nto" OSes on `get_base_archiver_variant` | Extends the archiver detection logic to support the "vxworks" and "nto" operating systems. This change will allow us to remove [this custom bootstrap logic](https://github.com/rust-lang/rust/blob/e5fefc359bec532134013baaabc92560bfb61578/src/bootstrap/src/utils/cc_detect.rs#L32-L60) and rely entirely on the `cc` crate a... | diff --git a/src/lib.rs b/src/lib.rs
index 6139bb25c..bda173038 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2113,7 +2113,7 @@ impl Build {
// This assumes qcc/q++ as compiler, which is currently the only supported compiler for QNX.
// See for details: https://github.com/rust-l... | 3 | 3 | 1 | [{"id": "G0", "claim": "`i586` is never a `target_arch` that rustc produces, so the new `\"i586\"` match arms against `target.arch` are effectively dead code; the NTO archiver match (and likewise the qcc `-Vgcc_nto*` arg match above it) should not match `i586` as a `target.arch`, and if `i586`-style matching is wanted ... | null |
rust-lang__cc-rs__1497 | rust-lang/cc-rs | 1,497 | defect | 59854df166298056efe44375914b761f7b43835e | 11b6595cc3385f7249e6127b9e6a63217186f7c3 | Proposal: ability to statically link against C++ stdlib | Hi everyone!
I want to create a little proposal. It's very common situation when you need to statically link C++ stdlib to your binary. Usually it makes your binary a little bit more portable, especially if your app will be distributed to old systems. So this PR introduce an ability to explicitly say that you want t... | diff --git a/src/lib.rs b/src/lib.rs
index d4c2fe381..64dbee615 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -300,6 +300,7 @@ pub struct Build {
files: Vec<Arc<Path>>,
cpp: bool,
cpp_link_stdlib: Option<Option<Arc<str>>>,
+ cpp_link_stdlib_static: bool,
cpp_set_stdlib: Option<Arc<str>>,
cuda:... | 1 | 1 | 0 | [{"id": "G0", "claim": "Would the author be able to add a test case for the new static C++ stdlib linking feature (or otherwise verify it works locally)?", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
rust-lang__cc-rs__1516 | rust-lang/cc-rs | 1,516 | defect | ca81dcc1a77a0894b45e336957ed7a772494cee8 | 064f3f092c2eafe84c316dc524f011478dc3e89c | Add prefer_clang_cl_over_msvc | Closes https://github.com/rust-lang/cc-rs/issues/882
This could probably replace https://github.com/rust-lang/cc-rs/pull/1367. Now that https://github.com/rust-lang/cc-rs/pull/1506 has been merged, `windows_registry_find_tool` can find `clang-cl.exe` correctly.
This PR also adds a fix for something I missed in `f... | diff --git a/src/lib.rs b/src/lib.rs
index 2da9a3c99..c08409f04 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -351,6 +351,7 @@ pub struct Build {
shell_escaped_flags: Option<bool>,
build_cache: Arc<BuildCache>,
inherit_rustflags: bool,
+ prefer_clang_cl_over_msvc: bool,
}
/// Represents the types of... | 6 | 6 | 1 | [{"id": "G0", "claim": "In find_llvm_tool_vs17, clang_cl should only be set to true when the requested tool is clang-cl.exe; hardcoding it to true is inaccurate for other LLVM tools like clang.exe (which may count as family Clang rather than Msvc).", "category": "correctness", "verdict": "supported", "priority": "P1", ... | null |
rust-lang__cc-rs__1682 | rust-lang/cc-rs | 1,682 | defect | d41559b130900f834a07d89a27b70a78e2511c31 | d9e4c8e66b5e9193424e86821f0703a3a8cc7255 | Improve the semantics of `Build::env` | Follow-up to https://github.com/rust-lang/cc-rs/pull/1656.
This implements what I proposed in there, primarily:
- Split `Build::getenv` into several functions, depending on the use-case, see https://github.com/rust-lang/cc-rs/pull/1656#issuecomment-3837351684 for discussion.
- Ensure that `Build::env` propagate to... | diff --git a/src/command_helpers.rs b/src/command_helpers.rs
index c80f50617..0bec3a947 100644
--- a/src/command_helpers.rs
+++ b/src/command_helpers.rs
@@ -16,7 +16,7 @@ use std::{
},
};
-use crate::{Error, ErrorKind, Object};
+use crate::{utilities::cargo_env_var_os, Error, ErrorKind, Object};
#[derive(Clo... | 5 | 2 | 0 | [{"id": "G0", "claim": "Since `WASI_SDK_PATH` is already overridable via `Build::env`, `WASI_SYSROOT` and `WASM_MUSL_SYSROOT` should also be made overridable (using `get_env_overridable`).", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The pull request lea... | null |
rust-lang__cc-rs__1700 | rust-lang/cc-rs | 1,700 | defect | f4c5ac7a7e7917660d2068ecb5fd015a11ffb3d6 | 98d39ce52eb517956797dc38a9d7b862c5320499 | fix(ar): suppress warnings from `D` modifier probe | On macOS, the system `ar` doesn't support the `D` modifier. It causes `illegal option -- D` to be emitted as `cargo:warning=` during the probe.
Add a `run_silent_on_error()` helper that buffers stderr and only forwards it when the command succeeds.
Repro script:
```bash
#!/usr/bin/env bash
# Reproduce the "i... | diff --git a/src/command_helpers.rs b/src/command_helpers.rs
index 0bec3a947..d58d8e258 100644
--- a/src/command_helpers.rs
+++ b/src/command_helpers.rs
@@ -345,6 +345,37 @@ pub(crate) fn run(cmd: &mut Command, cargo_output: &CargoOutput) -> Result<(), E
wait_on_child(cmd, &mut child, cargo_output)
}
+/// Like ... | 3 | 3 | 3 | [{"id": "G0", "claim": "run_silent_on_error should only forward stderr as cargo:warning= when CargoOutput requires warnings, instead of writing warnings unconditionally on success.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The line splitting in... | null |
rust-lang__cc-rs__216 | rust-lang/cc-rs | 216 | defect | c738a5013e2a03778d6c605e886da0c52e7cf632 | d5161c6b41a46b6ae25d8e62b1ac2a7c1062ce58 | Add warnings control | Resolves #190 | diff --git a/src/lib.rs b/src/lib.rs
index a0e178dc0..f4a159b75 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -86,6 +86,8 @@ pub struct Config {
static_crt: Option<bool>,
shared_flag: Option<bool>,
static_flag: Option<bool>,
+ warnings_into_errors: bool,
+ warnings: bool,
}
/// Configuration used... | 5 | 4 | 2 | [{"id": "G0", "claim": "The new warnings_flags helper could be simpler.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The new warnings behaviour ships without any tests, and tests should be added for it.", "category": "testing", "verdict": "sup... | null |
rust-lang__cc-rs__612 | rust-lang/cc-rs | 612 | defect | a11e066fe2b100cff42c50c1bd9b18bc69e674dc | 95a6e868005f4fe20a4497a14aa9c08c42f7c715 | Improve CUDA support | It's rather tricky to use the CUDA compiler with cc-rs, because as it is now you would customarily get a bunch of unresolved symbols linking errors. Answer is a) perform CUDA-specific `--device-link` step, b) link with CUDA run-time. ~The latter is solved as a feature.~
For reference, this is similar to #508, but th... | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 7144904cf..37e68793d 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -87,6 +87,25 @@ jobs:
- run: cargo test ${{ matrix.no_run }} --manifest-path cc-test/Cargo.toml --target ${{ matrix.target }} --features parall... | 5 | 4 | 1 | [{"id": "G0", "claim": "The newly added `which` crate dependency should be dropped and replaced with a simple iteration over `PATH` (e.g. via `env::split_paths`) to keep the crate's dependencies slim.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The CU... | null |
rust-lang__cc-rs__673 | rust-lang/cc-rs | 673 | defect | fba7feded71ee4f63cfe885673ead6d7b4f2f454 | aea8392f85fcd3ec219e7414fb02d2efd80119b3 | MSVC: Add support for linking against the "spectre-mitigated" CRT | Issue Details:
Since VS 2017, MSVC has shipped a set of "spectre-mitigated" CRT static libs: https://devblogs.microsoft.com/cppblog/spectre-mitigations-in-msvc/
Typically these are used by opening a VS Command Prompt in "spectre mode" (https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msv... | diff --git a/cc-test/build.rs b/cc-test/build.rs
index 695c75473..88478c12f 100644
--- a/cc-test/build.rs
+++ b/cc-test/build.rs
@@ -57,10 +57,10 @@ fn main() {
cc::Build::new().file("src/windows.c").compile("windows");
}
- // Test that the `windows_registry` module will set PATH by looking for
- ... | 3 | 1 | 0 | [{"id": "G0", "claim": "cc-rs does not build LIB from scratch but prefixes the existing one, and existing LIB should take precedence: cc-rs should build its own LIB only if it is not already set.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "Manipulatin... | null |
rust-lang__cc-rs__694 | rust-lang/cc-rs | 694 | defect | 53272c5953cf0d8d6bfe7252935f9ff6fca56ce2 | cc61cdd04fbc732154ef4874b55c68cba8fc051e | Use a DWARF version consistent with rustc | Rustc defaults to DWARF-2 on some targets, and DWARF-4 on others.
However using -g with the C compiler yields whatever default version the
C compiler prefers.
One side effect is that the DWARF debug info shipped in some libraries
with rustc itself (e.g. libcompiler_builtins and others) have recently
switched to ... | diff --git a/src/lib.rs b/src/lib.rs
index 30ebc9212..6b12014b6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -212,13 +212,17 @@ enum ToolFamily {
impl ToolFamily {
/// What the flag to request debug info for this family of tools look like
- fn add_debug_flags(&self, cmd: &mut Tool) {
+ fn add_debug_flags(&... | 6 | 3 | 1 | [{"id": "G0", "claim": "Add commentary on get_dwarf_version stating that the version choice reflects rustc defaults as of version X through Y, so that whenever defaults change there is a hint that a corresponding adjustment may be needed.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope":... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.