diff --git a/.github/workflows/TestCITools.yml b/.github/workflows/TestCITools.yml index 5672617..cee7a4b 100644 --- a/.github/workflows/TestCITools.yml +++ b/.github/workflows/TestCITools.yml @@ -35,6 +35,7 @@ jobs: override_ci_tools_repository: ${{ github.repository }} ci_tools_version: ${{ github.sha }} extra_toolchains: 'python3' + exclude_archs: 'linux_amd64_musl' extension-template-rust: name: Extension template (Rust) @@ -47,7 +48,7 @@ jobs: override_ci_tools_repository: ${{ github.repository }} ci_tools_version: ${{ github.sha }} extra_toolchains: 'rust;python3' - exclude_archs: 'windows_amd64_rtools;windows_amd64_mingw' # TODO: remove once fixed upstream + exclude_archs: 'windows_amd64_rtools;windows_amd64_mingw;linux_amd64_musl' # TODO: remove once fixed upstream delta-extension-main: name: Rust builds (using Delta extension) @@ -59,5 +60,5 @@ jobs: override_ci_tools_repository: ${{ github.repository }} ci_tools_version: ${{ github.sha }} duckdb_version: v1.1.3 - exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools;windows_amd64' + exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools;windows_amd64;linux_amd64_musl' extra_toolchains: 'rust' diff --git a/config/distribution_matrix.json b/config/distribution_matrix.json index 5de0ce0..493b265 100644 --- a/config/distribution_matrix.json +++ b/config/distribution_matrix.json @@ -15,6 +15,11 @@ "duckdb_arch": "linux_arm64", "container": "ubuntu:18.04", "vcpkg_triplet": "arm64-linux" + }, + { + "duckdb_arch": "linux_amd64_musl", + "container": "alpine:3", + "vcpkg_triplet": "x64-linux" } ] }, diff --git a/docker/linux_amd64_musl/Dockerfile b/docker/linux_amd64_musl/Dockerfile new file mode 100644 index 0000000..97cfe7b --- /dev/null +++ b/docker/linux_amd64_musl/Dockerfile @@ -0,0 +1,84 @@ +FROM alpine:3 + +### +# Base image setup +### + +# Setup the basic necessities +RUN apk update --y -qq +RUN apk add -qq ccache cmake git ninja ninja-build clang19 gcc libssl3 wget bash zip gettext unzip build-base curl make libffi-dev zlib openssh autoconf linux-headers + +# Setup VCPKG n a mounted volume TODO: figure out how to cache this +ARG vcpkg_url +ARG vcpkg_commit +RUN mkdir /vcpkg && \ + cd /vcpkg && \ + git init && \ + git remote add origin $vcpkg_url && \ + git fetch origin $vcpkg_commit && \ + git checkout $vcpkg_commit && \ + VCPKG_FORCE_SYSTEM_BINARIES=1 ./bootstrap-vcpkg.sh +ENV VCPKG_ROOT=/vcpkg +ENV VCPKG_TOOLCHAIN_PATH=/vcpkg/scripts/buildsystems/vcpkg.cmake + +# Common environment variables +ENV GEN=ninja +ENV DUCKDB_PLATFORM=linux_amd64_musl +ENV VCPKG_FORCE_SYSTEM_BINARIES=1 + +# Specify where we expect the extension to be mounted and use that as working dir +VOLUME /duckdb_build_dir +WORKDIR /duckdb_build_dir + +# Mount for ccache to allow restoring ccache in GH actions +VOLUME /ccache_dir +ENV CCACHE_DIR=/ccache_dir +ENV CCACHE_COMPRESS=TRUE +ENV CCACHE_COMPRESSLEVEL=6 +ENV CCACHE_MAXSIZE=400M + +### +# Conditionally configure some extra dependencies +### +# a `;` separated list of extra toolchains to install (passed in like this to makes things easier through GitHub Actions) +# Note that it should start and end with a `;` e.g. `;rust;parser_tools;` +ARG extra_toolchains + +# NOTE: the weird case conditionals are because of bash limitations in the ubuntu image used (see https://stackoverflow.com/questions/229551/how-to-check-if-a-string-contains-a-substring-in-bash) + +# Install Parser tools +RUN case "$extra_toolchains" in \ + *\;parser_tools\;*) \ + apk add -qq bison flex \ + ;; \ +esac + +# Install Fortran +RUN case "$extra_toolchains" in \ + *\;fortran\;*) \ + apk add -qq gfortran \ + ;; \ +esac + +# Configure Rust +RUN case "$extra_toolchains" in \ + *\;rust\;*) \ + curl https://sh.rustup.rs -sSf | bash -s -- -y \ + ;; \ +esac +ENV PATH="/root/.cargo/bin:${PATH}" + +# Configure go +RUN case "$extra_toolchains" in \ + *\;go\;*) \ + apk add -qq go \ + ;; \ +esac +ENV PATH="/usr/local/go/bin:${PATH}" + +# Install Python3 +RUN case "$extra_toolchains" in \ + *\;python3\;*) \ + apk add -qq python3 \ + ;; \ +esac