@@ -17,11 +17,11 @@ def _go_toolchain_impl(ctx):
17
17
18
18
cmd = cmd_args ()
19
19
if host_info ().os .is_windows :
20
- compiler_src = cmd_args (download , format = "{}\\ go\\ bin\\ go.exe" )
21
- cmd .add ([ctx .attrs ._symlink_bat , compiler_dst .as_output (), compiler_src . relative_to ( compiler_dst , parent = 1 ) ])
20
+ compiler_src = cmd_args (download , format = "{}\\ go\\ bin\\ go.exe" , relative_to = ( compiler_dst , 1 ) )
21
+ cmd .add ([ctx .attrs ._symlink_bat , compiler_dst .as_output (), compiler_src ])
22
22
else :
23
- compiler_src = cmd_args (download , format = "{}/go/bin/go" )
24
- cmd .add (["ln" , "-sf" , compiler_src . relative_to ( compiler_dst , parent = 1 ) , compiler_dst .as_output ()])
23
+ compiler_src = cmd_args (download , format = "{}/go/bin/go" , relative_to = ( compiler_dst , 1 ) )
24
+ cmd .add (["ln" , "-sf" , compiler_src , compiler_dst .as_output ()])
25
25
26
26
ctx .actions .run (cmd , category = "cp_compiler" )
27
27
return [DefaultInfo (default_output = download ), GoCompilerInfo (compiler_path = compiler_dst , GOROOT = "" )]
@@ -60,12 +60,12 @@ def _download_toolchain(ctx: AnalysisContext):
60
60
if host_info ().os .is_windows :
61
61
script_content .extend ([
62
62
cmd_args (output , format = "cd {}" ),
63
- cmd_args (["unzip" , archive ], delimiter = " " ). relative_to ( output ),
63
+ cmd_args (["unzip" , archive ], delimiter = " " , relative_to = output ),
64
64
])
65
65
else :
66
66
script_content .extend ([
67
67
cmd_args (output , format = "cd {}" ),
68
- cmd_args (["tar" , compress_flag , "-x" , "-f" , archive ], delimiter = " " ). relative_to ( output ),
68
+ cmd_args (["tar" , compress_flag , "-x" , "-f" , archive ], delimiter = " " , relative_to = output ),
69
69
])
70
70
script , _ = ctx .actions .write (
71
71
script_name ,
0 commit comments