-
Notifications
You must be signed in to change notification settings - Fork 542
Update instructions in reverse-string exercise. #1568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Using the latest version of [the unicode-segmentation crate](https://crates.io/crates/unicode-segmentation) causes the tests to fail when run on exercism. Updating the instructions to at least suggest a solution seems helpful.
@petertseng A couple things about this, since I'm unfamiliar with how/where the external crates are configured for this. Can the dependency for unicode-segmentation be set to something like Or, if we need to have a note, might it be preferred as an '```exercism/note'? |
Students will specify the external dependency in https://github.com/exercism/rust/blob/main/exercises/practice/reverse-string/Cargo.toml. Because this is an optional feature as described in https://github.com/exercism/rust/blob/main/exercises/practice/reverse-string/.docs/instructions.append.md, I presume that is why students specify the dependency, rather than the Rust track providing a Cargo.toml with the dependency already specified. A more ideal solution would be that the test runner should expose precisely which crates and versions of those crates it allows, and then the student can refer to that list of crate versions to decide what to use. Of course, that ideal solution will take time to implement, so intermediate solutions could ease the pain in the meantime. "Use a lower version" is too prone to the problem of having to guess what version, which can be frustrating. Better to advise the student to use a more general version specification. |
Right, I know where a student specifies it. I don't know where the infrastructure specifies what it will allow from the student. I was thinking that if the infrastructure can specify something more general, then smaller version upgrades wouldn't be disallowed. I like the idea of doing that, if possible, or your ideal suggestion of informing the student what crates/versions are accepted. I'm unfamiliar with the infrastructure, so I don't how much effort it would involve to allow a range of versions. I agree that just suggesting to use a lower version could be frustrating to the student if they keep picking one that isn't low enough to satisfy what's configured in the infrastructure. If configuring to accept a range of versions is relatively easy, I'm guessing that could be the intermediate solution before implementing the list of supported crates/versions? |
The test runner adds these lines to Cargo.toml: https://github.com/exercism/rust-test-runner/blob/main/bin/generate-registry.sh#L15-L21 I'll arbitrarily pick the first crate of https://github.com/exercism/rust-test-runner/blob/main/local-registry/supported_crates to demonstrate:
Of course, the version would be what |
Thanks for fielding my novice questions re the test runner. I may be starting to see the light. I'm unfamiliar with bash, so I don't know how much of a hassle it would be in it to change
to
If that were doable, am I wrong in thinking that it would support all versions from |
Ultimately it depends on the behaviour of the tool we use to build the local registry. Since I don't know anything about https://github.com/dhovart/cargo-local-registry/blob/master/src/main.rs, it is not possible for me to guess what effect that proposed change will have. Naturally, because the only reason for the above statement is that I don't know, it means we should remember not to let that ignorance stifle exploration. |
I don't think it's possible to allow a broader range of versions to be accepted. If the manifest provided by the student specifies a newer version than the one in the registry, compilation should definitely fail from cargo's perspective. After all, the person who wrote the manifest may rely on features or bug fixes from the newer version. We can't really do anything about this at the time of building the registry. Building with the latest version of a library provides the best compatibility, but it cannot provide compatibility with future versions. Thoughts about alternatives:
I like number 2, it would be the biggest step for a smoother user experience. It would take a bit of work though. |
This problem should be fixed if exercism/rust-test-runner#77 is merged. |
The test runner now has pinned versions and dependabot bumps them automatically every week. The likelihood of this problem occurring again should be minimized. |
Using the latest version of the unicode-segmentation crate causes the tests to fail when run on exercism.
Updating the instructions to at least suggest a solution seems helpful.