Skip to content
This repository was archived by the owner on May 30, 2026. It is now read-only.

Commit 94b0202

Browse files
author
Ouroboros
committed
fix(build): remove pycache symlinks before macOS signing
1 parent 7131ac5 commit 94b0202

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ cp packaging/cli/install-ouroboros-cli "$CLI_BIN_DIR/install-ouroboros-cli"
9494
chmod +x "$CLI_BIN_DIR/ouroboros" "$CLI_BIN_DIR/install-ouroboros-cli"
9595

9696
echo "--- Removing Python bytecode caches from app bundle ---"
97-
find "$APP_PATH" -name "__pycache__" -type d -prune -exec rm -rf {} +
97+
# PyInstaller may duplicate resource trees with symlinks; remove cache dirs and links before signing.
98+
find "$APP_PATH" -name "__pycache__" -prune -exec rm -rf {} +
9899
find "$APP_PATH" -name "*.pyc" -type f -delete
99100

100101
if [ "$SIGN_MODE" != "0" ]; then

tests/test_build_scripts.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,18 @@ def test_packaged_cli_wrappers_are_copied_before_signing_and_dmg(self):
111111
assert cleanup_pos != -1 and cleanup_pos < sign_pos
112112
assert dmg_pos != -1 and wrapper_pos < dmg_pos
113113

114+
def test_pycache_cleanup_includes_symlink_entries_before_signing(self):
115+
src = _read("build.sh")
116+
cleanup_lines = [
117+
line.strip()
118+
for line in src.splitlines()
119+
if 'find "$APP_PATH" -name "__pycache__"' in line
120+
]
121+
assert cleanup_lines
122+
assert all("-type d" not in line for line in cleanup_lines), (
123+
"build.sh must remove __pycache__ symlinks as well as directories before codesign"
124+
)
125+
114126
def test_macos_dmg_includes_install_cli_command(self):
115127
src = _read("build.sh")
116128
assert "dmg-stage" in src

0 commit comments

Comments
 (0)