From 193729391c26190458c03dca613c02fb4beb56be Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 20 Aug 2024 15:38:09 +0200 Subject: [PATCH] dnsdist: Deduplicate the Quiche installation steps --- tasks.py | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/tasks.py b/tasks.py index 6b13d5839d..65c58d0d14 100644 --- a/tasks.py +++ b/tasks.py @@ -1048,33 +1048,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}'): - # 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 - c.run('sed -i \'s/ffi = \["dep:cdylib-link-lines"\]/ffi = \[\]/\' quiche/Cargo.toml') - c.run('sed -i \'s,cdylib_link_lines::metabuild();,//cdylib_link_lines::metabuild();,\' quiche/src/build.rs') - 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 <