From e8e5fb5637f2ebf669f76528c7325a8c0998052f Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 19 Sep 2023 09:26:28 +0100 Subject: [PATCH] fix: tracing build system with [debug ci] --- .circleci/config.yml | 2 +- build-system/scripts/cond_spot_run_test | 3 ++- build-system/scripts/setup_env | 11 ++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7cab78bb87e..c84aa80a44f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,7 +66,7 @@ checkout: &checkout setup_env: &setup_env run: name: "Setup environment" - command: ./build-system/scripts/setup_env "$CIRCLE_SHA1" "$CIRCLE_TAG" "$CIRCLE_JOB" "$CIRCLE_REPOSITORY_URL" "$CIRCLE_BRANCH" "$CIRCLE_COMMIT_MESSAGE" + command: ./build-system/scripts/setup_env "$CIRCLE_SHA1" "$CIRCLE_TAG" "$CIRCLE_JOB" "$CIRCLE_REPOSITORY_URL" "$CIRCLE_BRANCH" # This step is used to save logs from various barretenberg test to the workspace so that they can be used later to parse benchmark values out of them save_logs: &save_logs diff --git a/build-system/scripts/cond_spot_run_test b/build-system/scripts/cond_spot_run_test index e4e83649995..ca3249f1b7f 100755 --- a/build-system/scripts/cond_spot_run_test +++ b/build-system/scripts/cond_spot_run_test @@ -13,4 +13,5 @@ SCRIPT=$(query_manifest relativeProjectDir $REPOSITORY)/$SCRIPT # Specify a TAG_POSTFIX as the JOB_NAME mkdir -p /tmp/test-logs -TAG_POSTFIX=$JOB_NAME cond_spot_run_script $REPOSITORY $CPUS $SCRIPT $@ | tee "/tmp/test-logs/$JOB_NAME.log" +export TAG_POSTFIX=$JOB_NAME +cond_spot_run_script $REPOSITORY $CPUS $SCRIPT $@ | tee "/tmp/test-logs/$JOB_NAME.log" diff --git a/build-system/scripts/setup_env b/build-system/scripts/setup_env index c0fc0c9595b..78ef8f5c0bc 100755 --- a/build-system/scripts/setup_env +++ b/build-system/scripts/setup_env @@ -78,11 +78,6 @@ echo export ECR_DEPLOY_REGION=eu-west-2 >> $BASH_ENV echo export ECR_DEPLOY_URL=278380418400.dkr.ecr.eu-west-2.amazonaws.com >> $BASH_ENV echo export PROJECT=$PROJECT >> $BASH_ENV echo export COMMIT_HASH=$COMMIT_HASH >> $BASH_ENV -# if our commit messages has [debug ci] anywhere in it, we set -x in all build system BASH files -# this can also be used for other verbose logging -if [[ "$COMMIT_MESSAGE" == *"[debug ci]"* ]]; then - echo export BUILD_SYSTEM_DEBUG=1 -fi echo export COMMIT_TAG=$COMMIT_TAG >> $BASH_ENV echo export JOB_NAME=$JOB_NAME >> $BASH_ENV echo export GIT_REPOSITORY_URL=$GIT_REPOSITORY_URL >> $BASH_ENV @@ -105,6 +100,12 @@ if [ -n "$COMMIT_HASH" ]; then mkdir -p ~/.ssh echo ${BUILD_INSTANCE_KEY:-} | base64 -d > ~/.ssh/build_instance_key chmod 600 ~/.ssh/build_instance_key + COMMIT_MESSAGE=`git log -n 1 --pretty=format:"%s" HEAD` + # if our commit messages has [debug ci] anywhere in it, we set -x in all build system BASH files + # this can also be used for other verbose logging + if [[ "$COMMIT_MESSAGE" == *"[debug ci]"* ]]; then + echo export BUILD_SYSTEM_DEBUG=1 >> $BASH_ENV + fi fi set +e