From ec4ebe818f4c2279308f2a39baf62599bf6d6d7c Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Mon, 26 Jan 2026 17:06:24 +0000 Subject: [PATCH 01/12] Alternative fix for lean mathlib. --- build-bench-env.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-bench-env.sh b/build-bench-env.sh index 2d5a181..711a3bd 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -71,6 +71,7 @@ readonly version_rmalloc=master # benchmark versions readonly version_redis=6.2.7 readonly version_lean=21d264a66d53b0a910178ae7d9529cb5886a39b6 # build fix for recent compilers +readonly version_mathlib=release_812 readonly version_rocksdb=10.10.1 readonly version_lua=v5.4.7 readonly version_linux=6.5.1 @@ -842,8 +843,8 @@ if test "$setup_lean" = "1"; then echo "make -j$procs" make -j $procs rm -rf ./tests/ # we don't need tests - mkdir -p "$devdir/mathlib" - cp -u "$devdir/lean/leanpkg/leanpkg.toml" "$devdir/mathlib" + popd + checkout mathlib $version_mathlib https://github.com/leanprover-community/mathlib3 popd fi From 469009c51823e3237fa218f4fdf74496e1e29138 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 13:56:09 +0100 Subject: [PATCH 02/12] Fix Bazel apt repository setup --- build-bench-env.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-bench-env.sh b/build-bench-env.sh index 711a3bd..2cb635e 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -427,9 +427,9 @@ function aptinstallbazel { echo "> installing bazel" echo "" aptinstall apt-transport-https curl gnupg - curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg - $SUDO mv bazel.gpg /etc/apt/trusted.gpg.d/bazel.gpg - echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | $SUDO tee /etc/apt/sources.list.d/bazel.list + curl -fsSL https://releases.bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel-archive-keyring.gpg + $SUDO mv bazel-archive-keyring.gpg /usr/share/keyrings + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | $SUDO tee /etc/apt/sources.list.d/bazel.list $SUDO apt update -qq aptinstall bazel } From b6cd4987d967d92b69749602f72a5fe7fcdccf00 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 13:58:27 +0100 Subject: [PATCH 03/12] Install Fedora static libstdc++ runtime --- build-bench-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-bench-env.sh b/build-bench-env.sh index 2cb635e..7cdaec2 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -460,7 +460,7 @@ if test "$setup_packages" = "1"; then # no 'apt update' equivalent needed on Fedora dnfinstall "gcc-c++ clang lld llvm-devel unzip dos2unix bc gmp-devel wget gawk \ cmake python3 ruby ninja-build libtool autoconf git patch time sed \ - ghostscript libatomic libstdc++ which gflags-devel xz readline-devel snappy-devel" + ghostscript libatomic libstdc++ libstdc++-static which gflags-devel xz readline-devel snappy-devel" # bazel5 is broken on the copr: https://github.com/bazelbuild/bazel/issues/19295 #dnfinstallbazel elif grep -q -e 'ID=debian' -e 'ID=ubuntu' /etc/os-release 2>/dev/null; then From c4db9b043c333f6aa86e4b52e5395778832adef5 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 14:00:00 +0100 Subject: [PATCH 04/12] Install Bazelisk for Fedora tcmalloc builds --- build-bench-env.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build-bench-env.sh b/build-bench-env.sh index 7cdaec2..07f721c 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -436,11 +436,9 @@ function aptinstallbazel { function dnfinstallbazel { echo "" - echo "> installing bazel" + echo "> installing bazelisk" echo "" - dnfinstall dnf-plugins-core - $SUDO dnf copr -y enable vbatts/bazel - dnfinstall bazel5 + dnfinstall bazelisk } if test "$all" = "1"; then @@ -461,8 +459,7 @@ if test "$setup_packages" = "1"; then dnfinstall "gcc-c++ clang lld llvm-devel unzip dos2unix bc gmp-devel wget gawk \ cmake python3 ruby ninja-build libtool autoconf git patch time sed \ ghostscript libatomic libstdc++ libstdc++-static which gflags-devel xz readline-devel snappy-devel" - # bazel5 is broken on the copr: https://github.com/bazelbuild/bazel/issues/19295 - #dnfinstallbazel + dnfinstallbazel elif grep -q -e 'ID=debian' -e 'ID=ubuntu' /etc/os-release 2>/dev/null; then echo "updating package database... ($SUDO apt update)" $SUDO apt update -qq @@ -634,7 +631,11 @@ fi if test "$setup_tcg" = "1"; then checkout tcg $version_tcg https://github.com/google/tcmalloc - bazel build -c opt tcmalloc + if command -v bazelisk > /dev/null; then + bazelisk build -c opt tcmalloc + else + bazel build -c opt tcmalloc + fi popd fi From 34ef533cef388403a821b5fca311ca30d1af92a7 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 14:02:17 +0100 Subject: [PATCH 05/12] Fix jemalloc build with recent libstdc++ --- build-bench-env.sh | 3 +++ patches/jemalloc.patch | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 patches/jemalloc.patch diff --git a/build-bench-env.sh b/build-bench-env.sh index 07f721c..1386596 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -651,6 +651,9 @@ fi if test "$setup_je" = "1"; then checkout je $version_je https://github.com/jemalloc/jemalloc + if grep -q 'std::__throw_bad_alloc' src/jemalloc_cpp.cpp; then + patch -p1 < ../../patches/jemalloc.patch + fi if test -f config.status; then echo "$devdir/jemalloc is already configured; no need to reconfigure" else diff --git a/patches/jemalloc.patch b/patches/jemalloc.patch new file mode 100644 index 0000000..01b49dc --- /dev/null +++ b/patches/jemalloc.patch @@ -0,0 +1,12 @@ +diff --git a/src/jemalloc_cpp.cpp b/src/jemalloc_cpp.cpp +--- a/src/jemalloc_cpp.cpp ++++ b/src/jemalloc_cpp.cpp +@@ -100,7 +100,7 @@ handleOOM(std::size_t size, bool nothrow) { + } + + if (ptr == nullptr && !nothrow) +- std::__throw_bad_alloc(); ++ throw std::bad_alloc(); + return ptr; + } + \ No newline at end of file From 609198b0f2d97c4a33eb1730cc4577ffa055750d Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 14:12:16 +0100 Subject: [PATCH 06/12] Fix hardened_malloc with recent libstdc++ --- build-bench-env.sh | 3 +++ patches/hardened_malloc.patch | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 patches/hardened_malloc.patch diff --git a/build-bench-env.sh b/build-bench-env.sh index 1386596..454b1c5 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -492,6 +492,9 @@ fi if test "$setup_hm" = "1"; then checkout hm $version_hm https://github.com/GrapheneOS/hardened_malloc + if grep -q 'std::__throw_bad_alloc' new.cc; then + patch -p1 < ../../patches/hardened_malloc.patch + fi make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=light -j $proc make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=default -j $proc popd diff --git a/patches/hardened_malloc.patch b/patches/hardened_malloc.patch new file mode 100644 index 0000000..bb44d26 --- /dev/null +++ b/patches/hardened_malloc.patch @@ -0,0 +1,26 @@ +diff --git a/new.cc b/new.cc +--- a/new.cc ++++ b/new.cc +@@ -1,4 +1,3 @@ +-#include + #include + + #include "h_malloc.h" +@@ -21,7 +20,7 @@ COLD static void *handle_out_of_memory(size_t size, bool nothrow) { + } while (ptr == nullptr); + + if (ptr == nullptr && !nothrow) { +- std::__throw_bad_alloc(); ++ throw std::bad_alloc(); + } + return ptr; + } +@@ -93,7 +92,7 @@ COLD static void *handle_out_of_memory(size_t size, size_t alignment, bool nothr + } while (ptr == nullptr); + + if (ptr == nullptr && !nothrow) { +- std::__throw_bad_alloc(); ++ throw std::bad_alloc(); + } + return ptr; + } \ No newline at end of file From 087b1b09d69bbb15d7e8ce0c647265dc2372b572 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 14:12:51 +0100 Subject: [PATCH 07/12] Fix hardened_malloc parallel build variable --- build-bench-env.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-bench-env.sh b/build-bench-env.sh index 454b1c5..0ebfa47 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -495,8 +495,8 @@ if test "$setup_hm" = "1"; then if grep -q 'std::__throw_bad_alloc' new.cc; then patch -p1 < ../../patches/hardened_malloc.patch fi - make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=light -j $proc - make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=default -j $proc + make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=light -j $procs + make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=default -j $procs popd fi From 4c857609b8f477392878eaa79077088be50bc4c8 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 14:13:54 +0100 Subject: [PATCH 08/12] Pin Fedora and Alpine release branches --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe54d99..fe8be1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,10 @@ ARG platform=ubuntu FROM ubuntu:24.04 AS ubuntu -FROM fedora:latest AS fedora +FROM fedora:44 AS fedora -FROM alpine:latest AS alpine +FROM alpine:3.24 AS alpine RUN apk add --no-cache bash From fdcd431e0a5e1e0f9faf61faa1b1c7281bc86b9e Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 14:14:41 +0100 Subject: [PATCH 09/12] Upgrade GitHub Actions to Node 24 releases --- .github/workflows/platform.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index fc6ddc6..2ebda71 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -13,14 +13,14 @@ jobs: name: Base Container steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v7 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v4 - name: Build benchmarks in Docker id: docker_build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v7 with: context: . file: Dockerfile @@ -77,14 +77,14 @@ jobs: name: ${{ matrix.allocator }} - build and benchmark steps: - name: Check out repository code - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v4 - name: Build allocator and run benchmarks in Docker id: docker_build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v7 with: context: . file: Dockerfile From 388fd72f0870aa088f00bf5b4561681cfe2696aa Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 14:24:25 +0100 Subject: [PATCH 10/12] Pin Bazel 8 for tcmalloc compatibility --- build-bench-env.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build-bench-env.sh b/build-bench-env.sh index 0ebfa47..6809a7e 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -75,6 +75,7 @@ readonly version_mathlib=release_812 readonly version_rocksdb=10.10.1 readonly version_lua=v5.4.7 readonly version_linux=6.5.1 +readonly version_bazel=8.8.0 # HTTP-downloaded files checksums readonly sha256sum_sh6bench="506354d66b9eebef105d757e055bc55e8d4aea1e7b51faab3da35b0466c923a1" @@ -431,7 +432,8 @@ function aptinstallbazel { $SUDO mv bazel-archive-keyring.gpg /usr/share/keyrings echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | $SUDO tee /etc/apt/sources.list.d/bazel.list $SUDO apt update -qq - aptinstall bazel + aptinstall bazel-$version_bazel + $SUDO ln -sf /usr/bin/bazel-$version_bazel /usr/bin/bazel } function dnfinstallbazel { @@ -635,7 +637,7 @@ fi if test "$setup_tcg" = "1"; then checkout tcg $version_tcg https://github.com/google/tcmalloc if command -v bazelisk > /dev/null; then - bazelisk build -c opt tcmalloc + USE_BAZEL_VERSION=$version_bazel bazelisk build -c opt tcmalloc else bazel build -c opt tcmalloc fi From 93f03caf7474635c93638468b426ef9f45823cbe Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 15:23:36 +0100 Subject: [PATCH 11/12] Use sed for jemalloc compatibility fix --- build-bench-env.sh | 3 ++- patches/jemalloc.patch | 12 ------------ 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 patches/jemalloc.patch diff --git a/build-bench-env.sh b/build-bench-env.sh index 6809a7e..b29bac8 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -657,7 +657,8 @@ fi if test "$setup_je" = "1"; then checkout je $version_je https://github.com/jemalloc/jemalloc if grep -q 'std::__throw_bad_alloc' src/jemalloc_cpp.cpp; then - patch -p1 < ../../patches/jemalloc.patch + sed -i 's/std::__throw_bad_alloc();/throw std::bad_alloc();/g' src/jemalloc_cpp.cpp + ! grep -q 'std::__throw_bad_alloc' src/jemalloc_cpp.cpp fi if test -f config.status; then echo "$devdir/jemalloc is already configured; no need to reconfigure" diff --git a/patches/jemalloc.patch b/patches/jemalloc.patch deleted file mode 100644 index 01b49dc..0000000 --- a/patches/jemalloc.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/jemalloc_cpp.cpp b/src/jemalloc_cpp.cpp ---- a/src/jemalloc_cpp.cpp -+++ b/src/jemalloc_cpp.cpp -@@ -100,7 +100,7 @@ handleOOM(std::size_t size, bool nothrow) { - } - - if (ptr == nullptr && !nothrow) -- std::__throw_bad_alloc(); -+ throw std::bad_alloc(); - return ptr; - } - \ No newline at end of file From 755fdb6b61bf7f63a2a16a0a7508872197ac5875 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 2 Sep 2026 15:24:10 +0100 Subject: [PATCH 12/12] Use sed for hardened_malloc compatibility fix --- build-bench-env.sh | 4 +++- patches/hardened_malloc.patch | 26 -------------------------- 2 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 patches/hardened_malloc.patch diff --git a/build-bench-env.sh b/build-bench-env.sh index b29bac8..e8f82bb 100755 --- a/build-bench-env.sh +++ b/build-bench-env.sh @@ -495,7 +495,9 @@ fi if test "$setup_hm" = "1"; then checkout hm $version_hm https://github.com/GrapheneOS/hardened_malloc if grep -q 'std::__throw_bad_alloc' new.cc; then - patch -p1 < ../../patches/hardened_malloc.patch + sed -i '/^#include $/d' new.cc + sed -i 's/std::__throw_bad_alloc();/throw std::bad_alloc();/g' new.cc + ! grep -q 'std::__throw_bad_alloc' new.cc fi make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=light -j $procs make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=default -j $procs diff --git a/patches/hardened_malloc.patch b/patches/hardened_malloc.patch deleted file mode 100644 index bb44d26..0000000 --- a/patches/hardened_malloc.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/new.cc b/new.cc ---- a/new.cc -+++ b/new.cc -@@ -1,4 +1,3 @@ --#include - #include - - #include "h_malloc.h" -@@ -21,7 +20,7 @@ COLD static void *handle_out_of_memory(size_t size, bool nothrow) { - } while (ptr == nullptr); - - if (ptr == nullptr && !nothrow) { -- std::__throw_bad_alloc(); -+ throw std::bad_alloc(); - } - return ptr; - } -@@ -93,7 +92,7 @@ COLD static void *handle_out_of_memory(size_t size, size_t alignment, bool nothr - } while (ptr == nullptr); - - if (ptr == nullptr && !nothrow) { -- std::__throw_bad_alloc(); -+ throw std::bad_alloc(); - } - return ptr; - } \ No newline at end of file