Bazel 6 compatibility

Directory name for tools in runfiles is a bit unpredictable. Maybe
there is a better way, but at least this should cover all the cases
that I've observed.

One unexpected consequence is that this directory name can contains `~`,
and it's not being properly escaped in `ct:pal` calls (causing
badarg's for `io:format/4`.
This commit is contained in:
Alexey Lebedeff 2022-12-21 18:09:02 +01:00
parent 8ea8253bfc
commit b51304d233
2 changed files with 10 additions and 2 deletions

View File

@ -897,7 +897,9 @@ exec([Cmd | Args], Options) when is_list(Cmd) orelse is_binary(Cmd) ->
| proplists:delete(env, PortOptions1)],
Log ++ "~n~nEnvironment variables:~n" ++
string:join(
[rabbit_misc:format(" ~ts=~ts", [K, V]) || {K, V} <- Env1],
[string:replace(
rabbit_misc:format(" ~ts=~ts", [K, V]),
"~", "~~", all) || {K, V} <- Env1],
"~n")
}
end,

View File

@ -277,7 +277,13 @@ def rabbitmq_integration_suite(
"RABBITMQCTL": "$TEST_SRCDIR/$TEST_WORKSPACE/{}/broker-for-tests-home/sbin/rabbitmqctl".format(package),
"RABBITMQ_PLUGINS": "$TEST_SRCDIR/$TEST_WORKSPACE/{}/broker-for-tests-home/sbin/rabbitmq-plugins".format(package),
"RABBITMQ_QUEUES": "$TEST_SRCDIR/$TEST_WORKSPACE/{}/broker-for-tests-home/sbin/rabbitmq-queues".format(package),
"RABBITMQ_RUN_SECONDARY": "$TEST_SRCDIR/.secondary_umbrella.rabbitmq-server-generic-unix-3.11/rabbitmq-run",
# The following variations were observed on different
# versions of bazel and in different environments:
# - _main~secondary_umbrella~rabbitmq-server-generic-unix-3.11
# - @~secondary_umbrella~rabbitmq-server-generic-unix-3.11
# - .secondary_umbrella.rabbitmq-server-generic-unix-3.11
"RABBITMQ_RUN_SECONDARY": "$(ls $TEST_SRCDIR/*secondary_umbrella*rabbitmq-server-generic-unix-3.11/rabbitmq-run)",
"LANG": "C.UTF-8",
}.items() + test_env.items()),
tools = [