Skip to content
Merged
12 changes: 6 additions & 6 deletions .github/workflows/platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
45 changes: 29 additions & 16 deletions build-bench-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ 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
readonly version_bazel=8.8.0

# HTTP-downloaded files checksums
readonly sha256sum_sh6bench="506354d66b9eebef105d757e055bc55e8d4aea1e7b51faab3da35b0466c923a1"
Expand Down Expand Up @@ -426,20 +428,19 @@ 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
aptinstall bazel-$version_bazel
$SUDO ln -sf /usr/bin/bazel-$version_bazel /usr/bin/bazel
}

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
Expand All @@ -459,9 +460,8 @@ 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"
# bazel5 is broken on the copr: https://github.com/bazelbuild/bazel/issues/19295
#dnfinstallbazel
ghostscript libatomic libstdc++ libstdc++-static which gflags-devel xz readline-devel snappy-devel"
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
Expand Down Expand Up @@ -494,8 +494,13 @@ fi

if test "$setup_hm" = "1"; then
checkout hm $version_hm https://github.com/GrapheneOS/hardened_malloc
make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=light -j $proc
make CONFIG_NATIVE=true CONFIG_WERROR=false VARIANT=default -j $proc
if grep -q 'std::__throw_bad_alloc' new.cc; then
sed -i '/^#include <bits\/functexcept.h>$/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
popd
fi

Expand Down Expand Up @@ -633,7 +638,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
USE_BAZEL_VERSION=$version_bazel bazelisk build -c opt tcmalloc
else
bazel build -c opt tcmalloc
fi
popd
fi

Expand All @@ -649,6 +658,10 @@ 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
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something like sed -i s/std::__throw_bad_alloc();/throw std::bad_alloc();/ would be more portable

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Changed to that

if test -f config.status; then
echo "$devdir/jemalloc is already configured; no need to reconfigure"
else
Expand Down Expand Up @@ -842,8 +855,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

Expand Down