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: force windows compiler to run in out_dir to prevent artifacts in cwd #1415

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

wmmc88
Copy link
Contributor

@wmmc88 wmmc88 commented Feb 25, 2025

MSVC was dumping flag_check.exe in the crate's root directory whenever is_flag_supported_inner was called. This PR changes the cwd of the compiler to be in out_dir, adds a local github action to check whether the git working tree is clean, and then uses that action to check that the CI pipelines that produce artifacts haven't dumped anything in the git working tree.

GitHub Actions and Workflow Improvements:

Codebase Simplification:

  • src/lib.rs: Simplified the Build implementation by directly calling methods on the compiler object instead of storing their results in temporary variables. [1] [2] [3]
  • src/lib.rs: Ensured the cmd command runs in the out_dir directory by using the current_dir method.

fixes #1411

Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

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

Thank you, LGTM

@NobodyXu NobodyXu merged commit 439b75f into rust-lang:main Feb 25, 2025
73 checks passed
@github-actions github-actions bot mentioned this pull request Feb 28, 2025
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.

flag_check.exe being generated in source tree
2 participants