From 6a4df12aa660d0faf9fba5b000ffc864708941d2 Mon Sep 17 00:00:00 2001 From: Hongli Lai Date: Sun, 6 Oct 2024 10:30:07 +0200 Subject: [PATCH] sccache indentation --- dev/ci/setup-sccache | 52 ++++++++++++++++++++--------------------- dev/ci/teardown-sccache | 12 +++++----- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dev/ci/setup-sccache b/dev/ci/setup-sccache index ec4a2defea..8b6bcd7f87 100755 --- a/dev/ci/setup-sccache +++ b/dev/ci/setup-sccache @@ -4,13 +4,13 @@ set -e ## Check parameters & set defaults. if [[ -z "$ARCH_AND_OS" ]]; then - echo "ARCH_AND_OS is required" - exit 1 + echo "ARCH_AND_OS is required" + exit 1 fi if [[ -z "$SCCACHE_AZURE_CONNECTION_STRING" ]]; then - echo "SCCACHE_AZURE_CONNECTION_STRING is required" - exit 1 + echo "SCCACHE_AZURE_CONNECTION_STRING is required" + exit 1 fi SCCACHE_LOG=${SCCACHE_LOG:-info} # set to 'debug' or 'trace' for more verbose logging @@ -23,14 +23,14 @@ exec 2>&1 ## Download and install sccache. if [[ ! -e /usr/local/bin/sccache ]]; then - echo "::group::Download sccache" - wget --output-document sccache.tar.gz "https://github.com/mozilla/sccache/releases/download/v0.8.2/sccache-v0.8.2-$ARCH_AND_OS.tar.gz" - echo "::endgroup::" - set -x - tar xzf sccache.tar.gz - rm sccache.tar.gz - sudo mv sccache*/sccache /usr/local/bin/sccache - rm -rf sccache* + echo "::group::Download sccache" + wget --output-document sccache.tar.gz "https://github.com/mozilla/sccache/releases/download/v0.8.2/sccache-v0.8.2-$ARCH_AND_OS.tar.gz" + echo "::endgroup::" + set -x + tar xzf sccache.tar.gz + rm sccache.tar.gz + sudo mv sccache*/sccache /usr/local/bin/sccache + rm -rf sccache* fi @@ -39,11 +39,11 @@ set -x echo "PATH=/usr/local/libexec/sccache:/usr/local/bin:$PATH" >> "$GITHUB_ENV" sudo mkdir -p /usr/local/libexec/sccache for PROG in cc c++; do - FULLPATH=$(command -v "$PROG") - echo '#!/bin/sh' > "$PROG" - echo "exec /usr/local/bin/sccache $FULLPATH \"\$@\"" >> "$PROG" - chmod +x "$PROG" - sudo mv "$PROG" /usr/local/libexec/sccache/ + FULLPATH=$(command -v "$PROG") + echo '#!/bin/sh' > "$PROG" + echo "exec /usr/local/bin/sccache $FULLPATH \"\$@\"" >> "$PROG" + chmod +x "$PROG" + sudo mv "$PROG" /usr/local/libexec/sccache/ done @@ -51,17 +51,17 @@ done HAS_SCCACHE_IN_PATH=$(ruby -e 'puts ENV["PATH"].split(":").include?("/usr/local/bin")') if ! $HAS_SCCACHE_IN_PATH; then - echo "PATH=/usr/local/bin:$PATH" >> "$GITHUB_ENV" + echo "PATH=/usr/local/bin:$PATH" >> "$GITHUB_ENV" fi HAS_COMPILER_WRAPPERS_IN_PATH=$(ruby -e 'puts ENV["PATH"].split(":").include?("/usr/local/libexec/sccache")') if $HAS_COMPILER_WRAPPERS_IN_PATH; then - # When starting the sccache server, the compiler wrappers must *not* be in PATH - # so that the sccache server uses the non-wrapped compilers. - PATH=$(ruby -e 'paths = ENV["PATH"].split(":"); paths.delete("/usr/local/libexec/sccache"); puts paths.join(":")') - export PATH + # When starting the sccache server, the compiler wrappers must *not* be in PATH + # so that the sccache server uses the non-wrapped compilers. + PATH=$(ruby -e 'paths = ENV["PATH"].split(":"); paths.delete("/usr/local/libexec/sccache"); puts paths.join(":")') + export PATH else - echo "PATH=/usr/local/libexec/sccache:$PATH" >> "$GITHUB_ENV" + echo "PATH=/usr/local/libexec/sccache:$PATH" >> "$GITHUB_ENV" fi @@ -73,15 +73,15 @@ export SCCACHE_ERROR_LOG="$(pwd)/sccache.log" echo "SCCACHE_ERROR_LOG=$SCCACHE_ERROR_LOG" >> "$GITHUB_ENV" if $SUDO; then - sudo -E env SCCACHE_START_SERVER=1 sccache + sudo -E env SCCACHE_START_SERVER=1 sccache else - env SCCACHE_START_SERVER=1 sccache + env SCCACHE_START_SERVER=1 sccache fi set +x echo "Waiting until sccache server is started..." while [[ ! -e sccache.log ]]; do - sleep 0.1 + sleep 0.1 done sleep 0.5 echo "sccache server is started." diff --git a/dev/ci/teardown-sccache b/dev/ci/teardown-sccache index cff70a47bd..b9ca20c722 100755 --- a/dev/ci/teardown-sccache +++ b/dev/ci/teardown-sccache @@ -11,15 +11,15 @@ set -x # assume that sccache is in PATH and also don't assume that the log file exists. if [[ -e /usr/local/bin/sccache ]]; then - if $SUDO; then - sudo /usr/local/bin/sccache --stop-server - else - /usr/local/bin/sccache --stop-server - fi + if $SUDO; then + sudo /usr/local/bin/sccache --stop-server + else + /usr/local/bin/sccache --stop-server + fi fi if test -e sccache.log; then - cat sccache.log; + cat sccache.log; fi # Remove compiler wrappers from PATH.