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

How do I handle crate and package name mismatches in REPL? #21

Closed
vi opened this issue Oct 4, 2018 · 3 comments
Closed

How do I handle crate and package name mismatches in REPL? #21

vi opened this issue Oct 4, 2018 · 3 comments

Comments

@vi
Copy link

vi commented Oct 4, 2018

Example: prettytable-rs.

$ evcxr 
Welcome to evcxr. For help, type :help
>> extern crate prettytable;
error: no matching package named `prettytable` found
>> extern crate prettytable_rs;
error: no matching package named `prettytable_rs` found
>> :dep prettytable-rs = "*"
(waiting)
can't find crate for `prettytable_rs`
>> extern crate prettytable;
error: no matching package named `prettytable` found
@Celti
Copy link

Celti commented Oct 5, 2018

The issue seems to be that add_extern_crate() in eval_context.rs automatically uses the normalized package name as the crate name. It's called by process_command() from command_context.rs — naively, the syntax for :dep could be extended to allow specifying separate package and crate names.

OTOH, extern crate goes away in the 2018 edition, and I have no idea how this might interact with that.

@vi
Copy link
Author

vi commented Oct 5, 2018

As I simple workaround, :dep prettytable-rs = "*" may still fail with can't find crate for prettytable_rs, yet add the dependency, allowing further explicit extern crate prettytable; to succeed (maybe also after first failing to find a package).

@davidlattimore
Copy link
Collaborator

Thanks for the report, I hadn't realised that crates could use a different name for the library. This looks like a duplicate of #15, so lets continue discussion there...

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

3 participants