Skip to content

Commit

Permalink
Revert "Fix to not use sccache if it's not setup properly (pytorch#1171
Browse files Browse the repository at this point in the history
…)"

This reverts commit 377efea.
  • Loading branch information
atalman committed Oct 25, 2022
1 parent 377efea commit 778d46a
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions manywheel/build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,6 @@
set -ex
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

# Courtesy of pytorch/.jenkins/pytorch/common_utils.sh
#
# - 1st arg: code to add
# - remaining args: names of traps to modify
#
trap_add() {
trap_add_cmd=$1; shift || fatal "${FUNCNAME[0]} usage error"
for trap_add_name in "$@"; do
trap -- "$(
# helper fn to get existing trap command from output
# of trap -p
extract_trap_cmd() { printf '%s\n' "$3"; }
# print existing trap command with newline
eval "extract_trap_cmd $(trap -p "${trap_add_name}")"
# print the new trap command
printf '%s\n' "${trap_add_cmd}"
)" "${trap_add_name}" \
|| fatal "unable to add to trap ${trap_add_name}"
done
}
# set the trace attribute for the above function. this is
# required to modify DEBUG or RETURN traps because functions don't
# inherit them unless the trace attribute is set
declare -f -t trap_add

# Initialize sccache
if [[ -n "$SCCACHE_BUCKET" ]] && which sccache > /dev/null; then
# Save sccache logs to file
sccache --stop-server > /dev/null 2>&1 || true
rm -f ~/sccache_error.log || true

export SCCACHE_IDLE_TIMEOUT=1200
export SCCACHE_ERROR_LOG=~/sccache_error.log
export RUST_LOG=sccache::server=error

# Report sccache stats for easier debugging
sccache --zero-stats
function sccache_epilogue() {
sccache --show-stats
sccache --stop-server || true
}

trap_add sccache_epilogue EXIT
else
# Not using sscache if it's not setup properly
rm -f /opt/cache/bin/cc
rm -f /opt/cache/bin/c++
rm -f /opt/cache/bin/clang
rm -f /opt/cache/bin/clang++
rm -f /opt/cache/bin/gcc
rm -f /opt/cache/bin/g++

unset CMAKE_CUDA_COMPILER_LAUNCHER
fi

# Require only one python installation
if [[ -z "$DESIRED_PYTHON" ]]; then
Expand Down

0 comments on commit 778d46a

Please sign in to comment.