sidkshatriya / rd

rd is a record/replay debugger written in rust
Other
957 stars 14 forks source link

Project does not build with recent Rust nightly #15

Closed jiridanek closed 2 years ago

jiridanek commented 2 years ago

Beta

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:1:1
  |
1 | #![feature(get_mut_unchecked)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:2:1
  |
2 | #![feature(map_first_last)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:3:1
  |
3 | #![feature(llvm_asm)]
  | ^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:4:1
  |
4 | #![feature(raw_ref_op)]
  | ^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:5:1
  |
5 | #![feature(termination_trait_lib)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:6:1
  |
6 | #![feature(associated_type_defaults)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:7:1
  |
7 | #![feature(slice_ptr_get)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:8:1
  |
8 | #![feature(array_methods)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:9:1
  |
9 | #![feature(arc_new_cyclic)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> src/main.rs:10:1
   |
10 | #![feature(format_args_capture)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> src/main.rs:11:1
   |
11 | #![feature(const_fn_trait_bound)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated macro `llvm_asm`: will be removed from the compiler, use asm! instead
    --> src/session/address_space.rs:3225:9
     |
3225 |         llvm_asm!("syscall" :::: "volatile");
     |         ^^^^^^^^
     |
     = note: `#[warn(deprecated)]` on by default

warning: use of deprecated macro `llvm_asm`: will be removed from the compiler, use asm! instead
    --> src/session/address_space.rs:3226:9
     |
3226 |         llvm_asm!("nop" :::: "volatile");
     |         ^^^^^^^^

warning: use of deprecated macro `llvm_asm`: will be removed from the compiler, use asm! instead
    --> src/session/address_space.rs:3227:9
     |
3227 |         llvm_asm!("nop" :::: "volatile");
     |         ^^^^^^^^

warning: use of deprecated macro `llvm_asm`: will be removed from the compiler, use asm! instead
    --> src/session/address_space.rs:3228:9
     |
3228 |         llvm_asm!("nop" :::: "volatile");
     |         ^^^^^^^^

warning: use of deprecated macro `llvm_asm`: will be removed from the compiler, use asm! instead
   --> src/session/task/task_common.rs:800:14
    |
800 |     unsafe { llvm_asm!("lar $1, $0" : "=r"(ar) : "r"(segment)) };
    |              ^^^^^^^^

warning: use of deprecated macro `llvm_asm`: will be removed from the compiler, use asm! instead
   --> src/util.rs:879:9
    |
879 |         llvm_asm!("xgetbv"
    |         ^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
warning: `rd` (bin "rd") generated 6 warnings
error: could not compile `rd` due to 11 previous errors; 6 warnings emitted

Nightly

llvm_asm! was removed from nightly https://github.com/rust-lang/rust/issues/70173

[jdanek@fedora rd]$ cargo build --release
warning: the cargo feature `named-profiles` has been stabilized in the 1.57 release and is no longer necessary to be listed in the manifest
  See https://doc.rust-lang.org/nightly/cargo/reference/profiles.html#custom-profiles for more information about using this feature.
   Compiling rd v0.0.0 (/home/jdanek/repos/rd)
error: cannot find macro `llvm_asm` in this scope
   --> src/session/task/task_common.rs:800:14
    |
800 |     unsafe { llvm_asm!("lar $1, $0" : "=r"(ar) : "r"(segment)) };
    |              ^^^^^^^^

error: cannot find macro `llvm_asm` in this scope
   --> src/util.rs:879:9
    |
879 |         llvm_asm!("xgetbv"
    |         ^^^^^^^^

error: cannot find macro `llvm_asm` in this scope
    --> src/session/address_space.rs:3228:9
     |
3228 |         llvm_asm!("nop" :::: "volatile");
     |         ^^^^^^^^

error: cannot find macro `llvm_asm` in this scope
    --> src/session/address_space.rs:3227:9
     |
3227 |         llvm_asm!("nop" :::: "volatile");
     |         ^^^^^^^^

error: cannot find macro `llvm_asm` in this scope
    --> src/session/address_space.rs:3226:9
     |
3226 |         llvm_asm!("nop" :::: "volatile");
     |         ^^^^^^^^

error: cannot find macro `llvm_asm` in this scope
    --> src/session/address_space.rs:3225:9
     |
3225 |         llvm_asm!("syscall" :::: "volatile");
     |         ^^^^^^^^

error[E0053]: method `report` has an incompatible type for trait
  --> src/commands/exit_result.rs:17:24
   |
17 |     fn report(self) -> i32 {
   |                        ^^^
   |                        |
   |                        expected struct `ExitCode`, found `i32`
   |                        help: change the output type to match the trait: `ExitCode`
   |
   = note: expected fn pointer `fn(ExitResult<_>) -> ExitCode`
              found fn pointer `fn(ExitResult<_>) -> i32`

error[E0308]: mismatched types
  --> src/commands/exit_result.rs:19:34
   |
17 |     fn report(self) -> i32 {
   |                        --- expected `i32` because of return type
18 |         match self {
19 |             ExitResult::Ok(t) => t.report(),
   |                                  ^^^^^^^^^^ expected `i32`, found struct `ExitCode`

Some errors have detailed explanations: E0053, E0308.
For more information about an error, try `rustc --explain E0053`.
error: could not compile `rd` due to 8 previous errors
sidkshatriya commented 2 years ago

Thanks for opening the issue. The rd build is intended to compile in nightly only.

But as as you correctly point out, support for llvm_asm! has been removed. There seem to be a couple of (minor looking) additional compilation errors.

For now you can try to use an older version of nightly ~ early Sep 2021.

I'll try to supply fixes to this soon.