From 021d05d0b3b4aa678eb0b5b7abc7734720281365 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Mon, 13 May 2024 13:56:00 +1000 Subject: [PATCH] Fixed a build script bug, updated to latest libSession --- LibSession-Util | 2 +- Scripts/build_libSession_util.sh | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/LibSession-Util b/LibSession-Util index b36c727f1..d252eefc9 160000 --- a/LibSession-Util +++ b/LibSession-Util @@ -1 +1 @@ -Subproject commit b36c727f1e1f6be87718ce2203332ae48f2d89a5 +Subproject commit d252eefc995a91c850f61663165b4817864ee24a diff --git a/Scripts/build_libSession_util.sh b/Scripts/build_libSession_util.sh index 9c2301d79..d3d5e4a2c 100755 --- a/Scripts/build_libSession_util.sh +++ b/Scripts/build_libSession_util.sh @@ -121,15 +121,22 @@ if [ -f "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_archs.log" ]; then read -r OLD_ARCHS < "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_archs.log" fi -# If all of the hashes match, the archs match and there is a library file then we can just stop here -if [ "${NEW_SOURCE_HASH}" == "${OLD_SOURCE_HASH}" ] && [ "${NEW_HEADER_HASH}" == "${OLD_HEADER_HASH}" ] && [ "${NEW_EXTERNAL_HASH}" == "${OLD_EXTERNAL_HASH}" ] && [ "${ARCHS[*]}" == "${OLD_ARCHS}" ] && [ -f "${TARGET_BUILD_DIR}/libSessionUtil/libSessionUtil.a" ]; then - echo "Build is up-to-date" - exit 0 +# Check the current state of the build (comparing hashes to determine if there was a source change) +if [ "${NEW_SOURCE_HASH}" != "${OLD_SOURCE_HASH}" ]; then + echo "Build is not up-to-date (source change) - creating new build" +elif [ "${NEW_HEADER_HASH}" != "${OLD_HEADER_HASH}" ]; then + echo "Build is not up-to-date (header change) - creating new build" +elif [ "${NEW_EXTERNAL_HASH}" != "${OLD_EXTERNAL_HASH}" ]; then + echo "Build is not up-to-date (external lib change) - creating new build" +elif [ "${ARCHS[*]}" != "${OLD_ARCHS}" ]; then + echo "Build is not up-to-date (build architectures changed) - creating new build" +elif [ ! -f "${TARGET_BUILD_DIR}/libSessionUtil/libSessionUtil.a" ]; then + echo "Build is not up-to-date (no static lib) - creating new build" +else + echo "Build is up-to-date" + exit 0 fi -# If any of the above differ then we need to rebuild -echo "Build is not up-to-date - creating new build" - # Import settings from XCode (defaulting values if not present) VALID_SIM_ARCHS=(arm64 x86_64) VALID_DEVICE_ARCHS=(arm64) @@ -278,6 +285,7 @@ fi # Save the updated hashes to disk to prevent rebuilds when there were no changes echo "${NEW_SOURCE_HASH}" > "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_source_hash.log" echo "${NEW_HEADER_HASH}" > "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_header_hash.log" +echo "${NEW_EXTERNAL_HASH}" > "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_external_hash.log" echo "${ARCHS[*]}" > "${TARGET_BUILD_DIR}/libSessionUtil/libsession_util_archs.log" echo "Build complete"