Skip to content

Commit

Permalink
Only update a build cache index when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
greenc-FNAL committed May 13, 2024
1 parent 94c3009 commit 361472c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bin/build-spack-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -802,12 +802,14 @@ EOF
${buildcache_rel_arg} "$cache" \
"${hashes_to_cache[@]/#//}" ||
_die "failure caching packages to $cache"
_report $PROGRESS "updating build cache index at $cache"
_cmd $DEBUG_1 $PROGRESS \
spack \
${common_spack_opts[*]:+"${common_spack_opts[@]}"} \
buildcache update-index -k "$cache" ||
_report $ERROR "failure to update build cache index: manual intervention required for $cache"
if [ -d "$cache/build_cache/index.json" ]; then
_report $PROGRESS "updating build cache index at $cache"
_cmd $DEBUG_1 $PROGRESS \
spack \
${common_spack_opts[*]:+"${common_spack_opts[@]}"} \
buildcache update-index -k "$cache" ||
_report $ERROR "failure to update build cache index: manual intervention required for $cache"
fi
done
fi
}
Expand Down

0 comments on commit 361472c

Please sign in to comment.