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: change cygpath to mixed mode #1204

Merged
merged 1 commit into from
May 29, 2024
Merged

Conversation

jsun-splunk
Copy link
Contributor

@jsun-splunk jsun-splunk commented May 22, 2024

'autoconf' applications often has a ./configure stage that checks the $srcdir (source directory). This is represented in foreign_cc by a combination of $EXT_BUILD_ROOT and a relative path to the source. This check fails on windows if $EXT_BUILD_ROOT contains '\' since it is an escape char under unix. Therefore, we need to generate $EXT_BUILD_ROOT with '/' instead.

Generating $EXT_BUILD_ROOT with '/' present a different problem as now the resulting PATH variable becomes the format "/C:/path/to/a:/C:/path/to/b". Due to ':' being used as both window drive leter assignment and linux path delimiter, MSYS2 gets very confused and doesn't resolve this correctly. Therefore, we need this to become the format "/C/path/to/a:/C/path/to/b".

$EXT_BUILD_ROOT is sometimes passed through the 'env' attribute by the user. We need to handle this scenario as well.

@jsun-splunk jsun-splunk force-pushed the fix-cygpath branch 10 times, most recently from 00f6ba2 to 40422f8 Compare May 23, 2024 05:37
@jsun-splunk
Copy link
Contributor Author

Hi @jsharpe,

Could I trouble you to review?

'autoconf' applications often has a ./configure stage that checks the $srcdir (source directory). This is represented in foreign_cc by a combination of $EXT_BUILD_ROOT and a relative path to the source. This check fails if $EXT_BUILD_ROOT contains '\' as it is an escape char under unix. Therefore, we need to generate $EXT_BUILD_ROOT with '/' instead.

Generating $EXT_BUILD_ROOT with '/' present a different problem as now the resulting PATH variable becomes the format "/C:/path/to/a:/C:/path/to/b". Due to ':' being used as both window drive leter assignment and linux path delimiter, MSYS2 gets very confused and doesn't resolve this correctly. Therefore, we need this to become the format "/C/path/to/a:/C/path/to/b".
@jsun-splunk
Copy link
Contributor Author

This MR has the same purpose as #1091 but also fixes the meson issue.

Copy link
Collaborator

@jsharpe jsharpe left a comment

Choose a reason for hiding this comment

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

LGTM

@jsharpe jsharpe merged commit 546e06e into bazelbuild:main May 29, 2024
2 checks passed
@jsharpe jsharpe mentioned this pull request May 29, 2024
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.

None yet

2 participants