rust icon indicating copy to clipboard operation
rust copied to clipboard

Rust track exercise "xorcism" cannot run tests

Open jwaddle opened this issue 3 years ago • 8 comments

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 requirement hexlit = "^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 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 (--offli <img width="1479" alt="Screen Shot 2022-01-03 at 8 41 10 PM" src="https://user-images.githubusercontent.com/5522478/148010494-701bb99c-938b-409b-912a-0c8de7f51dd3.png"> 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

jwaddle avatar Jan 04 '22 04:01 jwaddle

Hi and welcome to Exercism! :wave:

Thanks for opening an issue :slightly_smiling_face:

  • If you are suggesting a new feature or an improvement to Exercism, please take a read of this post, which will likely result in a faster response.
  • If you are reporting a bug in the website, thank you! We are getting a lot of reports at the moment (which is great), but we triage and reply as soon as we can.
  • If you are requesting support, someone will help shortly.
  • For everything else, we will reply or triage your issue to the right repository soon.

github-actions[bot] avatar Jan 04 '22 04:01 github-actions[bot]

Thanks for reporting. cc @exercism/rust

iHiD avatar Jan 04 '22 12:01 iHiD

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

jwaddle avatar Jan 05 '22 18:01 jwaddle

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?

coriolinus avatar Jan 05 '22 19:01 coriolinus

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

jwaddle avatar Jan 05 '22 23:01 jwaddle

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.

petertseng avatar Jan 08 '22 16:01 petertseng

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: @.***>

coriolinus avatar Jan 08 '22 19:01 coriolinus

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?

MizardX avatar Jan 24 '22 19:01 MizardX

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.

senekor avatar Jul 21 '23 09:07 senekor