Skip to content

Commit 179cef7

Browse files
build: Allow options to wget curl cmake during setup (#12201)
Summary: ## Description The current setup scripts generate excessive output, the goal is to reduce the log output by implementing the following changes: 1. Avoid printing the files extracted by tar. 2. Silence the download progress from curl by using an appropriate curl option. 3. Suppress unnecessary CMake messages, logging only warnings instead of info or status messages. 4. Introduce a new environment variable to enable the extensive logging when needed. 5. These changes will help minimize log size while maintaining flexibility for detailed logging when required. Pull Request resolved: #12201 Reviewed By: kevinwilfong Differential Revision: D69316549 Pulled By: kgpai fbshipit-source-id: 3d679c73c1bd513afdf060e7c13ec44a5a02989e
1 parent cf48065 commit 179cef7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

scripts/setup-adapters.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ if [[ "$OSTYPE" == darwin* ]]; then
2929
export INSTALL_PREFIX=${INSTALL_PREFIX:-"$(pwd)/deps-install"}
3030
fi
3131

32+
WGET_OPTIONS=${WGET_OPTIONS:-""}
33+
3234
function install_aws_deps {
3335
local AWS_REPO_NAME="aws/aws-sdk-cpp"
3436
local AWS_SDK_VERSION="1.11.321"
@@ -50,7 +52,7 @@ function install_aws_deps {
5052
# minio will have to approved under the Privacy & Security on MacOS on first use.
5153
MINIO_OS="darwin"
5254
fi
53-
wget https://dl.min.io/server/minio/release/${MINIO_OS}-${MINIO_ARCH}/archive/minio.RELEASE.2022-05-26T05-48-41Z -O ${MINIO_BINARY}
55+
wget ${WGET_OPTIONS} https://dl.min.io/server/minio/release/${MINIO_OS}-${MINIO_ARCH}/archive/minio.RELEASE.2022-05-26T05-48-41Z -O ${MINIO_BINARY}
5456
chmod +x ./${MINIO_BINARY}
5557
mv ./${MINIO_BINARY} /usr/local/bin/
5658
fi
@@ -155,7 +157,7 @@ function install_hdfs_deps {
155157
# Dependencies for Hadoop testing
156158
wget_and_untar https://archive.apache.org/dist/hadoop/common/hadoop-3.3.0/hadoop-3.3.0.tar.gz hadoop
157159
cp -a ${DEPENDENCY_DIR}/hadoop /usr/local/
158-
wget -P /usr/local/hadoop/share/hadoop/common/lib/ https://repo1.maven.org/maven2/junit/junit/4.11/junit-4.11.jar
160+
wget ${WGET_OPTIONS} -P /usr/local/hadoop/share/hadoop/common/lib/ https://repo1.maven.org/maven2/junit/junit/4.11/junit-4.11.jar
159161

160162
LINUX_DISTRIBUTION=$(. /etc/os-release && echo ${ID})
161163
if [[ "$LINUX_DISTRIBUTION" == "ubuntu" || "$LINUX_DISTRIBUTION" == "debian" ]]; then

scripts/setup-helper-functions.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)/deps-download}
2020
OS_CXXFLAGS=""
2121
NPROC=${BUILD_THREADS:-$(getconf _NPROCESSORS_ONLN)}
2222

23+
CURL_OPTIONS=${CURL_OPTIONS:-""}
24+
CMAKE_OPTIONS=${CMAKE_OPTIONS:-""}
25+
2326
function run_and_time {
2427
time "$@" || (echo "Failed to run $* ." ; exit 1 )
2528
{ echo "+ Finished running $*"; } 2> /dev/null
@@ -173,7 +176,7 @@ function wget_and_untar {
173176
fi
174177
mkdir -p "${DIR}"
175178
pushd "${DIR}"
176-
curl -L "${URL}" > $2.tar.gz
179+
curl ${CURL_OPTIONS} -L "${URL}" > $2.tar.gz
177180
tar -xz --strip-components=1 -f $2.tar.gz
178181
popd
179182
popd
@@ -205,7 +208,7 @@ function cmake_install {
205208
COMPILER_FLAGS+=${OS_CXXFLAGS}
206209

207210
# CMAKE_POSITION_INDEPENDENT_CODE is required so that Velox can be built into dynamic libraries \
208-
cmake -Wno-dev -B"${BINARY_DIR}" \
211+
cmake -Wno-dev ${CMAKE_OPTIONS} -B"${BINARY_DIR}" \
209212
-GNinja \
210213
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
211214
-DCMAKE_CXX_STANDARD=17 \

0 commit comments

Comments
 (0)