diff --git a/makefiles/targets.mk b/makefiles/targets.mk index 8754cad..a7400f7 100644 --- a/makefiles/targets.mk +++ b/makefiles/targets.mk @@ -98,7 +98,7 @@ $(NIMBLE_DIR): | $(NIM_BINARY) git submodule foreach --quiet '$(CURDIR)/$(BUILD_SYSTEM_DIR)/scripts/create_nimble_link.sh "$$sm_path"' clean-common: - rm -rf build/{*.exe,*.so,*.so.0} vendor/go/bin $(NIMBLE_DIR) $(NIM_BINARY) $(NIM_DIR)/nimcache nimcache + rm -rf build/{*.exe,*.so,*.so.0} vendor/go/bin $(NIMBLE_DIR) $(NIM_BINARY) $(NIM_DIR)/bin/timestamp $(NIM_DIR)/nimcache nimcache + [[ -e vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc ]] && $(MAKE) -C vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc clean $(HANDLE_OUTPUT) || true + [[ -e vendor/nim-nat-traversal/vendor/libnatpmp ]] && $(MAKE) -C vendor/nim-nat-traversal/vendor/libnatpmp clean $(HANDLE_OUTPUT) || true diff --git a/scripts/build_nim.sh b/scripts/build_nim.sh index 0bb18e9..1cfa7ce 100755 --- a/scripts/build_nim.sh +++ b/scripts/build_nim.sh @@ -40,12 +40,6 @@ else ON_WINDOWS=0 EXE_SUFFIX="" fi -# macOS -if uname | grep -qi "darwin"; then - STAT_FORMAT="-f %m" -else - STAT_FORMAT="-c %Y" -fi NIM_BINARY="${NIM_DIR}/bin/nim${EXE_SUFFIX}" @@ -61,8 +55,8 @@ nim_needs_rebuilding() { cp -a "$CI_CACHE"/* "$NIM_DIR"/bin/ || true # let this one fail with an empty cache dir fi - # compare binary mtime to the date of the last commit (keep in mind that Git doesn't preserve file timestamps) - if [[ -e "$NIM_BINARY" && $(stat $STAT_FORMAT "$NIM_BINARY") -gt $(cd "$NIM_DIR"; git log --pretty=format:%cd -n 1 --date=unix) ]]; then + # compare the built commit's timestamp to the date of the last commit (keep in mind that Git doesn't preserve file timestamps) + if [[ -e "${NIM_DIR}/bin/timestamp" && $(cat "${NIM_DIR}/bin/timestamp") -ne $(cd "$NIM_DIR"; git log --pretty=format:%cd -n 1 --date=unix) ]]; then return $NO_REBUILD else return $REBUILD @@ -126,6 +120,9 @@ build_nim() { sh build_all_custom.sh rm build_all_custom.sh + # record the last commit's timestamp + git log --pretty=format:%cd -n 1 --date=unix > bin/timestamp + # update the CI cache popd # we were in $NIM_DIR if [[ -n "$CI_CACHE" ]]; then diff --git a/vendor/Nim b/vendor/Nim index c6f601d..193b3c6 160000 --- a/vendor/Nim +++ b/vendor/Nim @@ -1 +1 @@ -Subproject commit c6f601d48ec81e0d6e052ba0d19a195b55cc68f2 +Subproject commit 193b3c66bbeffafaebff166d24b9866f1eaaac0e diff --git a/vendor/Nim-csources b/vendor/Nim-csources index b56e49b..f72f471 160000 --- a/vendor/Nim-csources +++ b/vendor/Nim-csources @@ -1 +1 @@ -Subproject commit b56e49bbedf62db22eb26388f98262e2948b2cbc +Subproject commit f72f471adb743bea4f8d8c59d19aa1cb885dcc59