rust-lang / stdarch

Rust's standard library vendor-specific APIs and run-time feature detection
https://doc.rust-lang.org/stable/core/arch/
Apache License 2.0
598 stars 255 forks source link

Fix `std_detect_env_override` feature on Windows by avoiding `libc` #1571

Closed dpaoliello closed 2 months ago

dpaoliello commented 2 months ago

As noted in #1563, the only dependency on libc when building stdarch for Windows was a call to getenv when the std_detect_env_override feature was enabled. Since the libc dependency is only enabled for non-Windows platforms, enabling the std_detect_env_override feature on Windows would cause a build break.

This change replaces the use of getenv with a call to GetEnvironmentVariableA on Windows and enables testing the std_detect_env_override feature.

Fixes #1563

r? @ChrisDenton

rustbot commented 2 months ago

Failed to set assignee to ChrisDenton: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

Amanieu commented 2 months ago

I think your changes to the Github Actions configuration broke something.

dpaoliello commented 2 months ago

I think your changes to the Github Actions configuration broke something.

Ah, yep, I messed up the matrix syntax - sorry!

dpaoliello commented 2 months ago

@Amanieu CI has been fixed up - I also added --no-self-update to each of the rustup invocations since the self-update was causing issues with the Windows builds.