diff --git a/cargo/lib/dependabot/cargo/update_checker/version_resolver.rb b/cargo/lib/dependabot/cargo/update_checker/version_resolver.rb index 897a2a47eb5..85f4492b1d8 100644 --- a/cargo/lib/dependabot/cargo/update_checker/version_resolver.rb +++ b/cargo/lib/dependabot/cargo/update_checker/version_resolver.rb @@ -214,8 +214,6 @@ def handle_cargo_errors(error) raise Dependabot::GitDependencyReferenceNotFound, dependency_url end - raise Dependabot::DependencyFileNotResolvable, error.message if resolvability_error?(error.message) - if workspace_native_library_update_error?(error.message) # This happens when we're updating one part of a workspace which # triggers an update of a subdependency that uses a native library, @@ -237,6 +235,8 @@ def handle_cargo_errors(error) return nil end + raise Dependabot::DependencyFileNotResolvable, error.message if resolvability_error?(error.message) + raise error end # rubocop:enable Metrics/AbcSize diff --git a/cargo/spec/dependabot/cargo/update_checker/version_resolver_spec.rb b/cargo/spec/dependabot/cargo/update_checker/version_resolver_spec.rb index c3761b50e10..4553efc68c2 100644 --- a/cargo/spec/dependabot/cargo/update_checker/version_resolver_spec.rb +++ b/cargo/spec/dependabot/cargo/update_checker/version_resolver_spec.rb @@ -533,5 +533,16 @@ let(:dependency_files) { unprepared_dependency_files } it { is_expected.to eq(Gem::Version.new("0.1.80")) } end + + context "when multiple packages have a version conflict with one another" do + let(:dependency_name) { "ructe" } + let(:dependency_version) { "0b8acfe5eea15713bc56c156f974fa05967d0353" } + let(:string_req) { nil } + let(:source) { { type: "git", url: "https://github.com/kaj/ructe" } } + let(:dependency_files) { project_dependency_files("version_conflict") } + let(:unprepared_dependency_files) { project_dependency_files("version_conflict") } + + specify { expect(subject).to be_nil } + end end end diff --git a/cargo/spec/fixtures/projects/version_conflict/Cargo.lock b/cargo/spec/fixtures/projects/version_conflict/Cargo.lock new file mode 100644 index 00000000000..c3f17b0faa4 --- /dev/null +++ b/cargo/spec/fixtures/projects/version_conflict/Cargo.lock @@ -0,0 +1,290 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "askama" +version = "0.10.5" +source = "git+https://github.com/djc/askama?branch=main#bc2e92e7d64a2987647f8702c4e5680acef03943" +dependencies = [ + "askama_derive", + "askama_escape", + "askama_shared", +] + +[[package]] +name = "askama_derive" +version = "0.10.5" +source = "git+https://github.com/djc/askama?branch=main#bc2e92e7d64a2987647f8702c4e5680acef03943" +dependencies = [ + "askama_shared", + "proc-macro2", + "syn", +] + +[[package]] +name = "askama_escape" +version = "0.10.1" +source = "git+https://github.com/djc/askama?branch=main#bc2e92e7d64a2987647f8702c4e5680acef03943" + +[[package]] +name = "askama_shared" +version = "0.11.1" +source = "git+https://github.com/djc/askama?branch=main#bc2e92e7d64a2987647f8702c4e5680acef03943" +dependencies = [ + "askama_escape", + "humansize", + "nom 6.0.1", + "num-traits", + "percent-encoding", + "proc-macro2", + "quote", + "serde", + "syn", + "toml", +] + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bitvec" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ba35e9565969edb811639dbebfe34edc0368e472c5018474c8eb2543397f81" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "bytecount" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "funty" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ba62103ce691c2fd80fbae2213dfdda9ce60804973ac6b6e97de818ea7f52c8" + +[[package]] +name = "humansize" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6cab2627acfc432780848602f3f558f7e9dd427352224b0d9324025796d2a5e" + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + +[[package]] +name = "lexical-core" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db65c6da02e61f55dae90a0ae427b2a5f6b3e8db09f58d10efab23af92592616" +dependencies = [ + "arrayvec", + "bitflags", + "cfg-if 0.1.10", + "ryu", + "static_assertions", +] + +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + +[[package]] +name = "nom" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88034cfd6b4a0d54dd14f4a507eceee36c0b70e5a02236c4e4df571102be17f0" +dependencies = [ + "bitvec", + "memchr", + "version_check", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" + +[[package]] +name = "ructe" +version = "0.13.1-PRE" +source = "git+https://github.com/kaj/ructe#0b8acfe5eea15713bc56c156f974fa05967d0353" +dependencies = [ + "base64", + "bytecount", + "itertools", + "md5", + "nom 5.1.2", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "serde" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "syn" +version = "1.0.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "tap" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36474e732d1affd3a6ed582781b3683df3d0563714c59c39591e8ff707cf078e" + + +[[package]] +name = "toml" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" +dependencies = [ + "serde", +] + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" + +[[package]] +name = "version_conflict" +version = "0.1.0" +dependencies = [ + "askama", + "ructe", +] + +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" diff --git a/cargo/spec/fixtures/projects/version_conflict/Cargo.toml b/cargo/spec/fixtures/projects/version_conflict/Cargo.toml new file mode 100644 index 00000000000..797f3587cc8 --- /dev/null +++ b/cargo/spec/fixtures/projects/version_conflict/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "version_conflict" +version = "0.1.0" +authors = ["support@dependabot.com"] + +[dependencies] +askama = { git = "https://github.com/djc/askama", branch = "main" } + +[build-dependencies] +ructe = { git = "https://github.com/kaj/ructe" } diff --git a/cargo/spec/fixtures/projects/version_conflict/src/main.rs b/cargo/spec/fixtures/projects/version_conflict/src/main.rs new file mode 100644 index 00000000000..e69de29bb2d