From 84b1abd21e0a4724b9a3768f990147df382fdb9c Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Tue, 13 Jun 2023 22:52:35 -0700 Subject: [PATCH] Move default PATH setting from CMake to get_rocksdb_files.sh (#1312) Upstream commit ID: https://github.com/facebook/mysql-5.6/commit/38b673f1966643a0d35a58a0bcd8fa785cd4da06 PS-8951: Merge percona-202305 (https://jira.percona.com/browse/PS-8951) Summary: In c3f1703231d7fec34de1479b8913a06cd9c4cd79, get_rocksdb_files.sh invocation got PATH setting. The public discussion is incomplete but b739eac1760c2451200246c5d7fe3233787053b8 suggests that there is a problem with CentOS 9 and make 4.3 that undefined PATH does not get a default fallback, thus a PATH value is provided for the invocation. The provided PATH value is however incompatible with building on macOS. Fix by setting the fallback PATH value in the get_rocksdb_files.sh script itself. Pull Request resolved: https://github.com/facebook/mysql-5.6/pull/1312 Differential Revision: D46285384 fbshipit-source-id: 11984e05db5cc61ae69e7cfd4228f01d2ac238e4 --- storage/rocksdb/CMakeLists.txt | 2 +- storage/rocksdb/get_rocksdb_files.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 8fbf2eb787e8..3f26cd11170e 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -103,7 +103,7 @@ ELSE() # get a list of rocksdb library source files # run with env -i to avoid passing variables EXECUTE_PROCESS( - COMMAND env -i CXX=${CMAKE_CXX_COMPILER} PATH="/sbin:/usr/sbin:/bin:/usr/bin" ${CMAKE_CURRENT_SOURCE_DIR}/get_rocksdb_files.sh ${ROCKSDB_FOLLY} + COMMAND env -i CXX=${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR}/get_rocksdb_files.sh ${ROCKSDB_FOLLY} OUTPUT_VARIABLE SCRIPT_OUTPUT WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/storage/rocksdb/get_rocksdb_files.sh b/storage/rocksdb/get_rocksdb_files.sh index 2165dc61484f..3fcff9e64d4a 100755 --- a/storage/rocksdb/get_rocksdb_files.sh +++ b/storage/rocksdb/get_rocksdb_files.sh @@ -1,4 +1,8 @@ #!/bin/bash +if [ -z "$PATH" ]; then + export PATH="/sbin:/usr/sbin:/bin:/usr/bin" +fi + MKFILE=`mktemp` # create and run a simple makefile # include rocksdb make file relative to the path of this script