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

Unresolved: Feature syntax #4

Open
Manishearth opened this issue Oct 15, 2020 · 5 comments
Open

Unresolved: Feature syntax #4

Manishearth opened this issue Oct 15, 2020 · 5 comments

Comments

@Manishearth
Copy link
Owner

Features can be specified as crate/feature, which makes foo/bar ambiguous with "feature bar of crate foo" and "optional crate `foo/bar".

We need a way to resolve ambiguity in the feature syntax

@Manishearth
Copy link
Owner Author

My proposal is that foo/bar is always "feature bar of crate foo" (and it will provide a helpful error message when foo/bar exists but foo does not), and if you want to enable a namespaced crate, you use foo/bar/

@Manishearth
Copy link
Owner Author

This doesn't quite fix the situation where you have foo/bar/baz which can either be foo/bar feature baz or foo feature bar/baz. This seems rare in practice, we can just pick one (foo/bar feature baz IMO since foo/bar AND bar/baz existing in the same deptree seems unlikely) and if you want the other one you explicitly define a feature. Alternatively we require an extra slash, i.e. foo/bar//baz

@pksunkara
Copy link

pksunkara commented Oct 28, 2020

Continuing from this comment:

With the proposal of separator being :, there will no more disambiguates:

  • crate bar in namespace foo: foo:bar
  • bar feature of crate foo: foo/bar
  • baz feature of crate bar in namespace foo: foo:bar/baz
  • bar/baz feature of crate foo: foo/bar/baz

@Manishearth
Copy link
Owner Author

@pksunkara
Copy link

Not a big blocker, we can make it ::

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants