From 8150eec669c75c14e5c99c28b31410cb20e1ad69 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 1 Oct 2020 19:57:58 -0700 Subject: [PATCH] Switch from naming our cache directories based on inode to naming them based on the absolute path, so we don't blow the cache 100% of the time on travis --- bin/kaleidoscope-builder | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 294fd65f..997bad61 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -19,6 +19,12 @@ set -e ###### Build and output configuration ###### +absolute_filename() { + echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" +} + + + build_version () { GIT_VERSION="$(cd "$(find_sketch)"; if [ -d .git ]; then echo -n '-g' && git describe --abbrev=4 --dirty --always; fi)" LIB_PROPERTIES_PATH="${LIB_PROPERTIES_PATH:-"../.."}" @@ -26,9 +32,9 @@ build_version () { } build_paths() { - # We don't really want to use find - # shellcheck disable=SC2012 - SKETCH_IDENTIFIER="$(ls -id "$(find_sketch)/${SKETCH}.ino" | cut -d ' ' -f 1)-${SKETCH}.ino" + # We need that echo because we\re piping to cksum + # shellcheck disable=SC2005 + SKETCH_IDENTIFIER="$(echo "$(absolute_filename "$(find_sketch)/${SKETCH}.ino")" | cksum | cut -d ' ' -f 1)-${SKETCH}.ino" KALEIDOSCOPE_TEMP_PATH="${KALEIDOSCOPE_TEMP_PATH:-${TMPDIR:-/tmp}/kaleidoscope-${USER}}"