rust icon indicating copy to clipboard operation
rust copied to clipboard

practice/xorcism tests do not compile, incorrect dependency version in local registry.

Open maugier opened this issue 3 years ago • 2 comments

With the supplied Cargo.toml, the runner fails with:

error: failed to select a version for the requirement `hexlit = "=0.3.2"`
candidate versions found which didn't match: 0.5.2
location searched: `/opt/test-runner/local-registry` index (which is replacing registry `crates-io`)
required by package `xorcism v0.1.0 (/mnt/exercism-iteration)`
perhaps a crate was updated and forgotten to be re-vendored?
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.

Bumping hexlit to 0.3.2 in Cargo.toml then causes the runner to fail again with

error: failed to select a version for the requirement `rstest = "=0.6.4"`
candidate versions found which didn't match: 0.11.0

Bumping rstest to 0.11.0 then causes:

error: failed to select a version for the requirement `proc-macro2 = "=1.0.32"`
candidate versions found which didn't match: 1.0.29
location searched: `/opt/test-runner/local-registry` index (which is replacing registry `crates-io`)
required by package `rstest v0.11.0`

And at that stage, I don't know what to do, because it seems either the local-registry has inconsistent versions, or the "candidates version found" list is not complete.

I would gladly submit a pull request, if I had any idea how to fix this :/

maugier avatar Nov 10 '21 18:11 maugier

I have the same kind of issue for the Poker exercise. I opened an issue on the rust-test-runner repository, but no reaction so far 😕

abalhier avatar Nov 17 '21 22:11 abalhier

Gigasecind exercise: Same error for the original version 0.3 as well as with updated version 0.3.5 or 0.3.3

error: failed to select a version for the requirement `time = "=0.3.5"`
candidate versions found which didn't match: 0.3.3, 0.1.44
location searched: `/opt/test-runner/local-registry` index (which is replacing registry `crates-io`)
required by package `gigasecond v2.0.0 (/mnt/exercism-iteration)`
perhaps a crate was updated and forgotten to be re-vendored?
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.

blynx avatar Nov 28 '21 23:11 blynx

Steps to resolve general dependency issues:

  • Do not submit the Cargo.lock file.
  • The version specified in the Cargo.toml file should be lower or equal to the one mentioned in the error message.
  • Do not pin the exact version in Cargo.toml by using the equal sign (e.g. regex = "=1.5.5"). Use the regular regex = "1.5.5", it allows cargo to be more lenient with the version.

The xorcism exercise is a bit special, because the hexlit dependency is not added by students, but it's there by default for the tests. I have just merged a PR removing this dependency from the tests, so you should be able to fix the issue with xorcism by removing the hexlit dependency from Cargo.toml.


Please feel free to ping me if you still have problems.

senekor avatar Jul 21 '23 12:07 senekor