microsoft / mu_devops

Project Mu Developer Operations
https://microsoft.github.io/mu/
Other
27 stars 25 forks source link

RustSetupSteps.yml: Update to latest cargo_tarpaulin 31.2 and Rust Toolchain #363

Closed antklein closed 2 months ago

antklein commented 2 months ago

Update to the latest version of cargo_tarpaulin, release 31.2. This change is required to allow tarpaulin to function with Rust toolchain 1.80. Running tarpaulin 27.3 with toolchain 1.80 results in the tool failing with a "Parse error".

antklein commented 2 months ago

@makubacki and @apop5 Can I get your help reviewing this change?

apop5 commented 2 months ago

@antklein If you make these changes locally, does the build succeed? I'm worried there will be other cascading changes needed similar to the tool chain update needing this.

antklein commented 2 months ago

@antklein If you make these changes locally, does the build succeed? I'm worried there will be other cascading changes needed similar to the tool chain update needing this.

I validated locally for my internal project. Is there a specific repo you want me to test this with? In the mean time, I'll test the same repos I tested before for the toolchain update.

makubacki commented 2 months ago

I validated locally for my internal project. Is there a specific repo you want me to test this with? In the mean time, I'll test the same repos I tested before for the toolchain update.

Please run each command in Makefile.toml at least once in one of the repos it is synced to.

antklein commented 2 months ago

I validated locally for my internal project. Is there a specific repo you want me to test this with? In the mean time, I'll test the same repos I tested before for the toolchain update.

Please run each command in Makefile.toml at least once in one of the repos it is synced to.

I ran the commands for all of the of the repos that sync from mu_devops. I found no issues with running cargo_tarpaulin, however a few of the repositories tests are failing which caused 'coverage' to fail.

makubacki commented 2 months ago

I ran the commands for all of the of the repos that sync from mu_devops. I found no issues with running cargo_tarpaulin, however a few of the repositories tests are failing which caused 'coverage' to fail.

Failing because of a dependency changing like the compiler version or a crate update?

antklein commented 2 months ago

I ran the commands for all of the of the repos that sync from mu_devops. I found no issues with running cargo_tarpaulin, however a few of the repositories tests are failing which caused 'coverage' to fail.

Failing because of a dependency changing like the compiler version or a crate update?

For example, mu_rs top of tree I am seeing these failures. This is with toolchain 1.76 and tarpaulin 27.3.

cargo make clippy:

   --> mu_macro\src\lib.rs:126:5
    |
126 |     use proc_macro2;
    |     ^^^^^^^^^^^^^^^^ help: remove it entirely
    |

error: could not compile `mu_macro` (lib test) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
[cargo-make] ERROR - Error while executing command, exit code: 101

cargo make coverage:

2024-08-27T18:06:40.672365Z ERROR cargo_tarpaulin: Test failed during run
Error: "Test failed during run"
[cargo-make] ERROR - Error while executing command, exit code: 1
[cargo-make] WARN - Build Failed.

But the coverage check might be failing because of differences in how cargo test and cargo make test work. On my local system. cargo make test passes, but cargo test fails.

cargo test failure:

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> mu_core\src\lib.rs:168:1
    |
168 | #![feature(macro_metavar_expr)]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
error: could not compile `mu_core` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `mu_core` (lib test) due to 1 previous error
antklein commented 2 months ago

Here are the errors I get from tip of main in mu_tiano_platforms.

cargo make clippy:

error: `#[panic_handler]` function required, but not found                                                                                                                                               

error: language item required, but not found: `eh_personality`
  |
  = note: this can occur when a binary crate with `#![no_std]` is compiled for a target where `eh_personality` is defined in the standard library
  = help: you may be able to compile for a target that doesn't need `eh_personality`, specify a target with `--target` or in `.cargo/config`

error: could not compile `HelloWorldRustDxe` (bin "HelloWorldRustDxe") due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
[cargo-make] ERROR - Error while executing command, exit code: 101
[cargo-make] WARN - Build Failed.
apop5 commented 2 months ago

@antklein Are you comfortable with this going in now?

antklein commented 2 months ago

@antklein Are you comfortable with this going in now?

@apop5, yes please merge this change when you are able to.