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 C runtime windows build #786

Merged
merged 2 commits into from
Feb 13, 2025
Merged

Fix C runtime windows build #786

merged 2 commits into from
Feb 13, 2025

Conversation

vincent-botbol
Copy link
Contributor

This PR fixes the build on windows which failed due to an invocation to ar which wasn't named this way on windows.
It also fixes an issue introduced in #784 which made the failing build fails even more because windows's equivalent to pkg-config doesn't consider the cygwin folder.

Copy link
Contributor

@AltGr AltGr left a comment

Choose a reason for hiding this comment

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

🎉

build system handle it properly. *)
Config.c_compiler
|> replace_string (compile (str "gcc")) ~by:"ar"
|> print_string
Copy link
Contributor

@AltGr AltGr Feb 12, 2025

Choose a reason for hiding this comment

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

Can it not happen (on mac ?) that this is cc or clang ? In this case this would call cc instead of ar ; maybe check if Config.c_compiler ends with gcc and then only replace, otherwise returning ar ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh you're absolutely right.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made sure that we were on windows and improved the regex a little. It seems to work as intended on both mac & windows.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! ar never needs .exe ?

Copy link
Contributor Author

@vincent-botbol vincent-botbol Feb 12, 2025

Choose a reason for hiding this comment

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

Windows automatically create ".exe"-less aliases for .exe binaries so it's safe to call it without the extension.

@vincent-botbol vincent-botbol force-pushed the vbot@fix-ar-c-runtime branch 3 times, most recently from 59485a5 to 097d38d Compare February 12, 2025 15:53
@AltGr AltGr merged commit fdd51b0 into master Feb 13, 2025
5 checks passed
@AltGr AltGr deleted the vbot@fix-ar-c-runtime branch February 13, 2025 09:38
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.

2 participants