Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix std_detect_env_override feature on Windows by avoiding libc #1571

Merged
merged 1 commit into from May 7, 2024

Conversation

dpaoliello
Copy link
Contributor

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
Copy link
Collaborator

rustbot commented May 1, 2024

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.

Copy link

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Though it looks like CI is stuck? cc @Amanieu

@Amanieu
Copy link
Member

Amanieu commented May 2, 2024

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

@dpaoliello
Copy link
Contributor Author

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

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

@dpaoliello
Copy link
Contributor Author

@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.

@Amanieu Amanieu merged commit 8ce6875 into rust-lang:master May 7, 2024
29 checks passed
@dpaoliello dpaoliello deleted the envoveride branch May 7, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std_detect: Don't unnecessarily depend on libc for windows-msvc
4 participants