File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 11load (
22 "//:util.bzl" ,
3- "msys2_path" ,
43 "path_join" ,
54)
65
@@ -140,6 +139,9 @@ def _erlang_home_from_erl_path(repository_ctx, erl_path):
140139def _is_windows (repository_ctx ):
141140 return repository_ctx .os .name .lower ().find ("windows" ) != - 1
142141
142+ def _msys2_path (repository_ctx , path ):
143+ return repository_ctx .execute (["cygpath" , "-u" , path ]).stdout .strip ("\n " )
144+
143145def _default_erlang_dict (repository_ctx ):
144146 if _is_windows (repository_ctx ):
145147 if ERLANG_HOME_ENV_VAR in repository_ctx .os .environ :
@@ -150,7 +152,7 @@ def _default_erlang_dict(repository_ctx):
150152 if erl_path == None :
151153 erl_path = repository_ctx .path ("C:/Program Files/Erlang OTP/bin/erl.exe" )
152154 erlang_home = _erlang_home_from_erl_path (repository_ctx , erl_path )
153- erlang_home = msys2_path (erlang_home )
155+ erlang_home = _msys2_path (erlang_home )
154156 elif ERLANG_HOME_ENV_VAR in repository_ctx .os .environ :
155157 erlang_home = repository_ctx .os .environ [ERLANG_HOME_ENV_VAR ]
156158 erl_path = path_join (erlang_home , "bin" , "erl" )
Original file line number Diff line number Diff line change @@ -19,15 +19,6 @@ 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-
3122def without (item , elements ):
3223 c = list (elements )
3324 c .remove (item )
You can’t perform that action at this time.
0 commit comments