Skip to content

v0.2.5 doesn't compile #76

@svenstaro

Description

@svenstaro

I'm getting this:

[:~/src/krunvm] main ❯ cargo build
    Updating crates.io index
  Downloaded anstream v0.6.4
  Downloaded anstyle-parse v0.2.2
  Downloaded autocfg v1.0.1
  Downloaded anstyle v1.0.4
  Downloaded clap v4.4.6
  Downloaded utf8parse v0.2.1
  Downloaded confy v0.4.0
  Downloaded anstyle-query v1.0.0
  Downloaded unicode-xid v0.2.1
  Downloaded text_io v0.1.8
  Downloaded memoffset v0.9.0
  Downloaded strsim v0.10.0
  Downloaded bitflags v2.4.0
  Downloaded cfg-if v0.1.10
  Downloaded dirs-sys v0.3.5
  Downloaded directories v2.0.2
  Downloaded colorchoice v1.0.0
  Downloaded quote v1.0.33
  Downloaded unicode-ident v1.0.12
  Downloaded toml v0.5.8
  Downloaded serde_derive v1.0.124
  Downloaded proc-macro2 v1.0.69
  Downloaded clap_derive v4.4.2
  Downloaded serde v1.0.124
  Downloaded clap_builder v4.4.6
  Downloaded clap_lex v0.5.1
  Downloaded syn v1.0.64
  Downloaded syn v2.0.38
  Downloaded nix v0.27.1
  Downloaded libc v0.2.149
  Downloaded 30 crates (2.2MiB) in 0.17s
   Compiling proc-macro2 v1.0.69
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.149
   Compiling utf8parse v0.2.1
   Compiling serde v1.0.124
   Compiling autocfg v1.0.1
   Compiling colorchoice v1.0.0
   Compiling syn v1.0.64
   Compiling anstyle v1.0.4
   Compiling anstyle-query v1.0.0
   Compiling heck v0.4.1
   Compiling clap_lex v0.5.1
   Compiling strsim v0.10.0
   Compiling cfg-if v0.1.10
   Compiling unicode-xid v0.2.1
   Compiling serde_derive v1.0.124
   Compiling cfg-if v1.0.0
   Compiling krunvm v0.2.5 (/home/svenstaro/src/krunvm)
   Compiling bitflags v2.4.0
   Compiling text_io v0.1.8
   Compiling anstyle-parse v0.2.2
   Compiling memoffset v0.9.0
   Compiling anstream v0.6.4
   Compiling clap_builder v4.4.6
   Compiling quote v1.0.33
   Compiling syn v2.0.38
   Compiling dirs-sys v0.3.5
   Compiling nix v0.27.1
   Compiling directories v2.0.2
   Compiling toml v0.5.8
   Compiling clap_derive v4.4.2
   Compiling confy v0.4.0
   Compiling clap v4.4.6
warning: unused import: `std::env`
 --> src/main.rs:5:5
  |
5 | use std::env;
  |     ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

warning: unused import: `std::ffi::CString`
 --> src/main.rs:6:5
  |
6 | use std::ffi::CString;
  |     ^^^^^^^^^^^^^^^^^

warning: unused import: `std::os::unix::ffi::OsStringExt`
  --> src/main.rs:11:5
   |
11 | use std::os::unix::ffi::OsStringExt;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `nix::unistd::execve`
  --> src/main.rs:17:5
   |
17 | use nix::unistd::execve;
   |     ^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::io::Write`
  --> src/commands/start.rs:10:5
   |
10 | use std::io::Write;
   |     ^^^^^^^^^^^^^^

error[E0599]: no method named `as_raw_fd` found for struct `File` in the current scope
   --> src/commands/start.rs:344:41
    |
344 |     let ret = unsafe { libc::flock(file.as_raw_fd(), libc::LOCK_EX | libc::LOCK_NB) };
    |                                         ^^^^^^^^^
    |
   ::: /home/svenstaro/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/os/fd/raw.rs:69:8
    |
 69 |     fn as_raw_fd(&self) -> RawFd;
    |        --------- the method is available for `File` here
    |
    = help: items from traits can only be used if the trait is in scope
help: trait `AsRawFd` which provides `as_raw_fd` is implemented but not in scope; perhaps you want to import it
    |
  4 + use std::os::fd::AsRawFd;
    |
help: there is a method `as_fd` with a similar name
    |
344 -     let ret = unsafe { libc::flock(file.as_raw_fd(), libc::LOCK_EX | libc::LOCK_NB) };
344 +     let ret = unsafe { libc::flock(file.as_fd(), libc::LOCK_EX | libc::LOCK_NB) };
    |

For more information about this error, try `rustc --explain E0599`.
warning: `krunvm` (bin "krunvm") generated 5 warnings
error: could not compile `krunvm` (bin "krunvm") due to 1 previous error; 5 warnings emitted

Weird that this didn't get caught by CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions