diff --git a/components/core/src/clp/SQLitePreparedStatement.hpp b/components/core/src/clp/SQLitePreparedStatement.hpp index 72f5921be6..0bee5627ce 100644 --- a/components/core/src/clp/SQLitePreparedStatement.hpp +++ b/components/core/src/clp/SQLitePreparedStatement.hpp @@ -1,6 +1,7 @@ #ifndef CLP_SQLITEPREPAREDSTATEMENT_HPP #define CLP_SQLITEPREPAREDSTATEMENT_HPP +#include #include #include diff --git a/components/core/src/clp_s/Utils.hpp b/components/core/src/clp_s/Utils.hpp index 7103196c72..4bd0765d2e 100644 --- a/components/core/src/clp_s/Utils.hpp +++ b/components/core/src/clp_s/Utils.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include diff --git a/components/core/src/glt/SQLitePreparedStatement.hpp b/components/core/src/glt/SQLitePreparedStatement.hpp index 8520ae37ba..9d085bb8ff 100644 --- a/components/core/src/glt/SQLitePreparedStatement.hpp +++ b/components/core/src/glt/SQLitePreparedStatement.hpp @@ -1,6 +1,7 @@ #ifndef GLT_SQLITEPREPAREDSTATEMENT_HPP #define GLT_SQLITEPREPAREDSTATEMENT_HPP +#include #include #include diff --git a/components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/Dockerfile b/components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/Dockerfile new file mode 100644 index 0000000000..0aab83227d --- /dev/null +++ b/components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/Dockerfile @@ -0,0 +1,11 @@ +FROM quay.io/pypa/musllinux_1_2_aarch64 + +WORKDIR /root + +RUN mkdir -p ./tools/scripts/lib_install +COPY ./tools/scripts/lib_install ./tools/scripts/lib_install + +RUN ./tools/scripts/lib_install/musllinux_1_2/install-all.sh + +# Remove cached files +RUN apk cache clean --all && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* diff --git a/components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/build.sh b/components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/build.sh new file mode 100755 index 0000000000..09cc424ab3 --- /dev/null +++ b/components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/build.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +component_root="${script_dir}/../../../" + +build_cmd=( + docker buildx build + --platform linux/arm64 + --tag clp-core-dependencies-aarch64-musllinux_1_2:dev + "$component_root" + --file "${script_dir}/Dockerfile" + --load +) + +if command -v git >/dev/null && git -C "$script_dir" rev-parse --is-inside-work-tree >/dev/null ; +then + build_cmd+=( + --label "org.opencontainers.image.revision=$(git -C "$script_dir" rev-parse HEAD)" + --label "org.opencontainers.image.source=$(git -C "$script_dir" remote get-url origin)" + ) +fi + +echo "Running: ${build_cmd[*]}" +"${build_cmd[@]}" diff --git a/components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/Dockerfile b/components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/Dockerfile new file mode 100644 index 0000000000..ecdcd46e07 --- /dev/null +++ b/components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/Dockerfile @@ -0,0 +1,11 @@ +FROM quay.io/pypa/musllinux_1_2_x86_64 AS base + +WORKDIR /root + +RUN mkdir -p ./tools/scripts/lib_install +COPY ./tools/scripts/lib_install ./tools/scripts/lib_install + +RUN ./tools/scripts/lib_install/musllinux_1_2/install-all.sh + +# Remove cached files +RUN apk cache clean --all && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* diff --git a/components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/build.sh b/components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/build.sh new file mode 100755 index 0000000000..b780f24495 --- /dev/null +++ b/components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/build.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +component_root="${script_dir}/../../../" + +build_cmd=( + docker buildx build + --platform linux/amd64 + --tag clp-core-dependencies-x86-musllinux_1_2:dev + "$component_root" + --file "${script_dir}/Dockerfile" + --load +) + +if command -v git >/dev/null && git -C "$script_dir" rev-parse --is-inside-work-tree >/dev/null ; +then + build_cmd+=( + --label "org.opencontainers.image.revision=$(git -C "$script_dir" rev-parse HEAD)" + --label "org.opencontainers.image.source=$(git -C "$script_dir" remote get-url origin)" + ) +fi + +echo "Running: ${build_cmd[*]}" +"${build_cmd[@]}" diff --git a/components/core/tools/scripts/lib_install/musllinux_1_2/install-all.sh b/components/core/tools/scripts/lib_install/musllinux_1_2/install-all.sh new file mode 100755 index 0000000000..089cd6bc66 --- /dev/null +++ b/components/core/tools/scripts/lib_install/musllinux_1_2/install-all.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + +"${script_dir}/install-prebuilt-packages.sh" +"${script_dir}/install-packages-from-source.sh" + +# TODO: https://github.com/y-scope/clp/issues/795 +"${script_dir}/../check-cmake-version.sh" diff --git a/components/core/tools/scripts/lib_install/musllinux_1_2/install-packages-from-source.sh b/components/core/tools/scripts/lib_install/musllinux_1_2/install-packages-from-source.sh new file mode 100755 index 0000000000..e1f65b9bcd --- /dev/null +++ b/components/core/tools/scripts/lib_install/musllinux_1_2/install-packages-from-source.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +lib_install_scripts_dir="${script_dir}/.." + +# NOTE: The remaining installation scripts depend on boost, so we install it beforehand. +"${lib_install_scripts_dir}/install-boost.sh" 1.87.0 + +# NOTE: +# 1. libarchive may statically link with LZMA, LZ4, and Zstandard, so we install them beforehand. +# 2. The versions of libarchive, LZMA, LZ4, and Zstandard available in musllinux_1_2's package +# repositories are either dated or don't include static libraries, so we install more recent +# versions from source. +"${lib_install_scripts_dir}/liblzma.sh" 5.8.1 +"${lib_install_scripts_dir}/lz4.sh" 1.10.0 +"${lib_install_scripts_dir}/zstandard.sh" 1.5.7 +"${lib_install_scripts_dir}/libarchive.sh" 3.8.0 + +"${lib_install_scripts_dir}/msgpack.sh" 7.0.0 diff --git a/components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh b/components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh new file mode 100755 index 0000000000..e48fa79f59 --- /dev/null +++ b/components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +apk update && apk add --no-cache \ + bzip2-dev \ + bzip2-static \ + curl-dev \ + jq \ + mariadb-connector-c-dev \ + openjdk11-jdk \ + openssl-dev \ + zlib-dev \ + zlib-static + +# Determine architecture for `task` release to install +arch=$(uname -m) +case "$arch" in + "x86_64") + task_pkg_arch="amd64" + ;; + "aarch64") + task_pkg_arch="arm64" + ;; + *) + echo "Error: Unsupported architecture - $arch" + exit 1 + ;; +esac + +# Install `task` +# NOTE: We lock `task` to a version < 3.43 to avoid https://github.com/y-scope/clp/issues/872 +task_pkg_path=$(mktemp -t task-pkg.XXXXXXXXXX).tar.gz || exit 1 +curl \ + --fail \ + --location \ + --output "$task_pkg_path" \ + --show-error \ + "https://github.com/go-task/task/releases/download/v3.42.1/task_linux_${task_pkg_arch}.tar.gz" +tar -C /usr/local/bin -xzf "$task_pkg_path" task +chmod +x /usr/local/bin/task +rm "$task_pkg_path" + +# Downgrade to CMake v3 to work around https://github.com/y-scope/clp/issues/795 +pipx uninstall cmake +pipx install cmake~=3.31 diff --git a/docs/src/dev-guide/components-core/index.md b/docs/src/dev-guide/components-core/index.md index 64d33cd5f8..f58e0e2099 100644 --- a/docs/src/dev-guide/components-core/index.md +++ b/docs/src/dev-guide/components-core/index.md @@ -39,12 +39,12 @@ The task will download, build, and install (within the build directory) the foll | [ANTLR](https://www.antlr.org) | v4.13.2 | | [Catch2](https://github.com/catchorg/Catch2.git) | v2.13.7 | | [date](https://github.com/HowardHinnant/date.git) | v3.0.1 | -| [fmt](https://github.com/fmtlib/fmt) | v8.0.1 | +| [fmt](https://github.com/fmtlib/fmt) | v10.2.1 | | [json](https://github.com/nlohmann/json.git) | v3.11.3 | | [log-surgeon](https://github.com/y-scope/log-surgeon) | f801a3f | | [mongo-cxx-driver](https://github.com/mongodb/mongo-cxx-driver) | r3.10.2 | | [simdjson](https://github.com/simdjson/simdjson) | v3.13.0 | -| [spdlog](https://github.com/gabime/spdlog) | v1.9.2 | +| [spdlog](https://github.com/gabime/spdlog) | v1.14.1 | | [SQLite3](https://www.sqlite.org/download.html) | v3.36.0 | | [uftcpp](https://github.com/nemtrif/utfcpp.git) | v4.0.6 | | [yaml-cpp](https://github.com/jbeder/yaml-cpp.git) | v0.7.0 | diff --git a/docs/src/dev-guide/tooling-containers.md b/docs/src/dev-guide/tooling-containers.md index 1e43246344..fcef664133 100644 --- a/docs/src/dev-guide/tooling-containers.md +++ b/docs/src/dev-guide/tooling-containers.md @@ -35,6 +35,32 @@ distros using glibc 2.28+, including: components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64 ``` +## clp-core-dependencies-<arch>-musllinux_1_2 + +Images containing the dependencies necessary to build CLP core in a [musllinux_1_2][musllinux_1_2] +environment (aarch64 or x86). + +Binaries built on musllinux_1_2 (based on Alpine Linux 3.22) are expected to be compatible with +other distros using musl 1.2, including: + +* Alpine Linux 3.13+ + +### clp-core-dependencies-aarch64-musllinux_1_2 + +* Path: + + ```text + components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64 + ``` + +### clp-core-dependencies-x86-musllinux_1_2 + +* Path: + + ```text + components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64 + ``` + ## clp-core-dependencies-x86-centos-stream-9 An image containing the dependencies necessary to build CLP core in a CentOS Stream 9 x86 @@ -113,3 +139,4 @@ environment. [exe-ubuntu-jammy]: https://github.com/y-scope/clp/pkgs/container/clp%2Fclp-execution-x86-ubuntu-jammy [gh-packages]: https://github.com/orgs/y-scope/packages?repo_name=clp [manylinux_2_28]: https://github.com/pypa/manylinux?tab=readme-ov-file#manylinux_2_28-almalinux-8-based +[musllinux_1_2]: https://github.com/pypa/manylinux?tab=readme-ov-file#musllinux_1_2-alpine-linux-322-based-313-compatible diff --git a/taskfiles/deps/main.yaml b/taskfiles/deps/main.yaml index c05829bf76..cf47528703 100644 --- a/taskfiles/deps/main.yaml +++ b/taskfiles/deps/main.yaml @@ -214,8 +214,8 @@ tasks: - "-DFMT_DOC=OFF" - "-DFMT_TEST=OFF" LIB_NAME: "{{.G_FMT_LIB_NAME}}" - TARBALL_SHA256: "b06ca3130158c625848f3fb7418f235155a4d389b2abc3a6245fb01cb0eb1e01" - TARBALL_URL: "https://github.com/fmtlib/fmt/archive/refs/tags/8.0.1.tar.gz" + TARBALL_SHA256: "1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811" + TARBALL_URL: "https://github.com/fmtlib/fmt/archive/refs/tags/10.2.1.tar.gz" log-surgeon: internal: true @@ -302,11 +302,11 @@ tasks: - "-DSPDLOG_BUILD_EXAMPLE_HO=OFF" - "-DSPDLOG_FMT_EXTERNAL=ON" LIB_NAME: "spdlog" - TARBALL_SHA256: "6fff9215f5cb81760be4cc16d033526d1080427d236e86d70bb02994f85e3d38" + TARBALL_SHA256: "1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b" # NOTE: Since spdlog depends on fmt, we need to choose a version of spdlog that's # compatible with the version of fmt we use. - TARBALL_URL: "https://github.com/gabime/spdlog/archive/refs/tags/v1.9.2.tar.gz" + TARBALL_URL: "https://github.com/gabime/spdlog/archive/refs/tags/v1.14.1.tar.gz" sqlite3: internal: true