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

Inconsistent definitions for lib.name regarding hyphens #12780

Closed
dvdhrm opened this issue Oct 6, 2023 · 0 comments · Fixed by #12783
Closed

Inconsistent definitions for lib.name regarding hyphens #12780

dvdhrm opened this issue Oct 6, 2023 · 0 comments · Fixed by #12783
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@dvdhrm
Copy link
Contributor

dvdhrm commented Oct 6, 2023

Currently, Cargo refuses values with hyphens or special characters in lib.name, but uses the package-name as default value, if unspecified. The package-name can contain hyphens, though. This leads to inconsistent behavior, where lib.name ends up with special characters, yet Cargo refuses specifying such values directly in the manifest.

Cargo documentation states that the default value is the package-name, but any special characters replaced by underscores. Unfortunately, Cargo never implemented this transformation, thus leading to the inconsistent behavior.

PR #12640 tried to change Cargo to allow any value as lib.name (aligning library targets with all other targets). After discussion, the recommended approach is to instead align Cargo with its documentation and actually transforming the package-name to a valid lib.name.

Related issue: #11259

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant