Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions scripts/macos-fix-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,11 @@ daemonctl_path="${app_path}/Contents/MacOS/codex_monitor_daemonctl"
daemon_source="${DAEMON_BINARY_PATH:-src-tauri/target/release/codex_monitor_daemon}"
daemonctl_source="${DAEMONCTL_BINARY_PATH:-src-tauri/target/release/codex_monitor_daemonctl}"

copy_if_missing() {
sync_embedded_binary() {
local source_path="$1"
local destination_path="$2"
local label="$3"

if [[ -f "${destination_path}" ]]; then
return
fi

if [[ -f "${source_path}" ]]; then
cp -f "${source_path}" "${destination_path}"
chmod +x "${destination_path}"
Comment on lines 58 to 60

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid overwriting bundle daemons from generic target/release

daemon_source and daemonctl_source still default to the host build outputs under src-tauri/target/release, so making this copy unconditional now replaces whatever is already embedded in app_path even when the bundle is being reused from a different workspace state or architecture. In that reuse path (for example, re-signing an existing x86_64 bundle after the local checkout last built arm64 binaries), the signed app can silently ship a stale or wrong-arch nested daemon; the previous destination-exists guard was what preserved the already-matched bundle copy.

Useful? React with 👍 / 👎.

Expand All @@ -68,8 +64,8 @@ copy_if_missing() {
fi
}

copy_if_missing "${daemon_source}" "${daemon_path}" "daemon"
copy_if_missing "${daemonctl_source}" "${daemonctl_path}" "daemonctl"
sync_embedded_binary "${daemon_source}" "${daemon_path}" "daemon"
sync_embedded_binary "${daemonctl_source}" "${daemonctl_path}" "daemonctl"

if [[ ! -f "${libssl}" || ! -f "${libcrypto}" ]]; then
echo "OpenSSL dylibs not found at ${openssl_prefix}/lib"
Expand Down
Loading