bazelbuild / rules_foreign_cc

Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja, Meson)
https://bazelbuild.github.io/rules_foreign_cc
Apache License 2.0
650 stars 232 forks source link

fix: path expansion on windows #1207

Closed jsun-splunk closed 3 weeks ago

jsun-splunk commented 4 weeks ago

This is an extension of https://github.com/bazelbuild/rules_foreign_cc/pull/1204.

PATH variable updated by the ##path## primitive does not get expanded correctly on windows.

For example:

##path## $$EXT_BUILD_ROOT$$

gets expanded to

export PATH=C:/users/me/bazel_cache/xxxxxx/execroot/myrepo:$PATH

At the beginning, the C: gets incorrectly interpreted as 2 paths under msys.

  1. C
  2. /users/me/bazel_cache/xxxxxx/execroot/myrepo

The desired expansion here is:

export PATH=/C/users/me/bazel_cache/xxxxxx/execroot/myrepo:$PATH

Which correctly gets interpreted as 1 path.

jsun-splunk commented 4 weeks ago

Hi @jsharpe, could you help have look? Thanks!