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

Tracking issue for restricted feature name syntax. #8813

Closed
ehuss opened this issue Oct 27, 2020 · 3 comments · Fixed by #12291
Closed

Tracking issue for restricted feature name syntax. #8813

ehuss opened this issue Oct 27, 2020 · 3 comments · Fixed by #12291
Assignees
Labels
A-features Area: features — conditional compilation C-tracking-issue Category: A tracking issue for something unstable. S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing. S-waiting-on-feedback Status: An implemented feature is waiting on community feedback for bugs or design concerns.

Comments

@ehuss
Copy link
Contributor

ehuss commented Oct 27, 2020

This issue is for tracking a backwards-incompatible change to add new restrictions to the syntax of a feature name.

Historically, Cargo has been extremely permissive for feature names, allowing them to be any string as long as it isn't empty. crates.io has imposed its own limitations on feature names, specifically all characters must be is_ascii_alphanumeric, -, _, or +.

We would like to introduce new syntax to the feature system to introduce new capabilities. For example, prefixes such as dep:, or the ? character for weakly enabling features. However, this extended syntax may conflict with existing feature names if a project is using punctuation or other symbols in their feature names.

The new feature name restrictions are:

This is being initially implemented as a warning with the intent to make it an error sometime in the future.

We do not expect this to be a problem for projects, since crates.io already imposes strict requirements on the feature name syntax. However, for projects that aren't published to crates.io, it may be possible that they will conflict with the new restrictions.

If your project has encountered the new warning, please leave a comment explaining which characters you are using with an example, and an indication if it would be difficult or possible for you to transition to the more restrictive syntax.

@ehuss ehuss added A-features Area: features — conditional compilation C-tracking-issue Category: A tracking issue for something unstable. labels Oct 27, 2020
@repnop
Copy link

repnop commented Nov 22, 2020

Hi! I just noticed my terminal filled with these warnings while building my OS kernel project, and I use . in them as a feature namespace separator, e.g. pmalloc.allocator.bitmap which enables a bitmap allocator for part of the kernel, and none of the accepted characters really have that same kind of meaning associated with them or look awkward.

@ehuss
Copy link
Contributor Author

ehuss commented Dec 2, 2020

@repnop I have posted #8932 to allow . in feature names.

bors added a commit that referenced this issue Dec 2, 2020
Add period to allowed feature name characters.

Relaxes the warning to allow `.` in feature names, requested via #8813 (comment)
@ehuss ehuss self-assigned this Jan 6, 2022
@bors bors closed this as completed in e77c071 Jan 12, 2022
@ehuss
Copy link
Contributor Author

ehuss commented Feb 2, 2022

This was closed inadvertently.

@ehuss ehuss reopened this Feb 2, 2022
@ehuss ehuss added S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing. S-waiting-on-feedback Status: An implemented feature is waiting on community feedback for bugs or design concerns. labels Apr 25, 2023
@bors bors closed this as completed in dead4b8 Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-features Area: features — conditional compilation C-tracking-issue Category: A tracking issue for something unstable. S-needs-mentor Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing. S-waiting-on-feedback Status: An implemented feature is waiting on community feedback for bugs or design concerns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants