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

fails to build using wasmtime #6

Open
jtmoon79 opened this issue Mar 20, 2024 · 2 comments
Open

fails to build using wasmtime #6

jtmoon79 opened this issue Mar 20, 2024 · 2 comments

Comments

@jtmoon79
Copy link

jtmoon79 commented Mar 20, 2024

filepath fails to build using wasmtime. This means rust target wasm32-wasi cannot be built.

error[E0046]: not all trait items implemented, missing: `path`
  --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/filepath-0.1.2/src/lib.rs:67:1
   |
64 |     fn path(&self) -> io::Result<PathBuf>;
   |     -------------------------------------- `path` from trait
...
67 | impl FilePath for File {
   | ^^^^^^^^^^^^^^^^^^^^^^ missing `path` in implementation

For more information about this error, try `rustc --explain E0046`.
error: could not compile `filepath` due to previous error

Reproduction

  1. recreate an Ubuntu 22 environment in docker
    docker -it ubuntu:22.04 bash
    
  2. install stuff
    apt update
    apt install curl wget gcc unzip xz-utils xzip
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    . ~/.cargo/env
    rustup toolchain install 1.67.1
    rustup target add wasm32-wasi
    cargo install cargo-wasi
    curl https://wasmtime.dev/install.sh -sSf | bash
    . ~/.bashrc
    wget https://github.com/evilpie/filepath/archive/refs/heads/master.zip
    unzip master.zip
    cd filepath-master
    cargo wasi test --color=always -- --color=always
    
    installed wasmtime-v18.0.3-x86_64-linux.tar.xz
    using filepath at commit a0138f0
  3. result
    $ cargo wasi test --color=always -- --color=always
    info: downloading component 'rust-std' for 'wasm32-wasi'
    info: installing component 'rust-std' for 'wasm32-wasi'
        Updating crates.io index
       Compiling filepath v0.1.2 (/filepath-master)
    error[E0046]: not all trait items implemented, missing: `path`
      --> src/lib.rs:67:1
       |
    64 |     fn path(&self) -> io::Result<PathBuf>;
       |     -------------------------------------- `path` from trait
    ...
    67 | impl FilePath for File {
       | ^^^^^^^^^^^^^^^^^^^^^^ missing `path` in implementation
    
    For more information about this error, try `rustc --explain E0046`.
    error: could not compile `filepath` (lib) due to 1 previous error
    warning: build failed, waiting for other jobs to finish...
    error: could not compile `filepath` (lib test) due to 1 previous error
    
jtmoon79 added a commit to jtmoon79/super-speedy-syslog-searcher that referenced this issue Mar 20, 2024
More cross targets can be built now that uapi is removed.

Issue #171

However, target wasm32-wasi fails to build, see
evilpie/filepath#6
@evilpie
Copy link
Owner

evilpie commented Mar 20, 2024

Would this be possible to implement for wasmtime? Should we just return an error for missing implementations? (I personally think a build failure is more obvious)

@jtmoon79
Copy link
Author

jtmoon79 commented Apr 6, 2024

Would this be possible to implement for wasmtime?

I think you're saying "does WASM have a concept of filepaths?". And uhh... I don't know. I skimmed the wikipedia page but I'm still not sure. Did I understand your question?

Should we just return an error for missing implementations? (I personally think a build failure is more obvious)

Good point. Yeah, it's better to just fail up front instead of later on. Having said that, I think this Issue can be closed.

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

No branches or pull requests

2 participants