From f7f5bd771f43d51cf75a49a03231e4183f94e5c7 Mon Sep 17 00:00:00 2001 From: Edd Barrett Date: Fri, 10 Jan 2025 14:48:18 +0000 Subject: [PATCH] Simplify path handling. When run from cron I was using an absolute path for the results dir, but then we were tacking `../..` onto it, which makes no sense. Rather than handle both cases, let's just say you have to use an absolute path. --- benchmark.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/benchmark.sh b/benchmark.sh index 9b2a896..2f681ec 100644 --- a/benchmark.sh +++ b/benchmark.sh @@ -40,6 +40,12 @@ fi RES_DIR=$1; shift +# To simplify path handling, require the results dir to be absolute. +if [ "$(realpath "${RES_DIR}")" != "${RES_DIR}" ]; then + echo "Please use an absolute path for the results directory" + exit 1 +fi + # Create a place for the results file to live if necessary. # # We are going to put results files in YYYY-MM sub-directories so that we don't @@ -76,5 +82,5 @@ ${TOML_BIN} set --toml-path ${EXTRA_TOML} versions.yklua "$(cd yklua && git rev- venv/bin/rebench --no-denoise -c rebench.conf # File away the results file (and extra info file) in the output directory. -cp ${EXTRA_TOML} ../../${RES_SUBDIR}/${YMDHMS}-extra.toml -cp benchmark.data ../../${RES_SUBDIR}/${YMDHMS}.data +cp ${EXTRA_TOML} ${RES_SUBDIR}/${YMDHMS}-extra.toml +cp benchmark.data ${RES_SUBDIR}/${YMDHMS}.data