Skip to content

Commit

Permalink
Fix sha by adding a sort for files used for sha
Browse files Browse the repository at this point in the history
  • Loading branch information
jlb6740 committed Apr 23, 2024
1 parent 2a7fef6 commit 43509d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ REVISION=$(echo $VERSION | cut -d '.' -f 3)
BUILD_SHA=$(echo $VERSION | cut -d '.' -f 4)

# Define current build and commit SHAs
CURRENT_BUILD_SHA=$(find . -type f -name '*.wasm' | xargs -I{} sha1sum add_time_metric.diff build.sh requirements.txt Dockerfile wasmscore.py {} | sha1sum | cut -c 1-7 | awk '{print $1}')
# Sort -n/-h produced different sort results for inside vs outside the countainer so using sort -d
CURRENT_BUILD_SHA=$(find . -type f -name '*.wasm' | sort -d | xargs -I{} sha1sum add_time_metric.diff build.sh requirements.txt Dockerfile wasmscore.py {} | sha1sum | cut -c 1-7 | awk '{print $1}')

# Define architecutre and kernel
ARCH=$(uname -m | awk '{print tolower($0)}')
Expand Down
2 changes: 1 addition & 1 deletion config.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Global variables used by scripts for docker building and launching
IMAGE_NAME="wasmscore"
IMAGE_VERSION="v0.1.1.54bbb97"
IMAGE_VERSION="v0.1.1.63d6828"
2 changes: 1 addition & 1 deletion wasmscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ def check_version():
stderr=subprocess.STDOUT,
).strip()
calculated_build_version = subprocess.check_output(
"find . -type f -name '*.wasm' | xargs -I{} sha1sum add_time_metric.diff build.sh requirements.txt Dockerfile wasmscore.py {} | sha1sum | cut -c 1-7 | awk '{print $1}'",
"find . -type f -name '*.wasm' | sort -d | xargs -I{} sha1sum add_time_metric.diff build.sh requirements.txt Dockerfile wasmscore.py {} | sha1sum | cut -c 1-7 | awk '{print $1}'",
shell=True,
text=True,
stderr=subprocess.STDOUT,
Expand Down

0 comments on commit 43509d9

Please sign in to comment.