kyleneideck / BackgroundMusic

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Install Failed on line 233

osaffouri opened this issue · comments

I tried to add the following to lines to add support to Brave browser.

        // Brave
       { "com.brave.Browser", { "com.brave.Browser.helper" } },

However it did not work. I tried cloning from git hub and building without modifying the BGMBackgroundMusicDevice.cpp but it did not work either and I am facing the same issue

below you can find the log from build_and_install.log file

Background Music Build Log
----
Build script args: 
System details:
ProductName:		macOS
ProductVersion:		14.2
BuildVersion:		23C64
Darwin 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)
Copyright (C) 2007 Free Software Foundation, Inc.
On git branch: master
Most recent commit: 4fc776e4a67d54a23ecc25785d999e50e5aa01bf ("Merge pull request #638 from LawrenceWarren/master")
Using xcodebuild: /usr/bin/xcodebuild
Using BGMXPCHelper output path: /usr/local/libexec
xcode-select version 2405.
Xcode path: /Applications/Xcode.app/Contents/Developer
Xcode version:
Xcode 15.2
Build version 15C500b
Xcode SDKs:
DriverKit SDKs:
	DriverKit 23.2                	-sdk driverkit23.2

iOS SDKs:
	iOS 17.2                      	-sdk iphoneos17.2

iOS Simulator SDKs:
	Simulator - iOS 17.2          	-sdk iphonesimulator17.2

macOS SDKs:
	macOS 14.2                    	-sdk macosx14.2
	macOS 14.2                    	-sdk macosx14.2

tvOS SDKs:
	tvOS 17.2                     	-sdk appletvos17.2

tvOS Simulator SDKs:
	Simulator - tvOS 17.2         	-sdk appletvsimulator17.2

visionOS SDKs:
	visionOS 1.0                  	-sdk xros1.0

visionOS Simulator SDKs:
	Simulator - visionOS 1.0      	-sdk xrsimulator1.0

watchOS SDKs:
	watchOS 10.2                  	-sdk watchos10.2

watchOS Simulator SDKs:
	Simulator - watchOS 10.2      	-sdk watchsimulator10.2

xcrun version 67.
Clang version:
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: arm64-apple-darwin23.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
launchctl version: Darwin Bootstrapper Version 7.0.0: Sun Nov 12 00:45:03 PST 2023; root:libxpc_executables-2679.61.1~5/launchd/RELEASE_ARM64E
----
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme "Background Music Device" -configuration Release BUILD_DIR=./build clean

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    BUILD_DIR = ./build

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64e, id:00006000-0014782C26D2801E }
{ platform:macOS, arch:arm64, id:00006000-0014782C26D2801E }
{ platform:macOS, arch:x86_64, id:00006000-0014782C26D2801E }
{ platform:macOS, name:Any Mac }

** CLEAN SUCCEEDED **

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme PublicUtility -configuration Release BUILD_DIR=./build clean

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    BUILD_DIR = ./build

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-0014782C26D2801E }
{ platform:macOS, arch:x86_64, id:00006000-0014782C26D2801E }
{ platform:macOS, name:Any Mac }

** CLEAN SUCCEEDED **

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme BGMXPCHelper -configuration Release BUILD_DIR=./build clean

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    BUILD_DIR = ./build

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-0014782C26D2801E }
{ platform:macOS, arch:x86_64, id:00006000-0014782C26D2801E }
{ platform:macOS, name:Any Mac }

** CLEAN SUCCEEDED **

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme "Background Music" -configuration Release BUILD_DIR=./build clean

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    BUILD_DIR = ./build

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-0014782C26D2801E }
{ platform:macOS, arch:x86_64, id:00006000-0014782C26D2801E }
{ platform:macOS, name:Any Mac }

** CLEAN SUCCEEDED **

[1/3] Installing the virtual audio device �[1mBackground Music Device.driver�(B�[m to �[1m/Library/Audio/Plug-Ins/HAL�(B�[m
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme "Background Music Device" -configuration Release -enableAddressSanitizer NO BUILD_DIR=./build RUN_CLANG_STATIC_ANALYZER=0 DSTROOT=/ install

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    BUILD_DIR = ./build
    DSTROOT = /
    RUN_CLANG_STATIC_ANALYZER = 0

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-0014782C26D2801E }
{ platform:macOS, arch:x86_64, id:00006000-0014782C26D2801E }
{ platform:macOS, name:Any Mac }
Prepare packages

ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (2 targets)
    Target 'Background Music Device' in project 'BGMDriver'
        ➜ Implicit dependency on target 'PublicUtility' in project 'BGMDriver' via file 'libPublicUtility.a' in build phase 'Link Binary'
    Target 'PublicUtility' in project 'BGMDriver' (no dependencies)

GatherProvisioningInputs

CreateBuildDescription
Build description signature: d32f358252ab1dd88e676c930833909f
Build description path: /var/root/Library/Developer/Xcode/DerivedData/BGM-aseeuruirvuvihbvuheiclzpaahi/Build/Intermediates.noindex/ArchiveIntermediates/Background Music Device/IntermediateBuildFilesPath/XCBuildData/d32f358252ab1dd88e676c930833909f.xcbuilddata

CreateBuildDirectory /
    cd /Users/[username removed]/BackgroundMusic
    builtin-create-build-directory /

ClangStatCache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk /var/root/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/macosx14.2-23C53-df0db8920d7ae99241a1bc0f08d2dced.sdkstatcache
    cd /Users/[username removed]/BackgroundMusic
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -o /var/root/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/macosx14.2-23C53-df0db8920d7ae99241a1bc0f08d2dced.sdkstatcache

error: Cycle inside Background Music Device; building could produce unreliable results.
Cycle details:
→ Target 'Background Music Device' has create directory command with output '/Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents'


Raw dependency cycle trace:

target:  ->

node: <all> ->

command: <all> ->

node: /Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents ->

command: P0:target-Background Music Device-daff8cdc730c300e259fca67508b4cc305eed7a9cdaaa1e4a34422325aed31c3-:Release:MkDir /Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents ->

node: <target-Background Music Device-daff8cdc730c300e259fca67508b4cc305eed7a9cdaaa1e4a34422325aed31c3--immediate> ->

command: P0:target-Background Music Device-daff8cdc730c300e259fca67508b4cc305eed7a9cdaaa1e4a34422325aed31c3-:Release:Gate target-Background Music Device-daff8cdc730c300e259fca67508b4cc305eed7a9cdaaa1e4a34422325aed31c3--immediate ->

node: <CreateBuildDirectory-/Users/[username removed]/BackgroundMusic/BGMDriver/build/Release> ->

command: P0:::CreateBuildDirectory /Users/[username removed]/BackgroundMusic/BGMDriver/build/Release ->

CYCLE POINT ->

node: / ->

directoryTreeSignature: � ->

directoryContents: / ->

node: /
/Users/[username removed]/BackgroundMusic/BGMDriver/BGMDriver.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.9, but the range of supported deployment target versions is 10.13 to 14.2.99. (in target 'Background Music Device' from project 'BGMDriver')
warning: Run script build phase 'Run Script - set-version.sh' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Background Music Device' from project 'BGMDriver')
/Users/[username removed]/BackgroundMusic/BGMDriver/BGMDriver.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.9, but the range of supported deployment target versions is 10.13 to 14.2.99. (in target 'PublicUtility' from project 'BGMDriver')
** INSTALL FAILED **

Failure in build_and_install.sh at line 233. The last command was (probably)
    sudo /usr/bin/xcodebuild -scheme Background Music Device -configuration Release -enableAddressSanitizer NO BUILD_DIR=./build RUN_CLANG_STATIC_ANALYZER=0 DSTROOT=/ install
which exited with status 65.
Error message: A build command failed. Probably a compilation error.

I tried to run the following command sudo /usr/bin/xcodebuild -scheme Background Music Device -configuration Release -enableAddressSanitizer NO BUILD_DIR=./build RUN_CLANG_STATIC_ANALYZER=0 DSTROOT=/ install and I got this error

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme Background Music Device -configuration Release -enableAddressSanitizer NO BUILD_DIR=./build RUN_CLANG_STATIC_ANALYZER=0 DSTROOT=/ install

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    BUILD_DIR = ./build
    DSTROOT = /
    RUN_CLANG_STATIC_ANALYZER = 0

2024-01-21 18:22:11.643 xcodebuild[6816:55258] Writing error result bundle to /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/ResultBundle_2024-21-01_18-22-0011.xcresult
xcodebuild: error: Unknown build action 'Music'.

I tried starting up Xcode like another issue suggested but that did not help.

Please note that I installed Xcode in the past for Game porting toolkit. Not sure if this is related. Here is the guide I followed https://www.applegamingwiki.com/wiki/Game_Porting_Toolkit

Found the following when trying to build using XCode

image

Thanks. I've fixed the build in XCode 15.2.

With build_and_install.sh, I'm still getting the error about the build dependency cycle:

error: Cycle inside Background Music Device; building could produce unreliable results.
Cycle details:
→ Target 'Background Music Device' has create directory command with output '/Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents'

But it only happens when you try to install with XCode, so you can use package.sh instead and install the .pkg it builds.

I'm not sure what the error message is trying to say. Hopefully it's just an XCode bug.

Hey Kyle I confirm that I am able to build using package.sh

To be all of this just to add Brave Browser which worked at the end. I was just trying to troubleshoot the issue and maybe i could have helped you with a solution so I tried different ways of troubleshooting from Following the Manual-install, to running the package.sh. Finally the ways I solved everything was by downloading the PKG from githun and installing it. Thankfully the scheme background Music was able to be build through xcode and was able to replace the one in application with the one built using the modified line for Brave browser. But now I can just built the whole package which I think would be better.

Thank you for your support on this. Really appreciate your work.

I encountered installation failures for Background Music v0.4.0 using various methods outlined in the documentation and the release page. Each method resulted in errors that prevented successful installation.

Methods Attempted

  1. Installation via pkg: Downloaded from v0.4.0 release page. The installer failed without a specific error message in the GUI.

  2. Using build_and_install.sh: Ran /bin/bash build_and_install.sh from the cloned repository. Encountered errors related to the build process.

    Background Music Build Log
    ----
    Build script args: 
    System details:
    ProductName:		macOS
    ProductVersion:		14.4
    BuildVersion:		23E5191e
    Darwin 23.4.0 Darwin Kernel Version 23.4.0: Sat Jan 27 14:22:59 PST 2024; root:xnu-10063.100.633~14/RELEASE_ARM64_T8103 arm64
    GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)
    Copyright (C) 2007 Free Software Foundation, Inc.
    On git branch: master
    Most recent commit: 5000c640840553a66d8aeda6f707fe8cbc67ce0a ("Fix build errors in XCode 15.2.")
    Using xcodebuild: /usr/bin/xcodebuild
    Using BGMXPCHelper output path: /usr/local/libexec
    xcode-select version 2406.
    Xcode path: /Applications/Xcode.app/Contents/Developer
    Xcode version:
    Xcode 15.2
    Build version 15C500b
    Xcode SDKs:
    Command line invocation:
        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme "Background Music Device" -configuration Release BUILD_DIR=./build clean
    
    User defaults from command line:
        IDEPackageSupportUseBuiltinSCM = YES
    
    Build settings from command line:
        BUILD_DIR = ./build
    
    DriverKit SDKs:
        DriverKit 23.2                	-sdk driverkit23.2
    
    iOS SDKs:
        iOS 17.2                      	-sdk iphoneos17.2
    
    iOS Simulator SDKs:
        Simulator - iOS 17.2          	-sdk iphonesimulator17.2
    
    macOS SDKs:
        macOS 14.2                    	-sdk macosx14.2
        macOS 14.2                    	-sdk macosx14.2
    
    tvOS SDKs:
        tvOS 17.2                     	-sdk appletvos17.2
    
    tvOS Simulator SDKs:
        Simulator - tvOS 17.2         	-sdk appletvsimulator17.2
    
    visionOS SDKs:
        visionOS 1.0                  	-sdk xros1.0
    
    visionOS Simulator SDKs:
        Simulator - visionOS 1.0      	-sdk xrsimulator1.0
    
    watchOS SDKs:
        watchOS 10.2                  	-sdk watchos10.2
    
    watchOS Simulator SDKs:
        Simulator - watchOS 10.2      	-sdk watchsimulator10.2
    
    xcrun version 67.
    Clang version:
    Apple clang version 15.0.0 (clang-1500.1.0.2.5)
    Target: arm64-apple-darwin23.4.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    launchctl version: Darwin Bootstrapper Version 7.0.0: Tue Jan 30 20:35:06 PST 2024; root:libxpc_executables-2748.100.34.501.2~2/launchd/RELEASE_ARM64E
    ----
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:macOS, arch:arm64e, id:00008103-000918C90A07C01E }
    { platform:macOS, arch:arm64, id:00008103-000918C90A07C01E }
    { platform:macOS, arch:x86_64, id:00008103-000918C90A07C01E }
    { platform:macOS, name:Any Mac }
    
    ** CLEAN SUCCEEDED **
    
    Command line invocation:
        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme PublicUtility -configuration Release BUILD_DIR=./build clean
    
    User defaults from command line:
        IDEPackageSupportUseBuiltinSCM = YES
    
    Build settings from command line:
        BUILD_DIR = ./build
    
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:macOS, arch:arm64, id:00008103-000918C90A07C01E }
    { platform:macOS, arch:x86_64, id:00008103-000918C90A07C01E }
    { platform:macOS, name:Any Mac }
    
    ** CLEAN SUCCEEDED **
    
    Command line invocation:
        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme BGMXPCHelper -configuration Release BUILD_DIR=./build clean
    
    User defaults from command line:
        IDEPackageSupportUseBuiltinSCM = YES
    
    Build settings from command line:
        BUILD_DIR = ./build
    
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:macOS, arch:arm64, id:00008103-000918C90A07C01E }
    { platform:macOS, arch:x86_64, id:00008103-000918C90A07C01E }
    { platform:macOS, name:Any Mac }
    
    ** CLEAN SUCCEEDED **
    
    Command line invocation:
        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme "Background Music" -configuration Release BUILD_DIR=./build clean
    
    User defaults from command line:
        IDEPackageSupportUseBuiltinSCM = YES
    
    Build settings from command line:
        BUILD_DIR = ./build
    
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:macOS, arch:arm64, id:00008103-000918C90A07C01E }
    { platform:macOS, arch:x86_64, id:00008103-000918C90A07C01E }
    { platform:macOS, name:Any Mac }
    
    ** CLEAN SUCCEEDED **
    
    [1/3] Installing the virtual audio device �[1mBackground Music Device.driver�(B�[m to �[1m/Library/Audio/Plug-Ins/HAL�(B�[m
    Command line invocation:
        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -scheme "Background Music Device" -configuration Release -enableAddressSanitizer NO BUILD_DIR=./build RUN_CLANG_STATIC_ANALYZER=0 DSTROOT=/ install
    
    User defaults from command line:
        IDEPackageSupportUseBuiltinSCM = YES
    
    Build settings from command line:
        BUILD_DIR = ./build
        DSTROOT = /
        RUN_CLANG_STATIC_ANALYZER = 0
    
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:macOS, arch:arm64, id:00008103-000918C90A07C01E }
    { platform:macOS, arch:x86_64, id:00008103-000918C90A07C01E }
    { platform:macOS, name:Any Mac }
    Prepare packages
    
    ComputeTargetDependencyGraph
    note: Building targets in dependency order
    note: Target dependency graph (2 targets)
        Target 'Background Music Device' in project 'BGMDriver'
            ➜ Implicit dependency on target 'PublicUtility' in project 'BGMDriver' via file 'libPublicUtility.a' in build phase 'Link Binary'
        Target 'PublicUtility' in project 'BGMDriver' (no dependencies)
    
    GatherProvisioningInputs
    
    CreateBuildDescription
    Build description signature: 88f30293d45f95ad0023a5d331d85c84
    Build description path: /var/root/Library/Developer/Xcode/DerivedData/BGM-fhogmjnucmphgedkkqhbppmwfzgf/Build/Intermediates.noindex/ArchiveIntermediates/Background Music Device/IntermediateBuildFilesPath/XCBuildData/88f30293d45f95ad0023a5d331d85c84.xcbuilddata
    
    CreateBuildDirectory /
        cd /Users/[username removed]/Developer/personal/sound
        builtin-create-build-directory /
    
    ClangStatCache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk /var/root/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/macosx14.2-23C53-df0db8920d7ae99241a1bc0f08d2dced.sdkstatcache
        cd /Users/[username removed]/Developer/personal/sound
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -o /var/root/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/macosx14.2-23C53-df0db8920d7ae99241a1bc0f08d2dced.sdkstatcache
    
    error: Cycle inside Background Music Device; building could produce unreliable results.
    Cycle details:
    → Target 'Background Music Device' has create directory command with output '/Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents'
    
    
    Raw dependency cycle trace:
    
    target:  ->
    
    node: <all> ->
    
    command: <all> ->
    
    node: /Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents ->
    
    command: P0:target-Background Music Device-daff8cdc730c300e259fca67508b4cc305eed7a9cdaaa1e4a34422325aed31c3-:Release:MkDir /Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents ->
    
    node: <target-Background Music Device-daff8cdc730c300e259fca67508b4cc305eed7a9cdaaa1e4a34422325aed31c3--immediate> ->
    
    command: P0:target-Background Music Device-daff8cdc730c300e259fca67508b4cc305eed7a9cdaaa1e4a34422325aed31c3-:Release:Gate target-Background Music Device-daff8cdc730c300e259fca67508b4cc305eed7a9cdaaa1e4a34422325aed31c3--immediate ->
    
    node: <CreateBuildDirectory-/Users/[username removed]/Developer/personal/sound/BGMDriver/build/Release> ->
    
    command: P0:::CreateBuildDirectory /Users/[username removed]/Developer/personal/sound/BGMDriver/build/Release ->
    
    CYCLE POINT ->
    
    node: / ->
    
    directoryTreeSignature: � ->
    
    directoryContents: / ->
    
    node: /
    warning: Run script build phase 'Run Script - set-version.sh' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Background Music Device' from project 'BGMDriver')
    ** INSTALL FAILED **
    
    Failure in build_and_install.sh at line 233. The last command was (probably)
        sudo /usr/bin/xcodebuild -scheme Background Music Device -configuration Release -enableAddressSanitizer NO BUILD_DIR=./build RUN_CLANG_STATIC_ANALYZER=0 DSTROOT=/ install
    which exited with status 65.
    Error message: A build command failed. Probably a compilation error.
  3. Using package.sh: Executed /bin/bash package.sh, which produced BackgroundMusic-0.4.0-SNAPSHOT-5000c64.unsigned.pkg. The package installation failed without detailed error messages.

  4. Manual Installation: Followed steps in MANUAL-INSTALL.md up to installing the virtual audio device Background Music Device.driver to /Library/Audio/Plug-Ins/HAL/ using the command:

    sudo xcodebuild -project BGMDriver/BGMDriver.xcodeproj \
                    -target "Background Music Device" \
                    RUN_CLANG_STATIC_ANALYZER=0 \
                    DSTROOT="/" \
                    clean install

    This resulted in error without noticeble details.

  5. Xcode Manual Archiving: Attempted manual archiving through Xcode, which failed with similar SetOwnerAndGroup root:wheel permissions errors.

    SetOwnerAndGroup root:wheel /Users/redacted/Library/Developer/Xcode/DerivedData/BGMDriver-hjqirthjtudxvphirpcxjmdylyku/Build/Intermediates.noindex/ArchiveIntermediates/Background\ Music\ Device/InstallationBuildProductsLocation/Library/Audio/Plug-Ins/HAL/Background\ Music\ Device.driver (in target 'Background Music Device' from project 'BGMDriver')
        cd /Users/redacted/Developer/personal/sound/BGMDriver
        /usr/sbin/chown -RH root:wheel /Users/redacted/Library/Developer/Xcode/DerivedData/BGMDriver-hjqirthjtudxvphirpcxjmdylyku/Build/Intermediates.noindex/ArchiveIntermediates/Background\ Music\ Device/InstallationBuildProductsLocation/Library/Audio/Plug-Ins/HAL/Background\ Music\ Device.driver
    
    chown: /Users/redacted/Library/Developer/Xcode/DerivedData/BGMDriver-hjqirthjtudxvphirpcxjmdylyku/Build/Intermediates.noindex/ArchiveIntermediates/Background Music Device/InstallationBuildProductsLocation/Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents/MacOS/Background Music Device: Operation not permitted
    chown: /Users/redacted/Library/Developer/Xcode/DerivedData/BGMDriver-hjqirthjtudxvphirpcxjmdylyku/Build/Intermediates.noindex/ArchiveIntermediates/Background Music Device/InstallationBuildProductsLocation/Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents/MacOS: Operation not permitted
    chown: /Users/redacted/Library/Developer/Xcode/DerivedData/BGMDriver-hjqirthjtudxvphirpcxjmdylyku/Build/Intermediates.noindex/ArchiveIntermediates/Background Music Device/InstallationBuildProductsLocation/Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents/Resources/DeviceIcon.icns: Operation not permitted
    chown: /Users/redacted/Library/Developer/Xcode/DerivedData/BGMDriver-hjqirthjtudxvphirpcxjmdylyku/Build/Intermediates.noindex/ArchiveIntermediates/Background Music Device/InstallationBuildProductsLocation/Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents/Resources: Operation not permitted
    chown: /Users/redacted/Library/Developer/Xcode/DerivedData/BGMDriver-hjqirthjtudxvphirpcxjmdylyku/Build/Intermediates.noindex/ArchiveIntermediates/Background Music Device/InstallationBuildProductsLocation/Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents/Info.plist: Operation not permitted
    chown: /Users/redacted/Library/Developer/Xcode/DerivedData/BGMDriver-hjqirthjtudxvphirpcxjmdylyku/Build/Intermediates.noindex/ArchiveIntermediates/Background Music Device/InstallationBuildProductsLocation/Library/Audio/Plug-Ins/HAL/Background Music Device.driver/Contents: Operation not permitted
    chown: /Users/redacted/Library/Developer/Xcode/DerivedData/BGMDriver-hjqirthjtudxvphirpcxjmdylyku/Build/Intermediates.noindex/ArchiveIntermediates/Background Music Device/InstallationBuildProductsLocation/Library/Audio/Plug-Ins/HAL/Background Music Device.driver: Operation not permitted
    Command SetOwnerAndGroup failed with a nonzero exit code
    

System Information

  • macOS Version: 14.4
  • Build Version: 23E5191e
  • Xcode Version: 15.2 (Build version 15C500b)
  • Architecture: arm64
  • Error Messages: Encountered Operation not permitted during SetOwnerAndGroup root:wheel for various components within the Background Music Device driver's directory.
     Line 233. The last command was (probably)
     sudo /usr/bin/xcodebuild -scheme Background Music Device -configuration Release -enableAddressSanitizer NO BUILD_DIR=./build RUN_CLANG_STATIC_ANALYZER=0 DSTROOT=/ install
     which exited with status 65.
    

I found a way to convince xcodebuild there's no dependency cycle, so build_and_install.sh should work now.

@preckrasno Thanks for the detailed info. You might be able to find some logs from the .pkg installers in /var/log/install.log.

I get the same error when I try to archive BGMDriver in Xcode. It looks like archiving works by doing a sort of fake install, but Background Music Device.driver (the build product of BGMDriver) needs to be owned by root and Xcode doesn't elevate permissions so it can do that. I don't know if we can fix that, but you could try changing INSTALL_OWNER and INSTALL_GROUP temporarily in BGMDriver > Build Settings as a workaround.

so build_and_install.sh should work now.

Confirmed, build_and_install.sh works flawlessly now. Thanks for the workaround and the detailed guidance!