Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RustEnvironmentCheck: Check Version if specified (#737)
## Description Allows repository owners to enforce version requirements for some rust related tools needed for build. This includes cargo-make and cargo-tarpaulin. RustEnvironmentCheck currently only checks that the necessary tooling exists on the system. The only version check it performs is for the compiler version. This update adds support for repository owners to optionally require specific versions for cargo-make and cargo-tarpaulin by setting the required version in the rust-toolchain.toml file at the workspace root. Updates the install command suggestion for cargo make and cargo tarpaulin. Example Usage: ``` # rust-toolchain.toml [toolchain] channel = "1.73.0" [tool] cargo-tarpaulin = "0.27.3" cargo-make = "0.37.9" ``` - [ ] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested Confirmed the following scenarios: 1. Tool missing, version specified ![image](https://github.com/microsoft/mu_basecore/assets/24388509/3664dca1-b1e2-42f7-bb6c-f5634cd87ffa) 3. Tool missing, version not specified ![image](https://github.com/microsoft/mu_basecore/assets/24388509/807754fa-e537-4b54-a670-1c1c4a908a33) 5. Tool installed, version mismatch ![image](https://github.com/microsoft/mu_basecore/assets/24388509/db0131d9-f8da-4ef4-910a-c8565175a168) ## Integration Instructions If a repository maintainer wants to manage the version, update the rust-toolchain.toml file similar to the example below: Example Usage: ``` [toolchain] channel = "1.73.0" [tool] cargo-tarpaulin = "0.27.3" cargo-make = "0.37.9" ```
- Loading branch information