Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,16 @@ fn run_command(cmd: Command) -> anyhow::Result<()> {
&& line.contains(
" are different, but only one can be written to lockfile unambiguously",
))
|| (line.contains("failed to select a version for ")
&& line.contains(" which could resolve this conflict"))
{
broken_deps = true;
} else if line.contains("error: failed to parse lock file at")
|| line.contains(
"error: Attempting to resolve a dependency with more than one crate with links=",
)
|| (line.contains("error: checksum for ")
&& line.contains(" changed between lock files"))
{
broken_lockfile = true;
}
Expand Down
19 changes: 19 additions & 0 deletions tests/buildtest/crates/checksum-mismatch/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions tests/buildtest/crates/checksum-mismatch/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "checksum-mismatch"
version = "0.1.0"
authors = ["Pietro Albini <pietro@pietroalbini.org>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
empty-library = "1.0.0"

[features]

# attempts to replicate error such as https://crater-reports.s3.amazonaws.com/beta-1.96-1/1.95.0/gh/Deltafall-Community.deltafall-clicker/log.txt
3 changes: 3 additions & 0 deletions tests/buildtest/crates/checksum-mismatch/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
14 changes: 14 additions & 0 deletions tests/buildtest/crates/links-collision/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "links-collision"
version = "0.1.0"
authors = ["Pietro Albini <pietro@pietroalbini.org>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# both specify sqlite3 as their links key
sqlite3-src = { version = "=0.6.1" }
libsqlite3-sys = { version = "=0.32.0" }

# replicates the error from e.g. https://crater-reports.s3.amazonaws.com/beta-1.96-1/1.95.0/gh/07CalC.rustodo/log.txt
3 changes: 3 additions & 0 deletions tests/buildtest/crates/links-collision/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
14 changes: 14 additions & 0 deletions tests/buildtest/crates/missing-feature/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "missing-feature"
version = "0.1.0"
authors = ["Pietro Albini <pietro@pietroalbini.org>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
empty-library = { version = "1.0.0", features = ["does-not-exist"] }

[features]

# attempts to replicate errors such as https://crater-reports.s3.amazonaws.com/beta-1.96-1/1.95.0/gh/GHOryy5.AINFTP/log.txt
3 changes: 3 additions & 0 deletions tests/buildtest/crates/missing-feature/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
21 changes: 21 additions & 0 deletions tests/buildtest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,27 @@ test_prepare_error!(
InvalidCargoTomlSyntax
);

test_prepare_error_stderr!(
test_checksum_mismatch,
"checksum-mismatch",
InvalidCargoLock,
"error: checksum for `empty-library v1.0.0` changed between lock files"
);

test_prepare_error_stderr!(
test_missing_feature,
"missing-feature",
BrokenDependencies,
"failed to select a version for `empty-library` which could resolve this conflict"
);

test_prepare_error_stderr!(
test_links_collision,
"links-collision",
BrokenDependencies,
"failed to select a version for `sqlite3-src` which could resolve this conflict"
);

test_prepare_error_stderr!(
test_yanked_deps,
"yanked-deps",
Expand Down
Loading