rust-errno icon indicating copy to clipboard operation
rust-errno copied to clipboard

error[E0583]: file not found for module sys

Open istommao opened this issue 1 year ago • 17 comments

error[E0583]: file not found for module sys

cargo 1.73.0-nightly (7e9de3f4e 2023-08-13) rustc 1.73.0-nightly (https://github.com/rust-lang/rust/commit/180dffba142c47240ca0d93096ce90b9fd97c8d7 2023-08-14) image

istommao avatar Aug 15 '23 02:08 istommao

which OS are you compiling for?

kadiwa4 avatar Aug 15 '23 10:08 kadiwa4

which OS are you compiling for?

LInux @kadiwa4

istommao avatar Aug 15 '23 11:08 istommao

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.

lambda-fairy avatar Aug 15 '23 11:08 lambda-fairy

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

feat/hotstuff branch

istommao avatar Aug 15 '23 12:08 istommao

I can reproduce this on windows.

Saratii avatar Sep 01 '23 18:09 Saratii

Can reproduce it on macOS Sonoma

Satchitananda avatar Nov 05 '23 14:11 Satchitananda

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

marija-mijailovic avatar Feb 08 '24 16:02 marija-mijailovic

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.

sunfishcode avatar Feb 08 '24 16:02 sunfishcode

Any suggested fix or workaround for this issue ?

mikkypactreon avatar Feb 11 '24 07:02 mikkypactreon

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?

sunfishcode avatar Feb 12 '24 18:02 sunfishcode

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

Afetzner avatar Mar 03 '24 21:03 Afetzner

@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.

kleinesfilmroellchen avatar May 10 '24 10:05 kleinesfilmroellchen

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

manish02-code avatar Jul 05 '24 07:07 manish02-code

I'm running into this too ..

connorcarpenter avatar Jul 10 '24 23:07 connorcarpenter

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

anyon17 avatar Sep 07 '24 06:09 anyon17

Try to clean your project and re-build it

manish02-code avatar Sep 07 '24 07:09 manish02-code

Can you share your git repo

manish02-code avatar Sep 07 '24 07:09 manish02-code