exercism / rust-test-runner

GNU Affero General Public License v3.0
3 stars 15 forks source link

Failed to select a version for the requirement libc = "=0.2.106" when using rs_poker crate #32

Closed abalhier closed 1 year ago

abalhier commented 3 years ago

Hello,

For the Poker exercise, I am using the rs_poker crate, the 1.0.0 version. The tests run and pass locally on my machine, but on the Exercism website, I get this error :

error: failed to select a version for the requirement libc = "=0.2.106" candidate versions found which didn't match: 0.2.103 location searched: /opt/test-runner/local-registry index (which is replacing registry crates-io) required by package rand v0.6.5 ... which satisfies dependency rand = "=0.6.5" of package rs_poker v1.0.0 ... which satisfies dependency rs_poker = "=1.0.0" of package poker v1.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.

Any idea on how to fix this ?

blynx commented 2 years ago

Same for the Gigasecind exercise:

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.
halas commented 2 years ago

Same for RobotName exercise.

It needs rand crate and the test failur message is:

error: failed to select a version for the requirement `libc = "^0.2.22"`
candidate versions found which didn't match: 0.2.110
location searched: `/opt/test-runner/local-registry` index (which is replacing registry `crates-io`)
required by package `rand v0.8.4`
    ... which satisfies dependency `rand = "^0.8.4"` (locked to 0.8.4) of package `robot-name v0.0.0 (/mnt/exercism-iteration)`
perhaps a crate was updated and forgotten to be re-vendored?
senekor commented 1 year ago

These dependency issues are usually solved by not submitting the Cargo.lock file in the solution. Otherwise, cargo is forced to use the exact version specified in the lockfile, which can quickly get out of sync with the local registry of the test runner.

Also make sure not to specify dependencies in Cargo.toml with the equal sign, e.g. time = "=0.3.5". This will have the same effect of forcing one specific version, which is unlikely to match.

Feel free to ping me if you have other questions.