Skip to content
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

grep exercise fails with implementation using clap on the grader #1938

Closed
dan-seol opened this issue Jul 9, 2024 · 3 comments
Closed

grep exercise fails with implementation using clap on the grader #1938

dan-seol opened this issue Jul 9, 2024 · 3 comments

Comments

@dan-seol
Copy link

dan-seol commented Jul 9, 2024

error: no matching package named `clap_derive` found location searched: registry `crates-io` required by package `grep v1.3.0 (exercism-iteration)` 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.

this was quite surprising given

/// In the real world, it's common to use crates such as [clap] or
/// [structopt] to handle argument parsing, and of course doing so is
/// permitted in this exercise as well, though it may be somewhat overkill.

could we fix the grader to accept clap based solutions?

Copy link
Contributor

github-actions bot commented Jul 9, 2024

Hello. Thanks for opening an issue on Exercism 🙂

At Exercism we use our Community Forum, not GitHub issues, as the primary place for discussion. That allows maintainers and contributors from across Exercism's ecosystem to discuss your problems/ideas/suggestions without them having to subscribe to hundreds of repositories.

This issue will be automatically closed. Please use this link to copy your GitHub Issue into a new topic on the forum, where we look forward to chatting with you!

If you're interested in learning more about this auto-responder, please read this blog post.

@github-actions github-actions bot closed this as completed Jul 9, 2024
@dan-seol dan-seol changed the title grep exercise fails with implementation using clap grep exercise fails with implementation using clap on the grader Jul 9, 2024
@senekor senekor reopened this Jul 9, 2024
@senekor
Copy link
Contributor

senekor commented Jul 9, 2024

That is indeed a problem, thanks for the report. I'm pretty sure that clap_derive will be too slow to compile and exercises using it would hit the timeout. Here are the options I can think of:

  • Suggest people use the builder API of clap. It's less convenient, but nonetheless an "officially blessed" way to write clap apps. Compile times would hopefully be fast enough. (Note to self: would have to add clap to the test runner in this case.)

  • Suggest to use a different crate (lexopt, pico-args...)

  • Remove the suggestion to use libraries entirely (sad)

What do you think?

@dan-seol
Copy link
Author

Hi, I think the first option sounds ideal -- but if the suggestion is already removed it's all good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants