-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Compilation failure under rust nightly webassembly target #1132
Comments
I agree. I haven't really put any thought into wasm because I can't imagine parsing arguments in the browser, but you're right it'd be nice if it still builds. This would probably be an easy fix, and if anyone wants to add a non-default cargo feature |
I think the clap use case for the wasm target would be consuming it from Node.js. I guess in theory you could build a CLI entirely in Rust then ship it to npm. |
@kbknapp I'm interested in taking this one on if no one else has started |
That would be great! Thanks @stevepentland |
@kbknapp I need to ask about what you meant with a non-default wasm cargo feature? I've been looking through the code at how to reconcile the changes and could use a little insight from you. |
By non-default I just meant a cargo feature that it's not included in the default features array (and thus opt-in instead of opt-out). However, I now think there are better ways to solve this. A better solution would be to add some additional OsStrExt traits inside Actually...now that I think about it, maybe just reusing the OsStrExt3 that Windows uses would work too? That just require changing the cfg statements...hmm I'd try that out first. So in order of things I'd try:
|
Alright sounds good, I’ll start there and see how it goes. Thanks! |
Closed with #1190 thanks to @stevepentland 🎉 |
Getting this error with Drops-of-Diamond/diamond_drops#59 with Clap 2.31.2. |
Rust Version
Affected Version of clap
Rust now has a webassembly target, trying to use it in a project that depends on
clap
results in a build failure:It might be impossible to actually use clap for anything with the wasm backend right now, but it would be nice if it still managed to build.
The text was updated successfully, but these errors were encountered: