Skip to content

Conversation

@adamnsch
Copy link
Contributor

@adamnsch adamnsch commented Dec 9, 2025

Thanks for making a Pull Request!
Please fill out this template so that you can be sure that your PR does everything it needs to be accepted.

Description

Fixes a bug in the macOS resource copying script where TARGET_BUILD_DIR and UNLOCALIZED_RESOURCES_FOLDER_PATH were concatenated without a path separator, causing resources to be copied to an invalid path.

Before: /Users/name/ApplicationsApp.app/Contents/Resources (missing slash)
After: /Users/name/Applications/App.app/Contents/Resources (correct)

This caused the standalone app to crash on startup with a segmentation fault when trying to render UI elements with missing bitmaps.

PR Checklist (none are applicable for this change)

  • Did you format your code using format.bash?
  • Does the VST3 plugin pass all of the unit tests in the VST3PluginTestHost? (Download it as part of the VST3 SDK here.)
    • Windows
    • macOS
  • Does your PR add, remove, or rename any plugin parameters? If yes...
    • Have you ensured that the plug-in unserializes correctly?
    • Have you ensured that older versions of the plug-in load correctly? (See Unserialization.cpp.)
  • Does your PR add or remove any graphical assets? If yes, are they defined in config.h and added in the two required locations in main.rc?

Use os.path.join() instead of string concatenation to properly join
TARGET_BUILD_DIR and UNLOCALIZED_RESOURCES_FOLDER_PATH. Without this fix,
resources were copied to an invalid path (e.g. '/Users/name/ApplicationsApp.app'
instead of '/Users/name/Applications/App.app'), causing the app to crash on
startup due to missing UI resources.
@adamnsch adamnsch marked this pull request as ready for review December 9, 2025 10:17
@sdatkinson
Copy link
Owner

Nice. Two questions if you know:

  • Users have reported the AU crashing in Logic. I wonder if this is the root cause.
  • Any suggestions how this might be asserted in a test? It'd be good for this to stay fixed :)

@sdatkinson sdatkinson merged commit 512f5c6 into sdatkinson:main Dec 11, 2025
2 checks passed
@adamnsch adamnsch deleted the fix/mac-resource-path-concatenation branch December 12, 2025 08:18
@adamnsch
Copy link
Contributor Author

Hi @sdatkinson,

Users have reported the AU crashing in Logic. I wonder if this is the root cause.

Yes, that might be the issue. Do you have any bug reports/stack traces? I don't think it should impact AU and Logic specifically though, and I'm an Ableton user myself so cannot really test it

Any suggestions how this might be asserted in a test? It'd be good for this to stay fixed :)

Yes, I think we could add something this to .github/workflows/build-native.yml:

    - name: Verify macOS bundle resources
      if: matrix.os == 'macOS-latest'
      run: |
        # Unzip the built artifact to verify resources were copied correctly
        cd ${{env.PROJECT_NAME}}/${{matrix.build_dir}}/out
        unzip -q *-mac.zip -d verify_tmp

        # Check each plugin bundle has resources
        for BUNDLE in verify_tmp/*.component verify_tmp/*.vst3; do
          if [ ! -d "$BUNDLE" ]; then
            continue
          fi

          RESOURCES="$BUNDLE/Contents/Resources"
          BUNDLE_NAME=$(basename "$BUNDLE")

          if [ ! -d "$RESOURCES" ]; then
            echo "ERROR: Resources directory missing in $BUNDLE_NAME"
            rm -rf verify_tmp
            exit 1
          fi

          COUNT=$(ls -1 "$RESOURCES" 2>/dev/null | wc -l)
          if [ "$COUNT" -eq 0 ]; then
            echo "ERROR: Resources directory is empty in $BUNDLE_NAME"
            rm -rf verify_tmp
            exit 1
          fi

          echo "$BUNDLE_NAME has $COUNT resources"
        done

        # Cleanup
        rm -rf verify_tmp
        echo "All macOS bundles verified successfully"
      shell: bash

At least it works locally on my machine (fails before fix, and passes after). We could also verify the path directly in the prepare_resources-mac.py script, but that kind of depends on an implementation detail and is less robust I think

Btw, let me know if you have any good "first issues" or smaller projects you want me to pick up. Would love to contribute more to this fantastic project :)

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.

2 participants