Skip to content

Commit

Permalink
Updated the build.sh to get Proxygen installed correctly on CentOS de…
Browse files Browse the repository at this point in the history
…v 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
  • Loading branch information
agankur21 authored and facebook-github-bot committed Feb 21, 2025
1 parent bc33985 commit 04e8f3d
Showing 1 changed file with 58 additions and 3 deletions.
61 changes: 58 additions & 3 deletions proxygen/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@ COLOR_OFF="\033[0m"
function detect_platform() {
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) PLATFORM=Linux; DISTRO="$(lsb_release -is)";;
Linux*)
PLATFORM=Linux
if [ -x "$(command -v lsb_release)" ]; then
DISTRO="$(lsb_release -is)"
else
DISTRO="CentOS"
fi
;;
Darwin*) PLATFORM=Mac;;
*) PLATFORM="UNKNOWN:${unameOut}"
esac
echo -e "${COLOR_GREEN}Detected platform: $PLATFORM ${COLOR_OFF}"
echo -e "${COLOR_GREEN}Detected platform: $PLATFORM Distribution $DISTRO ${COLOR_OFF}"
}

function install_dependencies_linux_default() {
Expand Down Expand Up @@ -83,6 +90,38 @@ function install_dependencies_linux_fedora() {
gperf
}

function install_dependencies_linux_centos() {
sudo dnf install -y \
$deps_universal \
m4 \
g++ \
flex \
bison \
fast_float-devel \
gflags-devel \
glog-devel \
krb5-libs \
double-conversion-devel \
libzstd-devel \
libsodium-devel \
binutils-devel \
zlib-devel \
make \
lz4-devel \
wget \
unzip \
snappy-devel \
jemalloc-devel \
boost-devel\
cyrus-sasl-devel \
numactl-libs \
openssl-devel \
libcap-devel \
libevent-devel \
libtool \
gperf
}

function install_dependencies_linux {
deps_universal="\
git \
Expand All @@ -98,6 +137,7 @@ function install_dependencies_linux {

case "$DISTRO" in
Fedora*) install_dependencies_linux_fedora;;
CentOS*) install_dependencies_linux_centos;;
*) install_dependencies_linux_default;;
esac
}
Expand Down Expand Up @@ -405,7 +445,10 @@ INSTALL_DEPENDENCIES=true
FETCH_DEPENDENCIES=true
PREFIX=""
COMPILER_FLAGS=""
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="8080"

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]"
while [ "$1" != "" ]; do
case $1 in
-j | --jobs ) shift
Expand Down Expand Up @@ -434,6 +477,14 @@ while [ "$1" != "" ]; do
shift
COMPILER_FLAGS=$1
;;
--proxy_server_host )
shift
PROXY_SERVER_HOST=$1
;;
--proxy_server_port )
shift
PROXY_SERVER_PORT=$1
;;
* ) echo $USAGE
exit 1
esac
Expand Down Expand Up @@ -464,6 +515,10 @@ mkdir -p "$DEPS_DIR"
# Must execute from the directory containing this script
cd "$(dirname "$0")"

if [ -n "$PROXY_SERVER_HOST" ]; then
export https_proxy=http://$PROXY_SERVER_HOST:$PROXY_SERVER_PORT
export http_proxy=http://$PROXY_SERVER_HOST:$PROXY_SERVER_PORT
fi
setup_fmt
setup_googletest
setup_zstd
Expand Down

0 comments on commit 04e8f3d

Please sign in to comment.