Description
Description
I've had two Windows 2022 builds fail successively on Install-Rust.ps1 today.
The error that we get is:
==> azure-arm.build_vhd: ==> azure-arm.build_vhd: error[E0599]: no method named
as_strfound for enum
std::option::Optionin the current scope ==> azure-arm.build_vhd: --> C:\Users\Default\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cargo-0.86.0\src\cargo\util\toml\mod.rs:1482:33 ==> azure-arm.build_vhd: | ==> azure-arm.build_vhd: 1482 | normalized_package.name.as_str().into(), ==> azure-arm.build_vhd: | ^^^^^^ method not found in
Option==> azure-arm.build_vhd: | ==> azure-arm.build_vhd: note: the method
as_strexists on the type
PackageName==> azure-arm.build_vhd: --> /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb\library\alloc\src\string.rs:1081:5 ==> azure-arm.build_vhd: help: consider using
Option::expectto unwrap the
PackageNamevalue, panicking if the value is an
Option::None==> azure-arm.build_vhd: | ==> azure-arm.build_vhd: 1482 | normalized_package.name.expect("REASON").as_str().into(), ==> azure-arm.build_vhd: | +++++++++++++++++ ==> azure-arm.build_vhd: ==> azure-arm.build_vhd: Some errors have detailed explanations: E0277, E0308, E0599. ==> azure-arm.build_vhd: For more information about an error, try
rustc --explain E0277. ==> azure-arm.build_vhd: error: could not compile
cargo(lib) due to 7 previous errors ==> azure-arm.build_vhd: error: failed to compile
cargo-outdated v0.17.0, intermediate artifacts can be found at
C:\Users\packer\AppData\Local\Temp\cargo-installlaAfQo. ==> azure-arm.build_vhd: To reuse those artifacts with a future compilation, set the environment variable
CARGO_TARGET_DIRto that path. ==> azure-arm.build_vhd: Summary Successfully installed bindgen-cli, cbindgen, cargo-audit! Failed to install cargo-outdated (see error(s) above). ==> azure-arm.build_vhd: error: some crates failed to install ==> azure-arm.build_vhd: Rust tools installation failed with exit code 101 ==> azure-arm.build_vhd: At C:\Windows\Temp\script-67eec07d-d689-eebf-f34c-87b031d9a160.ps1:45 char:9 ==> azure-arm.build_vhd: + throw "Rust tools installation failed with exit code $LASTEXI ... ==> azure-arm.build_vhd: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ==> azure-arm.build_vhd: + CategoryInfo : OperationStopped: (Rust tools inst...h exit code 101:String) [], RuntimeException ==> azure-arm.build_vhd: + FullyQualifiedErrorId : Rust tools installation failed with exit code 101
Platforms affected
- Azure DevOps
- GitHub Actions - Standard Runners
- GitHub Actions - Larger Runners
Runner images affected
- Ubuntu 20.04
- Ubuntu 22.04
- Ubuntu 24.04
- macOS 13
- macOS 13 Arm64
- macOS 14
- macOS 14 Arm64
- macOS 15
- macOS 15 Arm64
- Windows Server 2019
- Windows Server 2022
- Windows Server 2025
Image version and build link
Custom build for Azure DevOps VMSS based on main branch of runner-images
Is it regression?
Yes, build worked on Monday 31st March 2025
Expected behavior
Install-Rust.ps1 script should install with no problems.
Actual behavior
==> azure-arm.build_vhd:
==> azure-arm.build_vhd: error[E0599]: no method named as_str
found for enum std::option::Option
in the current scope
==> azure-arm.build_vhd: --> C:\Users\Default.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cargo-0.86.0\src\cargo\util\toml\mod.rs:1482:33
==> azure-arm.build_vhd: |
==> azure-arm.build_vhd: 1482 | normalized_package.name.as_str().into(),
==> azure-arm.build_vhd: | ^^^^^^ method not found in Option<PackageName>
==> azure-arm.build_vhd: |
==> azure-arm.build_vhd: note: the method as_str
exists on the type PackageName
==> azure-arm.build_vhd: --> /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb\library\alloc\src\string.rs:1081:5
==> azure-arm.build_vhd: help: consider using Option::expect
to unwrap the PackageName
value, panicking if the value is an Option::None
==> azure-arm.build_vhd: |
==> azure-arm.build_vhd: 1482 | normalized_package.name.expect("REASON").as_str().into(),
==> azure-arm.build_vhd: | +++++++++++++++++
==> azure-arm.build_vhd:
==> azure-arm.build_vhd: Some errors have detailed explanations: E0277, E0308, E0599.
==> azure-arm.build_vhd: For more information about an error, try rustc --explain E0277
.
==> azure-arm.build_vhd: error: could not compile cargo
(lib) due to 7 previous errors
==> azure-arm.build_vhd: error: failed to compile cargo-outdated v0.17.0
, intermediate artifacts can be found at C:\Users\packer\AppData\Local\Temp\cargo-installlaAfQo
.
==> azure-arm.build_vhd: To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR
to that path.
==> azure-arm.build_vhd: Summary Successfully installed bindgen-cli, cbindgen, cargo-audit! Failed to install cargo-outdated (see error(s) above).
==> azure-arm.build_vhd: error: some crates failed to install
==> azure-arm.build_vhd: Rust tools installation failed with exit code 101
==> azure-arm.build_vhd: At C:\Windows\Temp\script-67eec07d-d689-eebf-f34c-87b031d9a160.ps1:45 char:9
==> azure-arm.build_vhd: + throw "Rust tools installation failed with exit code $LASTEXI ...
==> azure-arm.build_vhd: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm.build_vhd: + CategoryInfo : OperationStopped: (Rust tools inst...h exit code 101:String) [], RuntimeException
==> azure-arm.build_vhd: + FullyQualifiedErrorId : Rust tools installation failed with exit code 101
Repro steps
Clone down runner-images repo and build image using Packer