Skip to content

Commit 90ae3e9

Browse files
authored
Merge pull request #10338 from rabbitmq/bazel-7-fixes
Bazel 7 fixes
2 parents a04b092 + 5e1983a commit 90ae3e9

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.4.0
1+
latest

bazel/elixir/elixir_as_app.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _impl(ctx):
2121
outputs = [ebin],
2222
command = """set -euo pipefail
2323
24-
cp -r "{elixir_home}"/lib/{app}/ebin/* {ebin}
24+
cp -RL "{elixir_home}"/lib/{app}/ebin/* {ebin}
2525
""".format(
2626
elixir_home = elixir_home,
2727
app = ctx.attr.app,

deps/rabbitmq_cli/rabbitmqctl.bzl

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ ElixirAppInfo = provider(
3434
},
3535
)
3636

37+
def _copy(ctx, src, dst):
38+
ctx.actions.run_shell(
39+
inputs = [src],
40+
outputs = [dst],
41+
command = """set -euo pipefail
42+
43+
cp -RL "{src}" "{dst}"
44+
""".format(
45+
src = src.path,
46+
dst = dst.path,
47+
),
48+
)
49+
3750
def deps_dir_contents(ctx, deps, dir):
3851
files = []
3952
for dep in deps:
@@ -51,15 +64,7 @@ def deps_dir_contents(ctx, deps, dir):
5164
lib_info.app_name,
5265
rp,
5366
))
54-
args = ctx.actions.args()
55-
args.add(src)
56-
args.add(f)
57-
ctx.actions.run(
58-
inputs = [src],
59-
outputs = [f],
60-
executable = "cp",
61-
arguments = [args],
62-
)
67+
_copy(ctx, src, f)
6368
files.append(f)
6469
for beam in lib_info.beam:
6570
if not beam.is_directory:
@@ -69,15 +74,7 @@ def deps_dir_contents(ctx, deps, dir):
6974
"ebin",
7075
beam.basename,
7176
))
72-
args = ctx.actions.args()
73-
args.add(beam)
74-
args.add(f)
75-
ctx.actions.run(
76-
inputs = [beam],
77-
outputs = [f],
78-
executable = "cp",
79-
arguments = [args],
80-
)
77+
_copy(ctx, beam, f)
8178
files.append(f)
8279
else:
8380
fail("unexpected directory in", lib_info)
@@ -158,8 +155,8 @@ done
158155
159156
cp escript/rabbitmqctl ${{ABS_ESCRIPT_PATH}}
160157
161-
cp _build/${{MIX_ENV}}/lib/rabbitmqctl/ebin/* ${{ABS_EBIN_DIR}}
162-
cp _build/${{MIX_ENV}}/lib/rabbitmqctl/consolidated/* ${{ABS_CONSOLIDATED_DIR}}
158+
cp -RL _build/${{MIX_ENV}}/lib/rabbitmqctl/ebin/* ${{ABS_EBIN_DIR}}
159+
cp -RL _build/${{MIX_ENV}}/lib/rabbitmqctl/consolidated/* ${{ABS_CONSOLIDATED_DIR}}
163160
164161
# remove symlinks from the _build directory since it
165162
# is not used, and bazel does not allow them

0 commit comments

Comments
 (0)