tianocore / edk2-pytool-extensions

Extensions to the edk2 build system allowing for a more robust and plugin based build system and tool execution environment
Other
60 stars 40 forks source link

[Bug]: Better recognize cargo/cargo-make errors #658

Closed makubacki closed 1 year ago

makubacki commented 1 year ago

Contact Details

No response

Describe the Bug

We recently encountered an issue where cargo make errors did not get noticed for a while because the build continued.

For example:

  [cargo-make] Execute Command: "cargo" "tarpaulin" "-p" \
    "HelloWorldRustDxe,RustBootServicesAllocatorDxe"

  cargo_tarpaulin::config: Creating config
  cargo_tarpaulin: Running Tarpaulin
  cargo_tarpaulin: Building project
  cargo_tarpaulin::cargo: Cleaning project
  error: invalid character `,` in pkgid:
    `HelloWorldRustDxe,RustBootServicesAllocatorDxe`, characters must
    be Unicode XID characters (numbers, `-`, `_`, or most letters)
  cargo_tarpaulin: Cargo failed to run! Error: cargo run failed
  Error: "Cargo failed to run! Error: cargo run failed"
  [cargo-make] ERROR - Error while executing command, exit code: 1
  [cargo-make] WARN - Build Failed.

What Python version are you using?

Python 3.11

Reproduction steps

Review the MsCorePkg pipeline output as of commit dec8f57d3a5dc3f270f6b18940e99ba114d25f7a.

Expected behavior

It would be helpful for the build to clearly identify the errors.

Execution Environment

Pip packages

No response

Additional context

No response

Javagedes commented 1 year ago

This is to improve detecting and logging rust build errors as errors so that the developer does not need to parse through the build log. The build still fails, it's just the actual error messages need to be found in the log instead of being at the end of the log as an ERROR log.

The changes would be in https://github.com/tianocore/edk2-pytool-extensions/blob/5acb5d1cc96d2bf774579607c1c5cc960d3563b9/edk2toolext/edk2_logging.py#L208C5-L208C25