chyyuu / os_kernel_lab

OS kernel labs based on Rust/C Lang & RISC-V 64/X86-32
https://rcore-os.github.io/rCore-Tutorial-Book-v3/index.html
GNU General Public License v3.0
3.96k stars 1.92k forks source link

make failed #92

Open linchengcs opened 3 years ago

linchengcs commented 3 years ago

This is the output of make


make[1]: Entering directory '/home/lin/workspace/clone/os_kernel_lab/user'
Installing rcore-fs-fuse
    Updating git repository `https://github.com/rcore-os/rcore-fs`
  Installing rcore-fs-fuse v0.1.0 (https://github.com/rcore-os/rcore-fs#6df6cd24)
    Updating crates.io index
   Compiling libc v0.2.101
   Compiling log v0.4.14
   Compiling winapi-build v0.1.1
   Compiling proc-macro2 v1.0.29
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v0.4.30
   Compiling unicode-xid v0.2.2
   Compiling unicode-xid v0.1.0
   Compiling winapi v0.2.8
   Compiling syn v1.0.75
   Compiling syn v0.15.44
   Compiling proc-macro-hack v0.5.19
   Compiling spin v0.5.2
   Compiling unicode-width v0.1.8
   Compiling unicode-segmentation v1.8.0
   Compiling either v1.6.1
   Compiling radium v0.3.0
   Compiling utf8-ranges v0.1.3
   Compiling ansi_term v0.11.0
   Compiling static_assertions v0.3.4
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.2
   Compiling bitflags v1.3.2
   Compiling regex-syntax v0.3.9
   Compiling textwrap v0.11.0
   Compiling bitvec v0.17.4
   Compiling kernel32-sys v0.2.2
   Compiling heck v0.3.3
   Compiling log v0.3.9
   Compiling quote v0.6.13
   Compiling quote v1.0.9
   Compiling thread-id v2.0.0
   Compiling rcore-fs v0.1.0 (/home/lin/.cargo/git/checkouts/rcore-fs-7fdf258332f6146d/6df6cd2/rcore-fs)
   Compiling memchr v0.1.11
   Compiling atty v0.2.14
   Compiling time v0.1.44
   Compiling thread_local v0.2.7
   Compiling aho-corasick v0.5.3
   Compiling clap v2.33.3
   Compiling rcore-fs-sfs v0.1.0 (/home/lin/.cargo/git/checkouts/rcore-fs-7fdf258332f6146d/6df6cd2/rcore-fs-sfs)
   Compiling rcore-fs-ramfs v0.1.0 (/home/lin/.cargo/git/checkouts/rcore-fs-7fdf258332f6146d/6df6cd2/rcore-fs-ramfs)
error[E0658]: `if` is not allowed in a `const fn`
  --> /home/lin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.33.3/src/app/settings.rs:7:1
   |
7  | / bitflags! {
8  | |     struct Flags: u64 {
9  | |         const SC_NEGATE_REQS       = 1;
10 | |         const SC_REQUIRED          = 1 << 1;
...  |
51 | |     }
52 | | }
   | |_^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: `if` is not allowed in a `const fn`
  --> /home/lin/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.33.3/src/args/settings.rs:6:1
   |
6  | / bitflags! {
7  | |     struct Flags: u32 {
8  | |         const REQUIRED         = 1;
9  | |         const MULTIPLE         = 1 << 1;
...  |
28 | |     }
29 | | }
   | |_^
   |
   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

   Compiling rcore-fs-sefs v0.1.0 (/home/lin/.cargo/git/checkouts/rcore-fs-7fdf258332f6146d/6df6cd2/rcore-fs-sefs)
   Compiling regex v0.1.80
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `clap`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `rcore-fs-fuse v0.1.0 (https://github.com/rcore-os/rcore-fs#6df6cd24)`, intermediate artifacts can be found at `/tmp/cargo-installAwAzA7`

Caused by:
  build failed
make[1]: *** [Makefile:23: dependency] Error 101
make[1]: Leaving directory '/home/lin/workspace/clone/os_kernel_lab/user'
make: *** [Makefile:2: run] Error 2
leo-frank commented 3 years ago

I meet the same problem when use following command to "Compiling clap v2.33.3" image

It seems related to rustc version

The version I used as below, image