File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11load (
22 "//:util.bzl" ,
3+ "msys2_path" ,
34 "path_join" ,
45)
56
@@ -139,9 +140,6 @@ def _erlang_home_from_erl_path(repository_ctx, erl_path):
139140def _is_windows (repository_ctx ):
140141 return repository_ctx .os .name .lower ().find ("windows" ) != - 1
141142
142- def _msys2_path (repository_ctx , path ):
143- return repository_ctx .execute (["cygpath" , "-u" , path ]).stdout .strip ("\n " )
144-
145143def _default_erlang_dict (repository_ctx ):
146144 if _is_windows (repository_ctx ):
147145 if ERLANG_HOME_ENV_VAR in repository_ctx .os .environ :
@@ -152,7 +150,7 @@ def _default_erlang_dict(repository_ctx):
152150 if erl_path == None :
153151 erl_path = repository_ctx .path ("C:/Program Files/Erlang OTP/bin/erl.exe" )
154152 erlang_home = _erlang_home_from_erl_path (repository_ctx , erl_path )
155- erlang_home = _msys2_path (erlang_home )
153+ erlang_home = msys2_path (erlang_home )
156154 elif ERLANG_HOME_ENV_VAR in repository_ctx .os .environ :
157155 erlang_home = repository_ctx .os .environ [ERLANG_HOME_ENV_VAR ]
158156 erl_path = path_join (erlang_home , "bin" , "erl" )
Original file line number Diff line number Diff line change @@ -19,6 +19,15 @@ def windows_path(path):
1919 ).replace ("/" , "\\ " )
2020 return path .replace ("/" , "\\ " )
2121
22+ def msys2_path (path ):
23+ for letter in _DRIVE_LETTERS :
24+ for prefix in ["%s:" % letter .upper (), "%s:" % letter ]:
25+ if path .startswith (prefix ):
26+ return "/%s" % letter + path .removeprefix (
27+ prefix ,
28+ ).replace ("\\ " , "/" )
29+ return path .replace ("\\ " , "/" )
30+
2231def without (item , elements ):
2332 c = list (elements )
2433 c .remove (item )
You can’t perform that action at this time.
0 commit comments