Skip to content

Commit 04e8f3d

Browse files
agankur21facebook-github-bot
authored andcommitted
Updated the build.sh to get Proxygen installed correctly on CentOS dev severs
Summary: Current build.sh script of Proxygen fails to build on the CentOS dev servers (which are also used for the Confidential virtual machines). On investigation, I found 3 errors: a). lsb_release is not installed by default b). Reqiures installation of fast_float-devel c). Requires setting up of proxy server settings so that it could seamlessly download the github repos. The diff does not change anything for the existing systems, but instead make it work seamlessly for the CentOS servers with proxy server. Reviewed By: kvtsoy Differential Revision: D69965614 fbshipit-source-id: 1eebb1b8b3accf6aa7f130a805539cd516e7a864
1 parent bc33985 commit 04e8f3d

File tree

1 file changed

+58
-3
lines changed

1 file changed

+58
-3
lines changed

proxygen/build.sh

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@ COLOR_OFF="\033[0m"
2020
function detect_platform() {
2121
unameOut="$(uname -s)"
2222
case "${unameOut}" in
23-
Linux*) PLATFORM=Linux; DISTRO="$(lsb_release -is)";;
23+
Linux*)
24+
PLATFORM=Linux
25+
if [ -x "$(command -v lsb_release)" ]; then
26+
DISTRO="$(lsb_release -is)"
27+
else
28+
DISTRO="CentOS"
29+
fi
30+
;;
2431
Darwin*) PLATFORM=Mac;;
2532
*) PLATFORM="UNKNOWN:${unameOut}"
2633
esac
27-
echo -e "${COLOR_GREEN}Detected platform: $PLATFORM ${COLOR_OFF}"
34+
echo -e "${COLOR_GREEN}Detected platform: $PLATFORM Distribution $DISTRO ${COLOR_OFF}"
2835
}
2936

3037
function install_dependencies_linux_default() {
@@ -83,6 +90,38 @@ function install_dependencies_linux_fedora() {
8390
gperf
8491
}
8592

93+
function install_dependencies_linux_centos() {
94+
sudo dnf install -y \
95+
$deps_universal \
96+
m4 \
97+
g++ \
98+
flex \
99+
bison \
100+
fast_float-devel \
101+
gflags-devel \
102+
glog-devel \
103+
krb5-libs \
104+
double-conversion-devel \
105+
libzstd-devel \
106+
libsodium-devel \
107+
binutils-devel \
108+
zlib-devel \
109+
make \
110+
lz4-devel \
111+
wget \
112+
unzip \
113+
snappy-devel \
114+
jemalloc-devel \
115+
boost-devel\
116+
cyrus-sasl-devel \
117+
numactl-libs \
118+
openssl-devel \
119+
libcap-devel \
120+
libevent-devel \
121+
libtool \
122+
gperf
123+
}
124+
86125
function install_dependencies_linux {
87126
deps_universal="\
88127
git \
@@ -98,6 +137,7 @@ function install_dependencies_linux {
98137

99138
case "$DISTRO" in
100139
Fedora*) install_dependencies_linux_fedora;;
140+
CentOS*) install_dependencies_linux_centos;;
101141
*) install_dependencies_linux_default;;
102142
esac
103143
}
@@ -405,7 +445,10 @@ INSTALL_DEPENDENCIES=true
405445
FETCH_DEPENDENCIES=true
406446
PREFIX=""
407447
COMPILER_FLAGS=""
408-
USAGE="./build.sh [-j num_jobs] [-m|--no-jemalloc] [--no-install-dependencies] [-p|--prefix] [-x|--compiler-flags] [--no-fetch-dependencies]"
448+
PROXY_SERVER_HOST=""
449+
PROXY_SERVER_PORT="8080"
450+
451+
USAGE="./build.sh [-j num_jobs] [-m|--no-jemalloc] [--no-install-dependencies] [-p|--prefix] [-x|--compiler-flags] [--no-fetch-dependencies] [--proxy_server_host] [--proxy_server_port]"
409452
while [ "$1" != "" ]; do
410453
case $1 in
411454
-j | --jobs ) shift
@@ -434,6 +477,14 @@ while [ "$1" != "" ]; do
434477
shift
435478
COMPILER_FLAGS=$1
436479
;;
480+
--proxy_server_host )
481+
shift
482+
PROXY_SERVER_HOST=$1
483+
;;
484+
--proxy_server_port )
485+
shift
486+
PROXY_SERVER_PORT=$1
487+
;;
437488
* ) echo $USAGE
438489
exit 1
439490
esac
@@ -464,6 +515,10 @@ mkdir -p "$DEPS_DIR"
464515
# Must execute from the directory containing this script
465516
cd "$(dirname "$0")"
466517

518+
if [ -n "$PROXY_SERVER_HOST" ]; then
519+
export https_proxy=http://$PROXY_SERVER_HOST:$PROXY_SERVER_PORT
520+
export http_proxy=http://$PROXY_SERVER_HOST:$PROXY_SERVER_PORT
521+
fi
467522
setup_fmt
468523
setup_googletest
469524
setup_zstd

0 commit comments

Comments
 (0)