exercism / rust

Exercism exercises in Rust.
https://exercism.org/tracks/rust
MIT License
1.42k stars 519 forks source link

Rust track exercise "xorcism" cannot run tests #1422

Closed jwaddle closed 12 months ago

jwaddle commented 2 years ago

This is due to crates included by default for Xorcism's tests, not due to the user including external crates.

even when submitting old, previously working community solutions to the "Xorcism" problem, Exercism gives the following error:

We received the following error when we ran your code: WARNING: student did not upload Cargo.lock. This may cause build errors. error: failed to select a version for the requirementhexlit = "^0.3.0" candidate versions found which didn't match: 0.5.3 location searched:/opt/test-runner/local-registryindex (which is replacing registrycrates-io) required by packagexorcism 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 (--offli

Screen Shot 2022-01-03 at 8 41 10 PM

ne) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.`

Screen Shot 2022-01-03 at 8 41 10 PM
github-actions[bot] commented 2 years ago

Hi and welcome to Exercism! :wave:

Thanks for opening an issue :slightly_smiling_face:

iHiD commented 2 years ago

Thanks for reporting. cc @exercism/rust

jwaddle commented 2 years ago

Does this take a while before the fix is live? It still appears to be an issue

coriolinus commented 2 years ago

Hmm, it should have updated by now. Is the error identical? In particular, the text of interest in the above screenshot is

error: failed to select a version for the requirement `hexlit = "^0.3.0"`
candidate versions found which don't match:
0.5.3

Is that the same, or has the error changed?

jwaddle commented 2 years ago

it looks the same Screen Shot 2022-01-05 at 3 14 10 PM

petertseng commented 2 years ago

This is my understanding:

Since the Rust track's fix was to update Cargo.toml, but Cargo.toml is not listed in the important_files in https://github.com/exercism/website/blob/8d764e16e71709cec0f871e090854ce7ad108ab8/app/models/git/exercise.rb#L185-L194 (which include the test files, the instructions, and any files listed in the Rust track's config files.editor, of which the Rust track has none), any students who checked out this exercise before the Cargo.toml was updated will still use the old version of Cargo.toml. The button to update their exercise version is not offered in this case, since no important file has changed, since the Rust track has not defined Cargo.toml as important.

coriolinus commented 2 years ago

Ah, right. We should definitely include exercises/*/*/Cargo.toml among the important files. Any idea how specifically that looks in config.json?

On Sat, Jan 8, 2022 at 5:14 PM Peter Tseng @.***> wrote:

EBWODP:

The button to update their exercise version

Should instead be: "The button to update their exercise version is not offered in this case"

— Reply to this email directly, view it on GitHub https://github.com/exercism/rust/issues/1422#issuecomment-1008045221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3V4TVKAXCHZFIHPWH6Z6LUVBPHTANCNFSM5LHJWXTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you modified the open/close state.Message ID: @.***>

MizardX commented 2 years ago

Now same problem with rstest:

error: failed to select a version for the requirement `rstest = "^0.6.4"`
candidate versions found which didn't match: 0.11.0
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?
senekor commented 12 months ago

https://github.com/exercism/rust/pull/1711 should solve the problem for all new solutions. I believe it doesn't fix old solutions, those will just have to remove the dependency manually. Since Cargo.toml is now considered part of the solution (https://github.com/exercism/rust/pull/1459), a change to it should trigger a new test run.

We should not use dev-dependencies in the future to avoid the same problem.