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(config builder): compiler validation on windows #176

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

WillLillis
Copy link
Collaborator

@WillLillis WillLillis commented Nov 20, 2024

The basic problem here is that windows allows you to omit a file extension when referring to a file. That is, gcc is perfectly fine to refer to gcc.exe. However, calling .is_file() on a path ending with gcc where the file is actually gcc.exe will return false. This causes a bug in our compiler validation logic on Windows, leading us to tell users that their compiler couldn't be found when it definitely was.

The fix is to simply iterate over common executable extension when the is_file() check fails. If any of these extension paths exist and point to a file, we'll consider that good enough™️ and treat it as a valid compiler path. We'll still print a warning to the screen in this case, to avoid potential confusion.

Addresses the main issue raised in #173

@WillLillis WillLillis force-pushed the windows_comp_validation branch from 8e6e48e to 6245bb5 Compare November 20, 2024 22:57
@WillLillis WillLillis enabled auto-merge (squash) November 20, 2024 23:00
@WillLillis WillLillis merged commit e79132f into bergercookie:master Nov 20, 2024
14 checks passed
@WillLillis WillLillis deleted the windows_comp_validation branch November 20, 2024 23:06
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.

1 participant