Skip to content

Commit

Permalink
Use a symlink action, not a shell script
Browse files Browse the repository at this point in the history
Using a shell script is not portable and also causes issues with
build-without-the-bytes, which can handle local symlink actions (at least in
principle), but cannot handle symlinks returned from remote execution.

Also see bazelbuild/bazel#11532.
  • Loading branch information
ulfjack committed Sep 22, 2020
1 parent 60fbda7 commit a6299ad
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/pkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,9 @@ def _pkg_deb_impl(ctx):
"PYTHONUTF8": "1",
},
)
ctx.actions.run_shell(
command = "ln -s %s %s" % (ctx.outputs.deb.basename, ctx.outputs.out.path),
inputs = [ctx.outputs.deb],
outputs = [ctx.outputs.out],
ctx.actions.symlink(
output = ctx.outputs.out,
target_file = ctx.outputs.deb,
)
output_groups = {"out": [ctx.outputs.out]}
if hasattr(ctx.outputs, "deb"):
Expand Down

0 comments on commit a6299ad

Please sign in to comment.