Skip to content

Make fix_qt5_rpath.py test harness path discoverable (no hard-coded dev path)#6006

Open
geekrebel wants to merge 1 commit into
OpenShot:developfrom
geekrebel:macos-fix-qt5-rpath-dev-path
Open

Make fix_qt5_rpath.py test harness path discoverable (no hard-coded dev path)#6006
geekrebel wants to merge 1 commit into
OpenShot:developfrom
geekrebel:macos-fix-qt5-rpath-dev-path

Conversation

@geekrebel
Copy link
Copy Markdown

The __main__ block at the bottom of installer/fix_qt5_rpath.py has a
hard-coded default:

# XXX: This path should be set programmatically, somehow
PATH = "/Users/jonathanthomas/apps/openshot-qt/build/exe.macosx-10.15-x86_64-3.7"
fix_rpath(PATH)
print_min_versions(PATH)

This path can only resolve on one developer's machine. It embeds:

  • a specific home directory (/Users/jonathanthomas/...),
  • the x86_64 architecture (wrong on Apple Silicon),
  • Python 3.7 (EOL since June 2023),
  • macOS SDK 10.15 (from 2019).

The functions fix_rpath() and print_min_versions() themselves are fine,
and the production build already invokes them from freeze.py:571-572 with
a correct runtime path, so this only affects contributors who want to run
the script directly for testing or post-mortem analysis of a frozen bundle.

This PR replaces the hard-coded line with a small harness:

  1. If an argument is passed on the command line, use it as the build path.
  2. Otherwise, glob <repo>/build/exe.macosx-* (the directory pattern
    cx_Freeze produces) and pick the most recent match.
  3. If neither resolves, print a usage message and exit non-zero.

That works on Apple Silicon and Intel Macs, any Python version, and any
macOS SDK. It also addresses the existing XXX: This path should be set programmatically, somehow TODO comment on the same block.

No production code path is changed; this is purely the interactive /
developer-testing harness.

Fourth in a small series of Apple Silicon contributor PRs (following
#6003 label rename, #6004 arch-aware DMG naming, #6005 brew-prefix PATH
in build-mac-dmg.sh).

small CLI + auto-discovery block so the test harness at the bottom of this
file works on any contributor's machine.

The previous default was /Users/jonathanthomas/apps/openshot-qt/build/exe.macosx-10.15-x86_64-3.7,
which embeds a specific developer's home directory, Python 3.7 (EOL), and
the x86_64 architecture. It can only ever resolve correctly on one machine.

After this change the script accepts an optional BUILD_PATH argument, and
falls back to globbing <repo>/build/exe.macosx-* (cx_Freeze's canonical
output pattern) and picking the most recent entry. This works on Apple
Silicon and Intel Macs with any Python or macOS SDK version. If no build
directory is found it prints a clear usage message and exits non-zero.

This also addresses the existing XXX TODO comment on the same block.
The functions fix_rpath() and print_min_versions() themselves are unchanged;
this only touches the __main__ test harness.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant