Skip to content

Commit a52307a

Browse files
Zouxxyymeta-codesync[bot]
authored andcommitted
build: Avoid staying in subdir of dependency after it has been installed (#15113)
Summary: In apache/gluten#10836, we encountered a Velox compilation issue caused by the changes introduced in #14849. The error occurred because ABSOLUTE_SCRIPTDIR was modified. ``` 2025-10-09T03:42:02.6189401Z ++ realpath scripts 2025-10-09T03:42:02.6207867Z + ABSOLUTE_SCRIPTDIR=/__w/incubator-gluten/incubator-gluten/ep/build-velox/build/velox_ep/deps-download/abseil-cpp/scripts 2025-10-09T03:42:02.6210432Z + VELOX_ARROW_CMAKE_PATCH=/__w/incubator-gluten/incubator-gluten/ep/build-velox/build/velox_ep/deps-download/abseil-cpp/scripts/../CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch 2025-10-09T03:42:02.6212114Z + cd /__w/incubator-gluten/incubator-gluten/ep/build-velox/build/velox_ep/deps-download/arrow 2025-10-09T03:42:02.6213956Z + git apply /__w/incubator-gluten/incubator-gluten/ep/build-velox/build/velox_ep/deps-download/abseil-cpp/scripts/../CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch 2025-10-09T03:42:02.6230732Z error: can't open patch '/__w/incubator-gluten/incubator-gluten/ep/build-velox/build/velox_ep/deps-download/abseil-cpp/scripts/../CMake/resolve_dependency_modules/arrow/cmake-compatibility.patch': No such file or directory 2025-10-09T03:42:02.6235097Z + exit 1 ``` Pull Request resolved: #15113 Reviewed By: bikramSingh91 Differential Revision: D85060996 Pulled By: pedroerp fbshipit-source-id: 255eb7a82bc3d9ffb6c47e2a4c96066b4974823e
1 parent dbf599a commit a52307a

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

scripts/setup-common.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ function install_aws_deps {
299299
local AWS_REPO_NAME="aws/aws-sdk-cpp"
300300

301301
github_checkout $AWS_REPO_NAME "$AWS_SDK_VERSION" --depth 1 --recurse-submodules
302-
cmake_install -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DBUILD_SHARED_LIBS:BOOL=OFF -DMINIMIZE_SIZE:BOOL=ON -DENABLE_TESTING:BOOL=OFF -DBUILD_ONLY:STRING="s3;identity-management"
302+
cmake_install_dir aws-sdk-cpp -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DBUILD_SHARED_LIBS:BOOL=OFF -DMINIMIZE_SIZE:BOOL=ON -DENABLE_TESTING:BOOL=OFF -DBUILD_ONLY:STRING="s3;identity-management"
303303
}
304304

305305
function install_minio {
@@ -329,13 +329,13 @@ function install_gcs-sdk-cpp {
329329

330330
# protobuf
331331
github_checkout protocolbuffers/protobuf v"${PROTOBUF_VERSION}" --depth 1
332-
cmake_install \
332+
cmake_install_dir protobuf \
333333
-Dprotobuf_BUILD_TESTS=OFF \
334334
-Dprotobuf_ABSL_PROVIDER=package
335335

336336
# grpc
337337
github_checkout grpc/grpc "${GRPC_VERSION}" --depth 1
338-
cmake_install \
338+
cmake_install_dir grpc \
339339
-DgRPC_BUILD_TESTS=OFF \
340340
-DgRPC_ABSL_PROVIDER=package \
341341
-DgRPC_ZLIB_PROVIDER=package \
@@ -347,19 +347,19 @@ function install_gcs-sdk-cpp {
347347

348348
# crc32
349349
github_checkout google/crc32c "${CRC32_VERSION}" --depth 1
350-
cmake_install \
350+
cmake_install_dir crc32c \
351351
-DCRC32C_BUILD_TESTS=OFF \
352352
-DCRC32C_BUILD_BENCHMARKS=OFF \
353353
-DCRC32C_USE_GLOG=OFF
354354

355355
# nlohmann json
356356
github_checkout nlohmann/json "${NLOHMAN_JSON_VERSION}" --depth 1
357-
cmake_install \
357+
cmake_install_dir json \
358358
-DJSON_BuildTests=OFF
359359

360360
# google-cloud-cpp
361361
github_checkout googleapis/google-cloud-cpp "${GOOGLE_CLOUD_CPP_VERSION}" --depth 1
362-
cmake_install \
362+
cmake_install_dir google-cloud-cpp \
363363
-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \
364364
-DGOOGLE_CLOUD_CPP_ENABLE=storage
365365
}
@@ -370,6 +370,7 @@ function install_azure-storage-sdk-cpp {
370370
export AZURE_SDK_DISABLE_AUTO_VCPKG=ON
371371
vcpkg_commit_id=7a6f366cefd27210f6a8309aed10c31104436509
372372
github_checkout azure/azure-sdk-for-cpp azure-storage-files-datalake_"${AZURE_SDK_VERSION}"
373+
pushd azure-sdk-for-cpp || exit
373374
sed -i='' "s/set(VCPKG_COMMIT_STRING .*)/set(VCPKG_COMMIT_STRING $vcpkg_commit_id)/" cmake-modules/AzureVcpkg.cmake
374375

375376
azure_core_dir="sdk/core/azure-core"
@@ -406,6 +407,7 @@ function install_azure-storage-sdk-cpp {
406407
cd sdk/storage/azure-storage-files-datalake || exit
407408
cmake_install -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DBUILD_SHARED_LIBS=OFF
408409
)
410+
popd || exit
409411
}
410412

411413
function install_hdfs_deps {

scripts/setup-helper-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function prompt {
4949
done
5050
) 2>/dev/null
5151
}
52+
5253
function github_checkout {
5354
local REPO=$1
5455
shift
@@ -69,7 +70,6 @@ function github_checkout {
6970
if [ ! -d "${DIRNAME}" ]; then
7071
git clone -q -b "$VERSION" "${GIT_CLONE_PARAMS[@]}" "https://github.com/${REPO}.git"
7172
fi
72-
cd "${DIRNAME}" || exit
7373
}
7474

7575
# get_cxx_flags [$CPU_ARCH]

0 commit comments

Comments
 (0)