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

Incorect target OS handling #408

Open
drgkaleda opened this issue Jan 18, 2024 · 0 comments
Open

Incorect target OS handling #408

drgkaleda opened this issue Jan 18, 2024 · 0 comments

Comments

@drgkaleda
Copy link

TL;DR;:

  • Target OS: ArchLinux on x86-64.
  • Problem: marine uses unix target.
  • Expected behaviour: use linux target.

Problem description

I am using kademlia-dht (https://crates.io/crates/kademlia-dht) in my project. But when I'm trying to deploy my project localy with

fluence service repl myService

I get an error:

# Making sure service and modules are downloaded and built...
   Compiling dirs v1.0.5
error[E0433]: failed to resolve: could not find `unix` in `os`
  --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dirs-1.0.5/src/lin.rs:41:18
   |
41 |     use std::os::unix::ffi::OsStringExt;
   |                  ^^^^ could not find `unix` in `os`

error[E0432]: unresolved import `unix`
  --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dirs-1.0.5/src/lin.rs:6:5
   |
6  | use unix;
   |     ^^^^ no `unix` in the root
   |
note: found an item that was configured out
  --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dirs-1.0.5/src/lib.rs:22:87
   |
22 | #[cfg(unix)]                                                                      mod unix;
   |                                                                                       ^^^^

error[E0599]: no function or associated item named `from_vec` found for struct `OsString` in the current scope
  --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dirs-1.0.5/src/lin.rs:48:34
   |
48 |     Some(PathBuf::from(OsString::from_vec(out)))
   |                                  ^^^^^^^^ function or associated item not found in `OsString`
   |
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
   |
1  + use std::os::wasi::ffi::OsStringExt;
   |

Some errors have detailed explanations: E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `dirs` (lib) due to 3 previous errors
Error: failed to execute, exited with exit status: 101

Building the same code without marine (cargo build in service directory) works without problem.
Getting rid of kademlia-dht crate (commenting it out) solves the problem with marine cross-compiler.

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

1 participant