rules_foreign_cc icon indicating copy to clipboard operation
rules_foreign_cc copied to clipboard

change cygpath to mixed

Open matt-sm opened this issue 2 years ago • 2 comments

cygpath -w will print \ eg. c:\Users\msmith.

When this is used to calculate EXT_BUILD_ROOT, and EXT_BUILD_ROOT is used as a suffix for other paths, it can lead to a mix of \ amd / which can cause configure_make build failures. eg.

unsafe srcdir value: 'C:\tmp\2b4dntvp\execroot\__main__/external/

cygpath comes preinstalled in msys2, therefore is always used to calculate pwd.

The fallback, pwd -W will print / eg. c:/Users/msmith.

This MR changes the Windows pwd() to use the cygpath -m "mixed" mode that matches pwd -W.

matt-sm avatar Sep 07 '23 07:09 matt-sm

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Sep 07 '23 07:09 google-cla[bot]

It appears meson prefers c:\..\ paths.

Program win_flex found: YES (C:\tmp\766s67rb\execroot\rules_foreign_cc_examples\bazel-out\x64_windows-opt-exec-2B5CBBC6-ST-2324745666c0\bin\external\winflexbison\copy_winflexbison\winflexbison\win_flex.EXE)

when c:\..\.. in PATH vs

Program win_flex found: NO

when c:/../ in PATH

I noticed those tool paths are in the build script but I'm not sure how they're being inserted.

matt-sm avatar Sep 07 '23 10:09 matt-sm

Closing in favour of #1204

jsharpe avatar May 29 '24 16:05 jsharpe