From e16f49b327bbc1c18e8fc5d0ac4fa8c2f1144412 Mon Sep 17 00:00:00 2001 From: Yi Cheng <74173148+iycheng@users.noreply.github.com> Date: Fri, 7 Oct 2022 22:10:17 +0000 Subject: [PATCH] [build] Fix redis build in linux. (#29179) The current build in some platform will show errors: ``` Execution platform: @local_config_platform//:host rm: cannot remove 'tmp-redis-bin/redis/bin/redis-cli': Permission denied rm: cannot remove 'tmp-redis-bin/redis/bin/redis-benchmark': Permission denied rm: cannot remove 'tmp-redis-bin/redis/bin/redis-check-rdb': Permission denied rm: cannot remove 'tmp-redis-bin/redis/bin/redis-sentinel': Permission denied rm: cannot remove 'tmp-redis-bin/redis/bin/redis-server': Permission denied rm: cannot remove 'tmp-redis-bin/redis/bin/redis-check-aof': Permission denied rm: cannot remove 'tmp-redis-bin/redis/include': Permission denied ``` This PR fixed this by avoiding creating tmp dir. --- bazel/BUILD.redis | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bazel/BUILD.redis b/bazel/BUILD.redis index 91b3e06201be..3ee855efeef7 100644 --- a/bazel/BUILD.redis +++ b/bazel/BUILD.redis @@ -48,13 +48,8 @@ genrule( "redis-cli", ], cmd = """ - mkdir tmp-redis-bin - cp -rf $(locations :redis) ./tmp-redis-bin/ - cp tmp-redis-bin/redis-server $(location redis-server) - chmod +x $(location redis-server) - cp tmp-redis-bin/redis-cli $(location redis-cli) - chmod +x $(location redis-cli) - rm -rf tmp-redis-bin + cp $(RULEDIR)/redis/bin/redis-server $(location redis-server) + cp $(RULEDIR)/redis/bin/redis-cli $(location redis-cli) """, visibility = ["//visibility:public"], tags = ["local"],