bneradt commented on code in PR #9606:
URL: https://github.com/apache/trafficserver/pull/9606#discussion_r1178246237


##########
tools/build_h3_tools.sh:
##########
@@ -68,13 +72,59 @@ else
   num_threads=$(sysctl -n hw.logicalcpu)
 fi
 
+# boringssl
+echo "Building boringssl..."
+
+# We need this go version.
+if [ ! -d ${BASE}/go ]; then
+  sudo mkdir ${BASE}/go
+fi

Review Comment:
   mkdir's `-p` makes this more simple:
   
   ```sh
   sudo mkdir -p ${BASE}/go
   ```



##########
tools/build_h3_tools.sh:
##########
@@ -68,13 +72,59 @@ else
   num_threads=$(sysctl -n hw.logicalcpu)
 fi
 
+# boringssl
+echo "Building boringssl..."
+
+# We need this go version.
+if [ ! -d ${BASE}/go ]; then
+  sudo mkdir ${BASE}/go
+fi
+
+if [ `uname -m` = "arm64" ]; then
+    ARCH="arm64"
+else
+    ARCH="amd64"
+fi
+
+if [ `uname -s` = "Darwin" ]; then
+    OS="darwin"
+else
+    OS="linux"
+fi
+
+wget https://go.dev/dl/go1.20.1.${OS}-${ARCH}.tar.gz
+sudo rm -rf ${BASE}/go && sudo tar -C ${BASE} -xf go1.20.1.${OS}-${ARCH}.tar.gz
+rm go1.20.1.${OS}-${ARCH}.tar.gz
+
+GO_BINARY_PATH=${BASE}/go/bin/go
+if [ ! -d boringssl ]; then
+  git clone https://boringssl.googlesource.com/boringssl
+  cd boringssl
+  git checkout 31bad2514d21f6207f3925ba56754611c462a873
+  cd ..
+fi
+cd boringssl
+if [ ! -d build ]; then
+  mkdir build
+fi
+cd build
+cmake \
+  -DGO_EXECUTABLE=${GO_BINARY_PATH} \
+  -DCMAKE_INSTALL_PREFIX=${BASE}/boringssl \
+  -DCMAKE_BUILD_TYPE=Release \
+  -DBUILD_SHARED_LIBS=1 ../
+
+${MAKE} -j ${num_threads}
+sudo ${MAKE} install
+cd ..
+
 # Build quiche
 # Steps borrowed from: 
https://github.com/apache/trafficserver-ci/blob/main/docker/rockylinux8/Dockerfile
 echo "Building quiche"
-QUICHE_BASE=${BASE:-"/opt/quiche"}
+if [ -z ${BASE+x} ]; then QUICHE_BASE="/opt/quiche"; else 
QUICHE_BASE=${BASE}/quiche; fi

Review Comment:
   We should be able to:
   
   ```sh
   QUICHE_BASE="${BASE:-/opt}/quiche"
   ```
   
   For example:
   ```sh
   ╰─➤  unset BASE
   ╰─➤  echo ${BASE:-/opt}/quiche
   /opt/quiche
   ╰─➤  BASE=/candy
   ╰─➤  echo ${BASE:-/opt}/quiche
   /candy/quiche
   
   ```



##########
tools/build_h3_tools.sh:
##########
@@ -68,13 +72,59 @@ else
   num_threads=$(sysctl -n hw.logicalcpu)
 fi
 
+# boringssl
+echo "Building boringssl..."
+
+# We need this go version.
+if [ ! -d ${BASE}/go ]; then
+  sudo mkdir ${BASE}/go
+fi
+
+if [ `uname -m` = "arm64" ]; then
+    ARCH="arm64"
+else
+    ARCH="amd64"
+fi
+
+if [ `uname -s` = "Darwin" ]; then
+    OS="darwin"
+else
+    OS="linux"
+fi
+
+wget https://go.dev/dl/go1.20.1.${OS}-${ARCH}.tar.gz
+sudo rm -rf ${BASE}/go && sudo tar -C ${BASE} -xf go1.20.1.${OS}-${ARCH}.tar.gz
+rm go1.20.1.${OS}-${ARCH}.tar.gz
+
+GO_BINARY_PATH=${BASE}/go/bin/go
+if [ ! -d boringssl ]; then
+  git clone https://boringssl.googlesource.com/boringssl
+  cd boringssl
+  git checkout 31bad2514d21f6207f3925ba56754611c462a873
+  cd ..
+fi
+cd boringssl
+if [ ! -d build ]; then
+  mkdir build
+fi

Review Comment:
   ```sh
   mkdir -p build
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to