diff --git a/tools/snap/build.sh b/tools/snap/build.sh deleted file mode 100755 index c9392f909..000000000 --- a/tools/snap/build.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# Cross-compile the Certbot snap from local sources for the specified architecture. -# This script is designed for CI tests purpose. -# Usage: build.sh [amd64,arm64,armhf] -set -ex - -SNAP_ARCH=$1 - -if [[ -z "${SNAP_ARCH}" ]]; then - echo "You need to specify the target architecture" - exit 1 -fi - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -CERTBOT_DIR="$(dirname "$(dirname "${DIR}")")" - -# shellcheck source=common.sh -source "${DIR}/common.sh" - -RegisterQemuHandlers -ResolveArch "${SNAP_ARCH}" - -pushd "${DIR}/packages" -"${CERTBOT_DIR}/tools/simple_http_server.py" 8080 >/dev/null 2>&1 & -HTTP_SERVER_PID="$!" -popd - -function cleanup() { - kill "${HTTP_SERVER_PID}" -} - -trap cleanup EXIT - -# NB: We use ARCH-stable-save tag instead of ARCH-stable, because recent versions of snapcraft images -# behave badly on QEMU for arm64 architecture. This should be fixed either by a new version of the -# image that does not have this problem anymore, or the migration to snapcraft remote builds. -docker run \ - --rm \ - --net=host \ - -v "${CERTBOT_DIR}:/certbot" \ - -w "/certbot" \ - -e "PIP_EXTRA_INDEX_URL=http://localhost:8080" \ - "adferrand/snapcraft:${DOCKER_ARCH}-stable-save" \ - bash -c "snapcraft clean && snapcraft" diff --git a/tools/snap/build_dns.sh b/tools/snap/build_dns.sh deleted file mode 100755 index 5ebad2969..000000000 --- a/tools/snap/build_dns.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -# Cross-compile the specified Certbot DNS plugins snaps from local sources for the specified architecture. -# This script is designed for CI tests purpose. -# Usage: build.sh [amd64,arm64,armhf] [DNS_PLUGIN1,DNS_PLUGIN2 or ALL] -set -ex - -SNAP_ARCH=$1 -DNS_PLUGINS=$2 - -if [[ -z "${SNAP_ARCH}" ]]; then - echo "You need to specify the target architecture" - exit 1 -fi - -if [[ -z "${DNS_PLUGINS}" ]]; then - echo "You need to specify the DNS plugins" - exit 1 -fi - -if [[ "${DNS_PLUGINS}" = "ALL" ]]; then - DNS_PLUGINS=$(find . -maxdepth 1 -type d -name "certbot-dns-*" -exec basename {} \; | paste -sd "," -) -fi - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -CERTBOT_DIR="$(dirname "$(dirname "${DIR}")")" - -# shellcheck source=common.sh -source "${DIR}/common.sh" - -RegisterQemuHandlers -ResolveArch "${SNAP_ARCH}" - -pushd "${DIR}/packages" -"${CERTBOT_DIR}/tools/simple_http_server.py" 8080 >/dev/null 2>&1 & -HTTP_SERVER_PID="$!" -popd - -function cleanup() { - kill "${HTTP_SERVER_PID}" -} - -trap cleanup EXIT - -SCRIPT=$(mktemp /tmp/script.XXXXXX.sh) -chmod +x "${SCRIPT}" - -SNAP_CONSTRAINTS=$(mktemp /tmp/snap-constraints.XXXXXX.txt) -python3 tools/strip_hashes.py letsencrypt-auto-source/pieces/dependency-requirements.txt | grep -v python-augeas > "${SNAP_CONSTRAINTS}" - -cat << "EOF" >> "${SCRIPT}" -#!/bin/bash -set -ex -IFS="," -for DNS_PLUGIN in ${DNS_PLUGINS}; do - pushd "${DNS_PLUGIN}" - cp /snap-constraints.txt . - snapcraft clean - snapcraft - popd -done -EOF - -# NB: We use ARCH-stable-save tag instead of ARCH-stable, because recent versions of snapcraft images -# behave badly on QEMU for arm64 architecture. This should be fixed either by a new version of the -# image that does not have this problem anymore, or the migration to snapcraft remote builds. -docker run \ - --rm \ - --net=host \ - -v "${CERTBOT_DIR}:/certbot" \ - -v "${SCRIPT}:/script.sh" \ - -v "${SNAP_CONSTRAINTS}:/snap-constraints.txt" \ - -w "/certbot" \ - -e "DNS_PLUGINS=${DNS_PLUGINS}" \ - -e "PIP_EXTRA_INDEX_URL=http://localhost:8080" \ - "adferrand/snapcraft:${DOCKER_ARCH}-stable-save" \ - /script.sh diff --git a/tools/snap/common.sh b/tools/snap/common.sh deleted file mode 100644 index 7fc44e8ba..000000000 --- a/tools/snap/common.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Common bash functions useful for cross-compiling Certbot snaps. - -# Resolve the Snap architecture to Docker architecture (DOCKER_ARCH variable) -# and QEMU architecture (QEMU_ARCH variable). -# Usage: ResolveArch [amd64|arm64|armhf] -ResolveArch() { - local SNAP_ARCH=$1 - - case "${SNAP_ARCH}" in - "amd64") - DOCKER_ARCH="amd64" - QEMU_ARCH="x86_64" - ;; - "arm64") - DOCKER_ARCH="arm64v8" - QEMU_ARCH="aarch64" - ;; - "armhf") - DOCKER_ARCH="arm32v7" - QEMU_ARCH="arm" - ;; - "*") - echo "Not supported build architecture '$1'." >&2 - exit 1 - esac -} - -# Downloads QEMU static binary file for architecture -# Usage: DownloadQemuStatic [x86_64|aarch64|arm] DEST_DIR -DownloadQemuStatic() { - local QEMU_ARCH=$1 - local DEST_DIR=$2 - local QEMU_DOWNLOAD_URL - local QEMU_LATEST_TAG - - if [ ! -f "${DIR}/qemu-${QEMU_ARCH}-static" ]; then - QEMU_DOWNLOAD_URL="https://github.com/multiarch/qemu-user-static/releases/download" - QEMU_LATEST_TAG=$(curl -s https://api.github.com/repos/multiarch/qemu-user-static/tags \ - | grep 'name.*v[0-9]' \ - | head -n 1 \ - | cut -d '"' -f 4) - echo "${QEMU_DOWNLOAD_URL}/${QEMU_LATEST_TAG}/x86_64_qemu-${QEMU_ARCH}-static.tar.gz" - curl -SL "${QEMU_DOWNLOAD_URL}/${QEMU_LATEST_TAG}/x86_64_qemu-${QEMU_ARCH}-static.tar.gz" \ - | tar xzv -C "${DEST_DIR}" - fi -} - -# Executes the QEMU register script -# Usage: RegisterQemuHandlers -RegisterQemuHandlers() { - docker run --rm --privileged multiarch/qemu-user-static:register --reset -} diff --git a/tools/snap/compile_native_wheels.sh b/tools/snap/compile_native_wheels.sh deleted file mode 100755 index cabbf99e7..000000000 --- a/tools/snap/compile_native_wheels.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Cross-compile cryptography and cffi native wheels for arm64 and armhf architectures, -# on the versions required by the current pinning of Certbot dependencies. -# Wheels are stored in snap/local/packages folder to speed up cross-compilation of Certbot snap. -set -ex - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -TARGET_ARCHS="arm64 armhf" - -rm -rf "${DIR}/packages/"* - -# shellcheck source=common.sh -source "${DIR}/common.sh" - -RegisterQemuHandlers - -tools/strip_hashes.py letsencrypt-auto-source/pieces/dependency-requirements.txt \ - | grep -v python-augeas > "${DIR}/snap-constraints.txt" -for SNAP_ARCH in ${TARGET_ARCHS}; do - ResolveArch "${SNAP_ARCH}" - DownloadQemuStatic "${QEMU_ARCH}" "${DIR}" - - docker run \ - --rm \ - -v "${DIR}/qemu-${QEMU_ARCH}-static:/usr/bin/qemu-${QEMU_ARCH}-static" \ - -v "${DIR}:/workspace" \ - -w "/workspace" \ - "${DOCKER_ARCH}/ubuntu:20.04" \ - sh -c "\ - apt-get update \ -&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3 python3-venv python3-dev libffi-dev libssl-dev gcc \ -&& mkdir -p /build \ -&& python3 -m venv /build/venv \ -&& /build/venv/bin/pip install wheel \ -&& /build/venv/bin/pip wheel cryptography cffi -c snap-constraints.txt -w /build \ -&& mkdir -p /workspace/packages/cffi /workspace/packages/cryptography \ -&& mv /build/cryptography-* /workspace/packages/cryptography \ -&& mv /build/cffi-* /workspace/packages/cffi \ -&& chmod 777 /workspace/packages /workspace/packages/cffi /workspace/packages/cryptography \ -&& chmod 666 /workspace/packages/cffi/* /workspace/packages/cryptography/* -" -done diff --git a/tools/snap/packages/cffi/cffi-1.14.0-cp38-cp38-linux_aarch64.whl b/tools/snap/packages/cffi/cffi-1.14.0-cp38-cp38-linux_aarch64.whl deleted file mode 100644 index aded6d595..000000000 Binary files a/tools/snap/packages/cffi/cffi-1.14.0-cp38-cp38-linux_aarch64.whl and /dev/null differ diff --git a/tools/snap/packages/cffi/cffi-1.14.0-cp38-cp38-linux_armv7l.whl b/tools/snap/packages/cffi/cffi-1.14.0-cp38-cp38-linux_armv7l.whl deleted file mode 100644 index 4f6d0ab7d..000000000 Binary files a/tools/snap/packages/cffi/cffi-1.14.0-cp38-cp38-linux_armv7l.whl and /dev/null differ diff --git a/tools/snap/packages/cryptography/cryptography-2.8-cp38-cp38-linux_aarch64.whl b/tools/snap/packages/cryptography/cryptography-2.8-cp38-cp38-linux_aarch64.whl deleted file mode 100644 index e0392fcd4..000000000 Binary files a/tools/snap/packages/cryptography/cryptography-2.8-cp38-cp38-linux_aarch64.whl and /dev/null differ diff --git a/tools/snap/packages/cryptography/cryptography-2.8-cp38-cp38-linux_armv7l.whl b/tools/snap/packages/cryptography/cryptography-2.8-cp38-cp38-linux_armv7l.whl deleted file mode 100644 index 38ee1eada..000000000 Binary files a/tools/snap/packages/cryptography/cryptography-2.8-cp38-cp38-linux_armv7l.whl and /dev/null differ