-
-
Notifications
You must be signed in to change notification settings - Fork 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
Recent minor version upgrade of clap breaks building with a wasm target. #4510
Comments
After fiddling a little bit I can confirm that the offender in 4.0.27 specifically. Everything works as expected on 4.0.26. |
Might be useful to add a wasm build to you CI workflow to avoid accidental bugs like that. |
4.0.27 saw us switch from atty to is-terminal, so that is the root cause. We also do check
This was all done in #4249 and the wams jobs definitely built is-terminal and it worked
So why did this work in CI but not for you? |
That's a fantastic question. Is there any other information I can give you that might be useful? Unfortunately I'm working on a large not-yet-open-source project otherwise I'd zip my build for you. I'm working on a Mac, although I doubt that's related to the problem. |
Seeing the same thing in our project as well. To reproduce:
|
it seems to have picked atty looking at the logs .. ?
EDIT: wasm CI doesn't include color feature which is the feature that brings is-terminal ?
|
Working on rustup default stable -> 1.65.0 w/ associated w32-u-u target installed So granular dep changes here were: root@5d44a4311b14:/matchbox/matchbox_demo# cargo update -p clap
I can replicate it inside rust default docker w/ add rustup target add wasm32-u-u from scratch Immediate work/around seems if one disables the
This prevents feature color (default) being included which brings is-terminal dependency that doesn't work with wasm32-u-u EDIT: Intiially I had a brainfreeze and I had written no-default-features = true which obviously doesn't work ;) This would need some cfg magic I think in order for the cargo not include these crates that don't work in wasm32-u-u It's probably quite involved to cfg default features with: I've also asked @sunfishcode if is-terminal could stub wasm32-u-u: sunfishcode/is-terminal#9 |
clap 4.0.27 breaks WASM clap-rs/clap#4510 Co-authored-by: Johan Klokkhammer Helsing <[email protected]>
If you look in the linked logs, you see that |
Got a reproduction in CI There are two failures
|
@sunfishcode bumped up fix bump applied at #4518 with the CI chore fix from #4515
However testing is borked for Now it complains about $ cargo tree -i os_pipe
https://github.com/clap-rs/clap/actions/runs/3570677150/jobs/6001871085 So progess I guess :) It builds fine though so that is what is essential but testing needs adjustment for wasm32 targets me thinks ? |
Fixes #4510 Note: `terminal_size` is using old version of rustix and this causes a bit dependency duplication. Will check to bump upstream. EDIT: Someone already did - eminence/terminal-size#46 (needs a release)
Please complete the following tasks
Rust Version
rustc 1.67.0-nightly (b3bc6bf31 2022-11-24)
Clap Version
between 4.0.22 and 4.0.27
Minimal reproducible code
Steps to reproduce the bug with the above code
just compile to wasm32-unknown-unknown and it breaks. 4.0.22 works as expected, 4.0.27 does not compile.
Actual Behaviour
Expected Behaviour
Minor version increments should not introduce breaking changes. I'm not sure exactly which version increment causes the issue but it appears to be from the inclusion of errno.
Additional Context
No response
Debug Output
No response
The text was updated successfully, but these errors were encountered: