-
Notifications
You must be signed in to change notification settings - Fork 45
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
Unable to compile to WASM with version 0.15.1 #472
Comments
Hi Louis, That's strange: the dependencies haven't change in the 0.15.1 version. I can also see that my own demo works fine with the latest commit: https://mgeisler.github.io/textwrap/. The WASM demo in Textwrap uses a To double-check, I just tried to reproduce this with a [dependencies]
textwrap = "0.15" This seems to work fine:
What command do you use and what error do you see? |
Spooky! Here's what it looks like in my project:
Is there anything I can do to help debug? |
The
output makes me think that the problem is in To double-check, you can also specify a strict [dependencies]
textwrap = "=0.15" The |
Sorry, I accidentally skipped errno in my original post. Here's the tree
It successfully compiles if |
Hi. For me, I failed with unicode-linebreak v0.1.3 of textwrap v0.15.1.
|
Nevermind, my problem was rust version <=1.58. |
Thanks @namse, I now see the same build error in the weekly build. The problem is that unicode-linebreak now requires Rust 1.59 because of the use of The new code was added in axelf4/unicode-linebreak@4f916fa. |
Rust 1.56 is the first version with support for the 2021 edition. Maintaining support for this version gives people an easy target when determining the oldest compiler they can use. Textwrap tries to stay compatible with the same Rust version, and this is where I first saw that the RSRV had increased to 1.59[1]. [1]: mgeisler/textwrap#472
I've now created axelf4/unicode-linebreak#4 to see if we can easily restore compatibility with Rust 1.56 and fix the problem @namse noticed. |
Thanks for this part, that's very useful! I now finally understand what's going on: Textwrap 0.15.1 updated the dependency on terminal_size to the latest version, and this version pulls in errno. That happened in #461. Now, terminal_size is an optional dependency, meaning that you should only see the transitive errno dependency if you specify your Textwrap dependency as [dependencies]
textwrap = { version = "=0.15.1", features = ["terminal_size"] } Can you double-check the features enabled for Textwrap to check that you don't enable |
glad to help you :) |
Hi @mgeisler The dep is specified like so: textwrap = { version = "=0.15.1", default_features = false, features = [] } |
Rust 1.56 is the first version with support for the 2021 edition. Maintaining support for this version gives people an easy target when determining the oldest compiler they can use. Textwrap tries to stay compatible with the same Rust version, and this is where I first saw that the MSRV had increased to 1.59 [1]. [1]: mgeisler/textwrap#472
Okay, that should not be able to pull in the |
Yes, I have. I've also tried it when just specifying the version. |
Hi @lpil, have you managed to make this work or do you have new information? Just to recap, I cannot reproduce this in my CI (please see this build for an example) or on my laptop. However, if I apply this patch: modified examples/wasm/Cargo.toml
@@ -12,7 +12,7 @@ publish = false # This project should not be uploaded to crates.io
crate-type = ["cdylib", "rlib"]
[dependencies]
-textwrap = { path = "../../" }
+textwrap = { path = "../../", features = ["terminal_size"] }
console_error_panic_hook = "0.1.7"
js-sys = "0.3.57" to the
and I do get a compilation error from
This is with
|
Hi @lpil, did you ever manage to find out what the problem is? Something seems to be enabling the |
I did not unfortunately, I've pinned to an older version and not dug into this since. |
Strange, but thanks for confirming. |
Hello! I've just upgraded to 0.15.1 and can no longer compile this to WASM.
This versions pulls in terminal_size 0.2.1, which pulls in rustix, which pulls in linux-raw-sys, which does not compile on wasm.
I see the dep is marked as optional in textwrap's Cargo.toml, but I couldn't work out how to stop it from being included. I have this in my Cargo.toml:
How can I resolve this?
Thanks,
Louis
The text was updated successfully, but these errors were encountered: