Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
50dbffd
Renamed SessionSnodeKit to SessionNetworkingKit
mpretty-cyro Aug 7, 2025
baafb92
Fixed some missing renames
mpretty-cyro Aug 7, 2025
4ae24f8
Fixed a couple of build issues
mpretty-cyro Aug 7, 2025
08d01a5
Moved all migrations into one target, simplified migration logic
mpretty-cyro Aug 8, 2025
994be24
[WIP] Initial work on integrated refactored libSession networking
mpretty-cyro Aug 8, 2025
cb6b5aa
Fixed a few issues
mpretty-cyro Aug 8, 2025
ad42281
Made a bunch of QoL changes
mpretty-cyro Aug 22, 2025
d14cf60
Removed a redundant extension
mpretty-cyro Aug 22, 2025
43585db
Added an event to notify of any conversation deletion
mpretty-cyro Aug 22, 2025
2adac28
Added code to schedule a missing recurring job (could be lost)
mpretty-cyro Aug 22, 2025
dc24dca
Removed database usage from SnodeAPI
mpretty-cyro Aug 22, 2025
8fc4ed2
Updated actor-based networking wrapper
mpretty-cyro Aug 25, 2025
baee6a3
Updated the SessionNetworkScreen to use async/await and ObservationMa…
mpretty-cyro Aug 26, 2025
ecc472b
Updated path status observations to use async/await
mpretty-cyro Aug 26, 2025
ae9e35b
Added some missing SessionNetworkScreen changes
mpretty-cyro Aug 26, 2025
c386223
Refactored 'SwarmDrainBehaviour' into 'SwarmDrainer'
mpretty-cyro Aug 26, 2025
bb9bfb1
Cleaned up the SnodeAPI, updated getSessionId to async/await
mpretty-cyro Aug 26, 2025
266d142
Refactored the PushNotificationAPI to be async/await
mpretty-cyro Aug 26, 2025
fb9c224
Updated NukeDataModel to do some async/await
mpretty-cyro Aug 26, 2025
99f5b88
Initial dev settings screen updates
mpretty-cyro Aug 26, 2025
04ba13c
Rework AppSetup process to be async/await
mpretty-cyro Aug 26, 2025
d44704b
Refactored the CheckForAppUpdatesJob to use async/await
mpretty-cyro Aug 26, 2025
da6c4d4
Updated usage of the getSessionId function
mpretty-cyro Aug 26, 2025
922218f
Odds and ends
mpretty-cyro Aug 26, 2025
ecf3e82
Refactored Onboarding to be an actor and use async/await
mpretty-cyro Aug 26, 2025
5f0ad10
Merge remote-tracking branch 'upstream/dev' into feature/refactored-n…
mpretty-cyro Aug 27, 2025
da39851
Moved network settings to it's own screen, added devnet support
mpretty-cyro Aug 27, 2025
4b41a29
Fixed an issue where the libSession loggers weren't setup correctly
mpretty-cyro Aug 27, 2025
4bbee07
Fixed a couple of networking bugs
mpretty-cyro Aug 28, 2025
7e7c969
Merge remote-tracking branch 'upstream/dev' into feature/refactored-n…
mpretty-cyro Sep 2, 2025
98bcadb
Fixed an issue where attachment files may not get deleted immediately
mpretty-cyro Sep 2, 2025
7893944
Fixed build issues and bumped version number
mpretty-cyro Sep 2, 2025
e848640
Fixed some issues with archiving `Compile_LibSessionUtil` builds
mpretty-cyro Sep 3, 2025
ca4c763
Fixed a bug where we weren't excluding the prefix when getting a swar…
mpretty-cyro Sep 3, 2025
5bed51e
Fixed an issue where combine streams which sent requests would never …
mpretty-cyro Sep 3, 2025
8d41ab4
Fixed a couple of issues found when testing
mpretty-cyro Sep 4, 2025
a728a95
Fixed an issue where group creation was broken
mpretty-cyro Sep 4, 2025
aae7bfe
Updated mocking setup, working through fixing tests
mpretty-cyro Sep 5, 2025
2d0d88c
Fixed unit test build errors (tests still broken)
mpretty-cyro Sep 8, 2025
b6086c1
Fixed a number of test crashes, updated MockCrypto to be Mockable
mpretty-cyro Sep 8, 2025
6606ffa
Added dev setting to configure router, fixed a couple of other issues
mpretty-cyro Sep 9, 2025
d0f3cf9
Fixed an issue where settings could be set before the local config ex…
mpretty-cyro Sep 9, 2025
5eb99ed
Updated MockNotificationsManager to use new Mockable convention (was …
mpretty-cyro Sep 9, 2025
85184ba
Fixed a bunch of broke unit tests (still some left)
mpretty-cyro Sep 10, 2025
2ad95f4
Updated MockGeneralCache and MockUserDefaults to use new Mockable
mpretty-cyro Sep 10, 2025
04fb9d4
Fixed a few more tests and updated more code to the new mocking system
mpretty-cyro Sep 10, 2025
b596de2
Fixed more failing unit tests, updated more mock types to Mockable
mpretty-cyro Sep 11, 2025
20feb15
Finished fixing up broken tests
mpretty-cyro Sep 14, 2025
fa51244
Fixes for SOGS downloads and network status observations
mpretty-cyro Sep 16, 2025
cec5d80
Merge remote-tracking branch 'upstream/dev' into feature/refactored-n…
mpretty-cyro Sep 17, 2025
6381a34
Removed the legacy get/send message requests
mpretty-cyro Sep 17, 2025
63f17a5
Refactored the OGMCache to be part of the OpenGroupManager
mpretty-cyro Sep 17, 2025
6a89039
Renamed Network.SnodeAPI to Network.StorageServer for consistency
mpretty-cyro Sep 17, 2025
a828c86
Removed StorageServerCache, cleaning up DSL, async/await tweaks
mpretty-cyro Sep 18, 2025
b35e48c
Fixed broken tests
mpretty-cyro Sep 18, 2025
2eeed6b
Enabled "Direct" routing mode, fixed a bug from network offset changes
mpretty-cyro Sep 22, 2025
fe1515c
Merge remote-tracking branch 'upstream/dev' into feature/refactored-n…
mpretty-cyro Sep 23, 2025
3662c69
Fixed issues from merge
mpretty-cyro Sep 23, 2025
2dc3bfc
Fixes for a few issues that cropped up during testing
mpretty-cyro Sep 24, 2025
fee13a0
Merge remote-tracking branch 'upstream/dev' into feature/refactored-n…
mpretty-cyro Sep 24, 2025
0cb8665
Bumped build number
mpretty-cyro Sep 24, 2025
889e5e8
Better iOS 15 support for network changes
mpretty-cyro Sep 25, 2025
502b166
Minor copy and warning tweaks
mpretty-cyro Sep 30, 2025
1c2cf98
Merge remote-tracking branch 'upstream/dev' into feature/refactored-n…
mpretty-cyro Sep 30, 2025
6f8c3d3
Bumped build number
mpretty-cyro Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
117 changes: 87 additions & 30 deletions Scripts/build_libSession_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ COMPILE_DIR="${TARGET_BUILD_DIR}/LibSessionUtil"
INDEX_DIR="${DERIVED_DATA_PATH}/Index.noindex/Build/Products/Debug-${PLATFORM_NAME}"
LAST_SUCCESSFUL_HASH_FILE="${TARGET_BUILD_DIR}/last_successful_source_tree.hash.log"
LAST_BUILT_FRAMEWORK_SLICE_DIR_FILE="${TARGET_BUILD_DIR}/last_built_framework_slice_dir.log"
BUILT_LIB_FINAL_TIMESTAMP_FILE="${TARGET_BUILD_DIR}/libsession_util_built.timestamp"

# Save original stdout and set trap for cleanup
exec 3>&1
Expand All @@ -22,6 +21,48 @@ function finish {
}
trap finish EXIT ERR SIGINT SIGTERM

# Robustly removes a directory, first clearing any immutable flags (work around Xcode's indexer file locking)
remove_locked_dir() {
local dir_to_remove="$1"
if [ -d "${dir_to_remove}" ]; then
echo "- Unlocking and removing ${dir_to_remove}"
chflags -R nouchg "${dir_to_remove}" &>/dev/null || true
rm -rf "${dir_to_remove}"
fi
}

sync_headers() {
local source_dir="$1"
echo "- Syncing headers from ${source_dir}"

local destinations=(
"${TARGET_BUILD_DIR}/include"
"${INDEX_DIR}/include"
"${BUILT_PRODUCTS_DIR}/include"
"${CONFIGURATION_BUILD_DIR}/include"
)

for dest in "${destinations[@]}"; do
if [ -n "$dest" ]; then
remove_locked_dir "$dest"
mkdir -p "$dest"
rsync -rtc --delete --exclude='.DS_Store' "${source_dir}/" "$dest/"
echo " Synced to: $dest"
fi
done
}

# Modify the platform detection to handle archive builds
if [ "${ACTION}" = "install" ] || [ "${CONFIGURATION}" = "Release" ]; then
# Archive builds typically use 'install' action
if [ -z "$PLATFORM_NAME" ]; then
# During archive, PLATFORM_NAME might not be set correctly
# Default to device build for archives
PLATFORM_NAME="iphoneos"
echo "Missing 'PLATFORM_NAME' value, manually set to ${PLATFORM_NAME}"
fi
fi

# Determine whether we want to build from source
TARGET_ARCH_DIR=""

Expand All @@ -35,11 +76,14 @@ else
fi

if [ "${COMPILE_LIB_SESSION}" != "YES" ]; then
echo "Restoring original headers to Xcode Indexer cache from backup..."
rm -rf "${INDEX_DIR}/include"
rsync -rt --exclude='.DS_Store' "${PRE_BUILT_FRAMEWORK_DIR}/${FRAMEWORK_DIR}/${TARGET_ARCH_DIR}/Headers/" "${INDEX_DIR}/include"

echo "Using pre-packaged SessionUtil"
sync_headers "${PRE_BUILT_FRAMEWORK_DIR}/${FRAMEWORK_DIR}/${TARGET_ARCH_DIR}/Headers/"

# Create the placeholder in the FINAL products directory to satisfy dependency.
touch "${BUILT_PRODUCTS_DIR}/libsession-util.a"

echo "- Revert to SPM complete."

exit 0
fi

Expand Down Expand Up @@ -83,20 +127,22 @@ fi
echo "- Checking if libSession changed..."
REQUIRES_BUILD=0

# Generate a hash to determine whether any source files have changed
SOURCE_HASH=$(find "${LIB_SESSION_SOURCE_DIR}/src" -type f -not -name '.DS_Store' -exec md5 {} + | awk '{print $NF}' | sort | md5 | awk '{print $NF}')
HEADER_HASH=$(find "${LIB_SESSION_SOURCE_DIR}/include" -type f -not -name '.DS_Store' -exec md5 {} + | awk '{print $NF}' | sort | md5 | awk '{print $NF}')
EXTERNAL_HASH=$(find "${LIB_SESSION_SOURCE_DIR}/external" -type f -not -name '.DS_Store' -exec md5 {} + | awk '{print $NF}' | sort | md5 | awk '{print $NF}')
MAKE_LISTS_HASH=$(md5 -q "${LIB_SESSION_SOURCE_DIR}/CMakeLists.txt")
STATIC_BUNDLE_HASH=$(md5 -q "${LIB_SESSION_SOURCE_DIR}/utils/static-bundle.sh")

CURRENT_SOURCE_TREE_HASH=$( (
echo "${SOURCE_HASH}"
echo "${HEADER_HASH}"
echo "${EXTERNAL_HASH}"
echo "${MAKE_LISTS_HASH}"
echo "${STATIC_BUNDLE_HASH}"
) | sort | md5 -q)
# Generate a hash to determine whether any source files have changed (by using git we automatically
# respect .gitignore)
CURRENT_SOURCE_TREE_HASH=$( \
( \
cd "${LIB_SESSION_SOURCE_DIR}" && git ls-files --recurse-submodules \
) \
| grep -vE '/(tests?|docs?|examples?)/|\.md$|/(\.DS_Store|\.gitignore)$' \
| sort \
| tr '\n' '\0' \
| ( \
cd "${LIB_SESSION_SOURCE_DIR}" && xargs -0 md5 -r \
) \
| awk '{print $1}' \
| sort \
| md5 -q \
)

PREVIOUS_BUILT_FRAMEWORK_SLICE_DIR=""
if [ -f "$LAST_BUILT_FRAMEWORK_SLICE_DIR_FILE" ]; then
Expand Down Expand Up @@ -125,6 +171,16 @@ else
fi

if [ "${REQUIRES_BUILD}" == 1 ]; then

# # Hide the SPM framework to prevent module conflicts
# if [ -d "${PRE_BUILT_FRAMEWORK_DIR}" ]; then
# # Temporarily rename the SPM framework to prevent it from being found
# mv "${PRE_BUILT_FRAMEWORK_DIR}" "${PRE_BUILT_FRAMEWORK_DIR}.disabled" 2>/dev/null || true
#
# # Store that we disabled it so we can restore if build fails
# echo "DISABLED" > "${TARGET_BUILD_DIR}/.spm_framework_disabled"
# fi

# Import settings from XCode (defaulting values if not present)
VALID_SIM_ARCHS=(arm64 x86_64)
VALID_DEVICE_ARCHS=(arm64)
Expand Down Expand Up @@ -217,6 +273,8 @@ if [ "${REQUIRES_BUILD}" == 1 ]; then
-DBUILD_TESTS=OFF \
-DBUILD_STATIC_DEPS=ON \
-DENABLE_VISIBILITY=ON \
-DLOKINET_FULL=OFF \
-DLOKINET_DAEMON=OFF \
-DSUBMODULE_CHECK=$submodule_check \
-DCMAKE_BUILD_TYPE=$build_type \
-DLOCAL_MIRROR=https://oxen.rocks/deps
Expand Down Expand Up @@ -308,25 +366,24 @@ if [ "${REQUIRES_BUILD}" == 1 ]; then
echo "- Saving successful build cache files"
echo "${TARGET_ARCH_DIR}" > "${LAST_BUILT_FRAMEWORK_SLICE_DIR_FILE}"
echo "${CURRENT_SOURCE_TREE_HASH}" > "${LAST_SUCCESSFUL_HASH_FILE}"

echo "- Touching timestamp file to signal update to Xcode"
touch "${BUILT_LIB_FINAL_TIMESTAMP_FILE}"
cp "${BUILT_LIB_FINAL_TIMESTAMP_FILE}" "${SPM_TIMESTAMP_FILE}"

echo "- Build complete"
fi

echo "- Replacing build dir files"

# Remove the current files (might be "newer")
rm -rf "${TARGET_BUILD_DIR}/libsession-util.a"
rm -rf "${TARGET_BUILD_DIR}/include"
rm -rf "${INDEX_DIR}/include"

# Rsync the compiled ones (maintaining timestamps)
rm -rf "${TARGET_BUILD_DIR}/libsession-util.a"
rsync -rt "${COMPILE_DIR}/libsession-util.a" "${TARGET_BUILD_DIR}/libsession-util.a"
rsync -rt --exclude='.DS_Store' "${COMPILE_DIR}/Headers/" "${TARGET_BUILD_DIR}/include"
rsync -rt --exclude='.DS_Store' "${COMPILE_DIR}/Headers/" "${INDEX_DIR}/include"

if [ "${TARGET_BUILD_DIR}" != "${BUILT_PRODUCTS_DIR}" ]; then
echo "- TARGET_BUILD_DIR and BUILT_PRODUCTS_DIR are different. Copying library."
rm -f "${BUILT_PRODUCTS_DIR}/libsession-util.a"
rsync -rt "${COMPILE_DIR}/libsession-util.a" "${BUILT_PRODUCTS_DIR}/libsession-util.a"
fi

sync_headers "${COMPILE_DIR}/Headers/"
echo "- Sync complete."

# Output to XCode just so the output is good
echo "LibSession is Ready"
Loading