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

Cannot publish packages that enable features in dependencies (regression) #1334

Closed
hdevalence opened this issue Apr 9, 2018 · 6 comments
Closed

Comments

@hdevalence
Copy link

Hi, I'm trying to publish a crate that contains the following in its Cargo.toml

[features]
nightly = ["radix_51", "subtle/nightly", "clear_on_drop/nightly"]

to enable nightly features in dependencies. However, it's no longer possible to publish this crate to crates.io, since it fails with:

error: api errors: invalid upload request: invalid value: string "subtle/nightly", expected a valid feature name at line 1 column 2315

This appears to be the error generated by this code, and the same Cargo.toml was accepted up until a few days ago, so my guess is that this is a recent regression?

@CvX
Copy link
Contributor

CvX commented Apr 9, 2018

This regression has been introduced in PR #1331:
Feature Deserializer uses Crate::valid_feature_name() which is now Crate::valid_feature().

A quick fix would be to change src/views/krate_publish.rs:124, but I'm wondering if the distinction between Feature and FeatureName is necessary? @sgrif?

@hdevalence
Copy link
Author

Thanks for looking into this! It would be great if it was possible to deploy the fix.

@fafhrd91
Copy link

when fix should be expected? it is not possible to publish packages with re-export features

@sgrif
Copy link
Contributor

sgrif commented Apr 10, 2018

👀

sgrif added a commit to sgrif/crates.io that referenced this issue Apr 10, 2018
@sgrif
Copy link
Contributor

sgrif commented Apr 10, 2018

Sorry for the delay in looking into this. The fix in #1335 is correct. I've added a regression test to #1336, and will get it deployed once it's merged.

I'm wondering if the distinction between Feature and FeatureName is necessary?

It is. A feature is what can appear in foo = { version = "*", features = [...] }. It is between 1 and 2 feature names separated by a slash (technically a crate name followed by a feature name, but that's the same in this case). A feature name is what can appear in [features] as a key. It cannot contain a slash.

It would be great if it was possible to deploy the fix.

I've made sure everyone who can deploy was pinged.

@sgrif
Copy link
Contributor

sgrif commented Apr 10, 2018

The fix for this has been deployed. You should be able to publish your crate now. If you're seeing any more problems, please open a new issue.

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

Successfully merging a pull request may close this issue.

4 participants