Skip to content

build: Restore the generated AUv2 Info.plist on every build - #2

Closed
johnmatter wants to merge 1 commit into
nextfrom
fix/auv2-plist-build-output
Closed

johnmatter wants to merge 1 commit into
nextfrom
fix/auv2-plist-build-output

Conversation

@johnmatter

Copy link
Copy Markdown

context

  • The AUv2 target's real Info.plist is written at build time by the build helper (auv2_Info.plist). It carries the AudioComponents array a host needs to register the AU.
  • The target is BUNDLE True with no MACOSX_BUNDLE_INFO_PLIST, so CMake also writes its own default plist (CFBundlePackageType = APPL, no AudioComponents) into the same bundle.
  • The only thing that put the real plist back was a PRE_BUILD copy (cmake/wrap_auv2.cmake, removed here), which runs only when the AU target relinks.
    • Ninja / Makefiles: CMake writes the default plist into the build-tree bundle at generate time, on every reconfigure. Nothing in the build graph changes, so the next build is a no-op and the bundle keeps the default plist.
    • Xcode: after a reconfigure, Xcode's own ProcessInfoPlistFile runs after the PRE_BUILD copy and before signing, and writes the default plist into the bundle.
  • Result: build, rerun cmake for any reason, build again, install. The installed AU has no AudioComponents, and auval -v fails with Cannot get Component's Name strings / -50 / didn't find the component. That looks like a signing or AU-cache problem, which is what makes it expensive.

what this changes

  • cmake/wrap_auv2.cmake: the build helper's plist becomes a tracked build input on every generator, instead of a copy that runs only on a relink.
    • Xcode: XCODE_ATTRIBUTE_INFOPLIST_FILE points at the build helper's auv2_Info.plist, so Xcode processes the real plist itself, ahead of its signing step. The PRE_BUILD copy is gone.
    • Ninja / Makefiles: a custom command copies the plist into $<TARGET_BUNDLE_CONTENT_DIR> and touches a per-config stamp. The stamp depends on the build helper's plist.
    • Each configure deletes the stamp directory, because configure is when CMake rewrites the plist. The next build therefore always restores the real plist.
    • The stamp is in the AU target's LINK_DEPENDS, so a restore relinks the AU. POST_BUILD steps that patch or sign the bundle run again, and the signature covers the restored plist.
    • The stamp is a source of the AU target itself, not a separate target. In a separate target, $<TARGET_BUNDLE_CONTENT_DIR:…> depends back on the AU target in projects whose policy level predates CMP0112 (e.g. cmake_minimum_required(VERSION 3.15)), which is a dependency cycle.

before this PR

  • Ninja: build → cmake <builddir> → build prints no work to do, and the bundle's plist has no AudioComponents.
  • Xcode: the same sequence ends with the default plist in the bundle, signed.

after this PR

  • Ninja: the build after a reconfigure runs restoring the generated Info.plist and relinks the AU. AudioComponents is back, and the build after that is a no-op.
  • Xcode: AudioComponents survives the reconfigure and the rebuild.
  • An unchanged tree still builds as a no-op on both generators.

tests

  • tests/clap-macos-embedded (-DCLAP_WRAPPER_BUILD_TESTS=ON), Release, macOS, in two runs:
    • build → reconfigure → build → build on Ninja Multi-Config and on Xcode;
    • fresh from-scratch builds on both generators.
    • Before the fix, Ninja and Xcode both ended the sequence without AudioComponents. After it, both keep it.
  • A downstream instrument plugin that signs its bundle in POST_BUILD, same sequence on Ninja Multi-Config and Xcode:
    • Ninja before: AudioComponents missing and codesign --verify --strict failing (invalid Info.plist).
    • After: plist restored and codesign --verify --strict passing.
    • That build was then installed after build → reconfigure → build, and auval -v passed.
  • A fresh parallel Ninja build of tests/clap-macos-embedded can fail with exit 139: the build helper runs before the embedded CLAP finishes linking. It also fails on unmodified main, so it's unrelated to this change, and it's left for a separate fix.

@johnmatter
johnmatter marked this pull request as draft September 29, 2026 18:21
@johnmatter
johnmatter force-pushed the fix/auv2-plist-build-output branch from b98d5ab to fbadd36 Compare September 29, 2026 19:25
@johnmatter
johnmatter changed the base branch from main to next September 29, 2026 19:25
@johnmatter
johnmatter force-pushed the fix/auv2-plist-build-output branch 3 times, most recently from 69ceae2 to dd23afa Compare September 30, 2026 18:59
@johnmatter
johnmatter force-pushed the fix/auv2-plist-build-output branch from dd23afa to a0af163 Compare September 30, 2026 19:03
@johnmatter

Copy link
Copy Markdown
Author

opened as free-audio#579 so we can keep our next even with upstream

@johnmatter johnmatter closed this Sep 30, 2026
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