-
Notifications
You must be signed in to change notification settings - Fork 844
tools: H3 tools build script. Add go+boringssl #9606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bneradt
merged 5 commits into
apache:master
from
brbzull0:add_boringssl_to_h3_tools_script
Apr 27, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
116fd23
tools: H3 tools build script. Add go+boringssl
brbzull0 9228cf1
Include cargo/rust notes.
brbzull0 b4c9c7e
Fix the order of the deps build.
brbzull0 585ef20
Small tweaks
brbzull0 79146c4
update openssl version and some other minor tweak
brbzull0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ | |
| set -e | ||
|
|
||
| # Update this as the draft we support updates. | ||
| OPENSSL_BRANCH=${OPENSSL_BRANCH:-"OpenSSL_1_1_1q+quic"} | ||
| OPENSSL_BRANCH=${OPENSSL_BRANCH:-"OpenSSL_1_1_1t+quic"} | ||
|
|
||
| # Set these, if desired, to change these to your preferred installation | ||
| # directory | ||
|
|
@@ -43,7 +43,9 @@ if [ -e /etc/redhat-release ]; then | |
| echo "| |" | ||
| echo "| sudo yum -y install libev-devel jemalloc-devel python2-devel |" | ||
| echo "| sudo yum -y install libxml2-devel c-ares-devel libevent-devel |" | ||
| echo "| sudo yum -y install jansson-devel zlib-devel systemd-devel |" | ||
| echo "| sudo yum -y install jansson-devel zlib-devel systemd-devel cargo |" | ||
| echo "| |" | ||
| echo "| Rust may be needed too, see https://rustup.rs for the details |" | ||
| echo "+-------------------------------------------------------------------------+" | ||
| echo | ||
| echo | ||
|
|
@@ -53,7 +55,9 @@ elif [ -e /etc/debian_version ]; then | |
| echo "| |" | ||
| echo "| sudo apt -y install libev-dev libjemalloc-dev python2-dev libxml2-dev |" | ||
| echo "| sudo apt -y install libpython2-dev libc-ares-dev libsystemd-dev |" | ||
| echo "| sudo apt -y install libevent-dev libjansson-dev zlib1g-dev |" | ||
| echo "| sudo apt -y install libevent-dev libjansson-dev zlib1g-dev cargo |" | ||
| echo "| |" | ||
| echo "| Rust may be needed too, see https://rustup.rs for the details |" | ||
| echo "+-------------------------------------------------------------------------+" | ||
| echo | ||
| echo | ||
|
|
@@ -68,13 +72,57 @@ else | |
| num_threads=$(sysctl -n hw.logicalcpu) | ||
| fi | ||
|
|
||
| # boringssl | ||
| echo "Building boringssl..." | ||
|
|
||
| # We need this go version. | ||
| sudo mkdir -p ${BASE}/go | ||
|
|
||
| if [ `uname -m` = "arm64" -o `uname -m` = "aarch64" ]; 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 -p 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"} | ||
| QUICHE_BASE="${BASE:-/opt}/quiche" | ||
| [ ! -d quiche ] && git clone --recursive https://github.com/cloudflare/quiche.git | ||
| cd quiche | ||
| cargo build -j4 --package quiche --release --features ffi,pkg-config-meta,qlog | ||
| QUICHE_BSSL_PATH=${BASE}/boringssl QUICHE_BSSL_LINK_KIND=dylib cargo build -j4 --package quiche --release --features ffi,pkg-config-meta,qlog | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we use the libs from the boringssl we just built. |
||
| sudo mkdir -p ${QUICHE_BASE}/lib/pkgconfig | ||
| sudo mkdir -p ${QUICHE_BASE}/include | ||
| sudo cp target/release/libquiche.a ${QUICHE_BASE}/lib/ | ||
|
|
@@ -167,7 +215,7 @@ ${MAKE} -j ${num_threads} | |
| sudo ${MAKE} install | ||
| cd .. | ||
|
|
||
| # And finally curl | ||
| # Then curl | ||
| echo "Building curl ..." | ||
| [ ! -d curl ] && git clone --branch curl-7_88_1 https://github.com/curl/curl.git | ||
| cd curl | ||
|
|
@@ -185,3 +233,4 @@ autoreconf -fi || autoreconf -fi | |
| LDFLAGS="${LDFLAGS}" | ||
| ${MAKE} -j ${num_threads} | ||
| sudo ${MAKE} install | ||
| cd .. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.