Skip to content

Commit

Permalink
Merge pull request #14647 from rgacogne/ddist19-backport-14529
Browse files Browse the repository at this point in the history
dnsdist-1.9.x: Backport 14529 - Update Quiche to 0.22.0 (in our packages)
  • Loading branch information
rgacogne authored Sep 10, 2024
2 parents c0d3b04 + e0269ad commit de932cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
3 changes: 3 additions & 0 deletions builder-support/helpers/install_quiche.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ echo $0: Checking that the hash of ${QUICHE_TARBALL} is ${QUICHE_TARBALL_HASH}
echo "${QUICHE_TARBALL_HASH}" "${QUICHE_TARBALL}" | sha256sum -c -
tar xf "${QUICHE_TARBALL}"
cd "quiche-${QUICHE_VERSION}"
# Disable SONAME in the quiche shared library, we do not intend this library to be used by anyone else and it makes things more complicated since we rename it to libdnsdist-quiche
sed -i 's/ffi = \["dep:cdylib-link-lines"\]/ffi = \[\]/' quiche/Cargo.toml
sed -i 's,cdylib_link_lines::metabuild();,//cdylib_link_lines::metabuild();,' quiche/src/build.rs
RUST_BACKTRACE=1 cargo build --release --no-default-features --features ffi,boringssl-boring-crate --package quiche

install -m644 quiche/include/quiche.h "${INSTALL_PREFIX}"/include
Expand Down
4 changes: 2 additions & 2 deletions builder-support/helpers/quiche.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "0.20.1",
"version": "0.22.0",
"license": "BSD-2-Clause",
"publisher": "https://github.com/cloudflare/quiche",
"SHA256SUM": "9c460d8ecf6c80c06bf9b42f91201ef33f912e2615a871ff2d0e50197b901c71"
"SHA256SUM": "0af8744b07038ee4af8cdb94dd4c11f1a730001944a0ef2f3f03e63715b15268"
}
32 changes: 8 additions & 24 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,30 +924,14 @@ def coverity_upload(c, email, project, tarball):

@task
def ci_build_and_install_quiche(c, repo):
with open(f'{repo}/builder-support/helpers/quiche.json') as quiche_json:
quiche_data = json.load(quiche_json)
quiche_version = quiche_data['version']
quiche_hash = quiche_data['SHA256SUM']

# we have to pass -L because GitHub will do a redirect, sadly
c.run(f'curl -L -o quiche-{quiche_version}.tar.gz https://github.com/cloudflare/quiche/archive/{quiche_version}.tar.gz')
# Line below should echo two spaces between digest and name
c.run(f'echo {quiche_hash}" "quiche-{quiche_version}.tar.gz | sha256sum -c -')
c.run(f'tar xf quiche-{quiche_version}.tar.gz')
with c.cd(f'quiche-{quiche_version}'):
c.run('cargo build --release --no-default-features --features ffi,boringssl-boring-crate --package quiche')
# cannot use c.sudo() inside a cd() context, see https://github.com/pyinvoke/invoke/issues/687
c.run('sudo install -Dm644 quiche/include/quiche.h /usr/include')
c.run('sudo install -Dm644 target/release/libquiche.so /usr/lib')
c.run('install -D target/release/libquiche.so /opt/dnsdist/lib/libquiche.so')
c.run(f"""sudo install -Dm644 /dev/stdin /usr/lib/pkgconfig/quiche.pc <<PC
# quiche
Name: quiche
Description: quiche library
URL: https://github.com/cloudflare/quiche
Version: {quiche_version}
Libs: -lquiche
PC""")
with c.cd(f'{repo}/builder-support/helpers/'):
c.run(f'sudo {repo}/builder-support/helpers/install_quiche.sh')

# cannot use c.sudo() inside a cd() context, see https://github.com/pyinvoke/invoke/issues/687
c.run('sudo mv /usr/lib/libdnsdist-quiche.so /usr/lib/libquiche.so')
c.run("sudo sed -i 's,^Libs:.*,Libs: -lquiche,g' /usr/lib/pkgconfig/quiche.pc")
c.run('mkdir -p /opt/dnsdist/lib')
c.run('cp /usr/lib/libquiche.so /opt/dnsdist/lib/libquiche.so')

# this is run always
def setup():
Expand Down

0 comments on commit de932cc

Please sign in to comment.