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

error[E0583]: file not found for module sys #76

Open
istommao opened this issue Aug 15, 2023 · 18 comments
Open

error[E0583]: file not found for module sys #76

istommao opened this issue Aug 15, 2023 · 18 comments

Comments

@istommao
Copy link

istommao commented Aug 15, 2023

error[E0583]: file not found for module sys

cargo 1.73.0-nightly (7e9de3f4e 2023-08-13)
rustc 1.73.0-nightly (rust-lang/rust@180dffb 2023-08-14)
image

@kadiwa4
Copy link

kadiwa4 commented Aug 15, 2023

which OS are you compiling for?

@istommao
Copy link
Author

istommao commented Aug 15, 2023

which OS are you compiling for?

LInux @kadiwa4

@lambda-fairy
Copy link
Owner

Linux + Rust nightly is tested in CI. If you want to report an issue with that combination then you'll need to give more info.

@istommao
Copy link
Author

istommao commented Aug 15, 2023

substrate node template project, cargo build then report this issue
https://github.com/Generative-Labs/Substrate-HotStuff

feat/hotstuff branch

@Saratii
Copy link

Saratii commented Sep 1, 2023

I can reproduce this on windows.

@Satchitananda
Copy link

Can reproduce it on macOS Sonoma

@marija-mijailovic
Copy link

Is there some update about this one? I can reproduce it on macOS Monterey(rustc 1.74.0-nightly)

@sunfishcode
Copy link
Collaborator

The code in question looks like this:

#[cfg_attr(unix, path = "unix.rs")]
#[cfg_attr(windows, path = "windows.rs")]
#[cfg_attr(target_os = "wasi", path = "wasi.rs")]
#[cfg_attr(target_os = "hermit", path = "hermit.rs")]
mod sys;

As far as I'm aware, Rust always considers macOS to be a unix target, so it should always use the unix path. The repo has a unix.rs file, so that should always be there. I don't have any guesses as to which of those assumptions might be false.

@mikkypactreon
Copy link

Any suggested fix or workaround for this issue ?

@sunfishcode
Copy link
Collaborator

Could anyone who can reproduce this, please post:

  • What is the full cargo command line you're using?
  • Do you have anything interesting in your ~/.cargo/config.toml
  • Is there a .cargo/config.toml in the source tree you're building and does it contain anything interesting?
  • What is the full output of the cargo command?
  • You you know of anything out of the ordinary about your environment, source tree, or anything else which might be involved?

@Afetzner
Copy link

Afetzner commented Mar 3, 2024

I also ran into this issue, but I was trying to target wasm64-unknown-unknown for use with wasm-pack. Since "unknown" does not match unix, windows, wasi, nor hermit, none of the configurations matched and resolved to just the line "mod sys;" without a path. I stopped using wasm-pack and just built instead with build --target wasm32-wasi. I'm still having issues, but I'm confident that's to do with my toolchain. TL;DR double check what your targeting

@kleinesfilmroellchen
Copy link

@sunfishcode errno is currently always broken on wasm*-unknown-unknown targets, and I (and others) depend on it through multiple indirections, such as clap or miette. I hope this gets fixed soon.

@manish02-code
Copy link

I am also facing the same errors did anyone fix it
Screenshot 2024-07-05 124645

@connorcarpenter
Copy link

I'm running into this too ..

@anyon17
Copy link

anyon17 commented Sep 7, 2024

Any resolution to this ? I am building my rust project and this library I believe is a dependency and my target wasm32-unknown-unknown build is failing with the same errors.
Command to build: cargo build --target wasm32-unknown-unknown --release

@manish02-code
Copy link

Try to clean your project and re-build it

@manish02-code
Copy link

Can you share your git repo

@carlosdp
Copy link

carlosdp commented Nov 13, 2024

For anyone else running into this: check if you are using async-io on major version 1 in your project somewhere, or something else that depends on rustix ^0.37, because below 0.38, rustix doesn't support wasm-unknown-unknown (because it always uses errno), but 0.38+ fixes this.

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