JUCE 6 CMake: Rez error in CLion after downloading Xcode 12.1

I had successfully been working on a system with Xcode 12.2 beta, Xcode 11.3 and Xcode 11.7 installed in parallel, building a CMake-based universal binary plugin with Xcode 12.2 beta. Today I accidentally installed Xcode 12.1 from the App Store, which replaced my 11.7 installation. After doing so I get errors like

failed to find AudioUnit/AudioUnit.r
Path/To/JUCE/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU.r:27: ### Rez - noErr (0) during open of "AudioUnit.r".

I initially assumed that something wasn’t working with the new Xcode, so I switched back to XC 12.2 beta with xcode-select, but no success. I saw a thread from earlier this year that solved a Rez error in CLion, however I’m quite a bit behind that commit.

Can anyone explain what’s happening here? I have to admit that I have not heard of Rez until today, so I’m a bit unsure where I should even start looking for solutions to this issue?

Have you tried removing your build directory and configuring from scratch? Sometimes changing the Xcode installation can invalidate some of the SDK/framework paths that CMake detected during the project configuration.

Yes I tried that, I even went as far as rebooting the machine after calling xcode-select. In the meantime I deleted Xcode 12.1 downloaded from the App Store, moved Xcode 11.3 into an unused subfolder and checked twice that xcode-select -p tells me I’m using 12.2 beta. In the CMake configuration output I see

...
-- Check for working CXX compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - works
...

So I know it uses Xcode beta to compile the things, which is again verified by the fact that it successfully builds for arm64. And this was my well working setup for several weeks now.

Calling which Rez returns /usr/bin/Rez (which is no symlink) so I’m not even sure if Rez is part of the Xcode Toolchain and therefore if the whole xcode-select thing does anything regarding my problem. Is it possible that installing Xcode 12.1 replaced the Rez version in that directory with something different or incompatible? How is Rez invoked during the build?

This is really driving me crazy :exploding_head:

JUCE will search for Rez in “/Applications/Xcode.app/Contents/Developer/usr/bin” - Could you try renaming Xcode-beta to just Xcode?

:tada:

Indeed. Renaming solved the error.

But what happened here? My assumption: It always used Rez from 11.3 (which was indeed simply named Xcode) and then something else went wrong in the first build attempts after installing 12.1 from the AppStore. Deleting 12.1 from the AppStore then deleted the app bundle with the name Xcode.app which lead to the problems reported above as JUCE always expects it in an app bundle with the exact name Xcode.app. Does that sound sensible?

This would have bitten us as well because we keep different versions of Xcode in the Applications directory, by simply renaming them. Luckily we haven’t switched to CMake yet. Perhaps it would be better to use “xcrun” for these tasks in order to use the tool in use by the current Xcode version, as suggested in the man page for “xcode-select”

Thanks, that’s a great idea! I’ll test that out and hopefully get it merged shortly.

1 Like

Removing NO_DEFAULT_PATHS PATHS /Applications/Xcode.app/Contents/Developer/usr/bin from


might be enough to solve that issue.

CMake will now invoke Rez via xcrun:

1 Like