Skip to content

wasm-tools, wit-parser: add --all-features to enable all features gated with @unstable#1599

Merged
alexcrichton merged 8 commits intobytecodealliance:mainfrom
ydnar:ydnar/all-features
Jun 10, 2024
Merged

wasm-tools, wit-parser: add --all-features to enable all features gated with @unstable#1599
alexcrichton merged 8 commits intobytecodealliance:mainfrom
ydnar:ydnar/all-features

Conversation

@ydnar
Copy link
Contributor

@ydnar ydnar commented Jun 9, 2024

This PR adds the --all-features option to wasm-tools component, primarily so wasm-tools component wit -j can emit a JSON representation of the original WIT with all @unstable gated features intact.

It additionally adds support for --features . as an alias for --all-features.

Originally proposed here: https://bytecodealliance.zulipchat.com/#narrow/stream/327223-wit-bindgen/topic/wit-parser.20crate.3A.20JSON.20format.20changes/near/443516048

@ydnar ydnar force-pushed the ydnar/all-features branch from 77a5653 to e0f61f9 Compare June 9, 2024 22:56
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Mind also adding a test along the lines of this one? (no need to be so exhaustive, but it'd be good to have at least one test for the flags)

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you elaborate on why to support --features . though? I've not personally seen precedent for something like that and it feels a bit odd to me that . means "everything". I'd personally be in favor of just sticking with --all-features myself.

@ydnar
Copy link
Contributor Author

ydnar commented Jun 10, 2024

Thanks! Can you elaborate on why to support --features . though? I've not personally seen precedent for something like that and it feels a bit odd to me that . means "everything". I'd personally be in favor of just sticking with --all-features myself.

. for everything mimics regexp syntax, and Go uses . to mean "all" in a number of contexts in its CLI.

Happy to revert this if that’s what gets it done.

@alexcrichton
Copy link
Member

That's true about regexes, although I'd expect .* to match all features as opposed to just . for regexes. Would you be ok dropping --features . and just keeping --all-features?

@alexcrichton alexcrichton added this pull request to the merge queue Jun 10, 2024
Merged via the queue into bytecodealliance:main with commit 10d2e21 Jun 10, 2024
@ydnar ydnar deleted the ydnar/all-features branch June 10, 2024 21:37
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 this pull request may close these issues.

2 participants