diff --git a/scripts/memguard-runner.sh b/scripts/memguard-runner.sh deleted file mode 100755 index 78161c6..0000000 --- a/scripts/memguard-runner.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# Wraps a test/bin invocation in a transient user cgroup scope so a runaway -# allocation dies inside its own cgroup instead of triggering a machine-wide -# OOM kill. Used as the cargo target runner (see .cargo/config.toml) so every -# `cargo test`/`cargo run` invocation of this workspace is capped, from any -# checkout (main repo or worktree). -set -euo pipefail - -if [ "${EC_NOMEMGUARD:-0}" = "1" ]; then - echo "memguard-runner: EC_NOMEMGUARD=1, running without memory cap" >&2 - exec "$@" -fi - -if ! systemd-run --user --scope --quiet -p MemoryMax=10G true >/dev/null 2>&1; then - echo "memguard-runner: systemd-run --user --scope unavailable, running without memory cap" >&2 - exec "$@" -fi - -exec systemd-run --user --scope --quiet --same-dir \ - -p MemoryMax=10G -p MemorySwapMax=2G \ - -- "$@"