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

wasmi_wasi cannot be built on Windows on Rust nightly #564

Closed
Berrysoft opened this issue Nov 17, 2022 · 13 comments · Fixed by #568
Closed

wasmi_wasi cannot be built on Windows on Rust nightly #564

Berrysoft opened this issue Nov 17, 2022 · 13 comments · Fixed by #568

Comments

@Berrysoft
Copy link
Contributor

Thanks for #563 solving the problem, but a degraded wiggle introduces an old cap-primitives, which introduces more problems:

error[E0277]: the trait bound `file_type::FileType: std::sealed::Sealed` is not satisfied                                                                                                 
   --> C:\Users\Straw\.cargo\registry\src\github.jparrowsec.cn-1ecc6299db9ec823\cap-primitives-0.25.3\src\fs\file_type.rs:134:6
    |
134 | impl std::os::windows::fs::FileTypeExt for FileType {
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::sealed::Sealed` is not implemented for `file_type::FileType`
    |
    = help: the following other types implement trait `std::sealed::Sealed`:
              Child
              Command
              ExitCode
              ExitStatus
              ExitStatusError
              File
              OsStr
              OsString
            and 11 others
note: required by a bound in `std::os::windows::fs::FileTypeExt`
   --> D:\Straw\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\windows\fs.rs:507:24
    |
507 | pub trait FileTypeExt: Sealed {
    |                        ^^^^^^ required by this bound in `std::os::windows::fs::FileTypeExt`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `cap-primitives` due to previous error
@Robbepop
Copy link
Member

Robbepop commented Nov 17, 2022

This WASI support is slowly turning into a can of worms ... 🙃

Thanks for your bug report though!

@Robbepop
Copy link
Member

Robbepop commented Nov 17, 2022

Can you give instructions on how to replicate this? I am a bit confused since our GitHub Actions CI did not report this Windows build issue even though we test our workspace on Linux, MacOS and Windows. So this bug should have been caught by the CI but it wasn't.

@Berrysoft
Copy link
Contributor Author

It seems like a change on rust 1.65.

rust-lang/rust@a4cb0b9

The FileTypeExt is marked as Sealed to make 3rd-party types cannot impl it.

@Robbepop
Copy link
Member

Thanks for the info. Still strange, I was under the impression that our CI was using the current stable versions of Rust which should be 1.65 at the moment.

@Berrysoft
Copy link
Contributor Author

Well, currently I'm using nightly, but as the commit is marked as 1.65, I think the stable should report the same error...

@Robbepop
Copy link
Member

Robbepop commented Nov 17, 2022

Ah look what I found:

Windows (Sealed): https://doc.rust-lang.org/std/os/windows/fs/trait.FileTypeExt.html
WASI (not Sealed): https://doc.rust-lang.org/std/os/wasi/fs/trait.FileTypeExt.html

So maybe you need to compile for WASI target which makes sense imo.
I have yet to understand all of this mess though ...

@Robbepop
Copy link
Member

Well, currently I'm using nightly, but as the commit is marked as 1.65, I think the stable should report the same error...

Can you try using stable and see if the problem still persists?

@Berrysoft
Copy link
Contributor Author

So maybe you need to compile for WASI target which makes sense imo.

Well as far as I know, the runtime itself (including wasmi_wasi) should target the host platform...right?

@Berrysoft
Copy link
Contributor Author

Can you try using stable and see if the problem still persists?

I see. The stable toolchain compiles with no error. Maybe it is still a nightly-specific issue.

@Robbepop
Copy link
Member

I see. The stable toolchain compiles with no error. Maybe it is still a nightly-specific issue.

This is kind of a relieve to me since we are mainly supporting stable Rust but it is an alarming signal to me whenever nightly Rust no longer builds properly.

@Robbepop
Copy link
Member

Robbepop commented Nov 17, 2022

I think the best solution is to fix the issue in the cap-primitives crate and then release a wiggle and wasi-common version 1.0.0 path release. Would you be up to post a bug report there so we can initiate this?

And maybe the Wasmtime team knows betters way to fix your issue with nightly Rust.

@Berrysoft
Copy link
Contributor Author

Berrysoft commented Nov 17, 2022

This issue has been solved in cap-primitives 1.0, but wiggle 1.0 depends on cap-primitive 0.25. Now the Wasmtime team is developing wiggle 2.x, and I don't think they will fix this issue for 1.0 releases.

@Robbepop
Copy link
Member

Robbepop commented Nov 17, 2022

This issue has been solved in cap-primitives 1.0, but wiggle 1.0 depends on cap-primitive 0.25. Now the Wasmtime team is developing wiggle 2.x, and I don't think they will fix this issue for 1.0 releases.

One could still ask nicely. 😊

@Robbepop Robbepop changed the title wasmi_wasi cannot be built on Windows wasmi_wasi cannot be built on Windows on Rust nightly Nov 17, 2022
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 a pull request may close this issue.

2 participants