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

Lib package names from cargo differ (dash vs. underscore) #259

Closed
adpaco-aws opened this issue Mar 27, 2024 · 3 comments
Closed

Lib package names from cargo differ (dash vs. underscore) #259

adpaco-aws opened this issue Mar 27, 2024 · 3 comments

Comments

@adpaco-aws
Copy link

The change in rust-lang/cargo#12783 causes cargo to return lib package names which are different to the names obtained through cargo metadata. More specifically, the cargo name will use underscores (_) instead of dashes (-), otherwise they are the same.

We first noticed this discrepancy during a Rust toolchain upgrade in model-checking/kani#3102, where we worked around this issue by introducing a weaker comparison between the targets. cargo metadata was specifically mentioned in this comment from rust-lang/cargo#12783 as an area that would be affected.

What's the long-term plan to avoid the discrepancy? Does cargo metadata need to do the same replacement?

@oli-obk
Copy link
Owner

oli-obk commented Mar 28, 2024

We're only processing information that cargo provides to us. So if cargo sends us dashes, we'll report dashes, if cargo sends us underscores we'll report underscores.

@weihanglo
Copy link
Contributor

cargo metadata is a built-in command in Cargo. cargo_metadata is a library parsing that JSON output. If you have questions about cargo metadata please file issues against rust-lang/cargo with detailed use cases and reproduction.

@adpaco-aws
Copy link
Author

Understood, thank you for your comments! I'll close this issue and open another one in rustlang/cargo once I've collected more details about our use-case 😄

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