Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcodebuild is broken with fink-bld home directory on macOS 14 / Xcode 15 #1115

Open
dhomeier opened this issue Jan 6, 2024 · 2 comments
Open

Comments

@dhomeier
Copy link
Contributor

dhomeier commented Jan 6, 2024

On Sonoma 14.2.1 with Xcode 15.1 builds calling xcodebuild fail because it is trying to create stuff in the fink-bld user's Directory Services NFSHomeDirectory, which is /var/empty, rather than the $HOME set up by Fink.
There are various defaults in showBuildSettings using this, all of which afaics can be pointed to Fink's $HOME by setting 3 variables, but xcodebuild then still tries to create cache and log directories, the location of which I have not found any settings to control (for building launch below):

/usr/bin/xcodebuild -UsePerConfigurationBuildLocations=NO SYMROOT=. OBJROOT=. HOME=$HOME MODULE_CACHE_DIR=${HOME}/Library/Developer/Xcode/DerivedData/ModuleCache.noindex SHARED_PRECOMPS_DIR=${HOME}/Library/Developer/Xcode/DerivedData/PrecompiledHeaders
2024-01-06 01:06:24.395 xcodebuild[96395:26968448] [MT] DVTDownloadable: Error creating downloadable cache directory file:///var/empty/Library/Caches/com.apple.dt.Xcode/Downloads/
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -UsePerConfigurationBuildLocations=NO SYMROOT=. OBJROOT=. HOME=/tmp/fink-build-HOME.o1Oo_jWsBi MODULE_CACHE_DIR=/tmp/fink-build-HOME.o1Oo_jWsBi/Library/Developer/Xcode/DerivedData/ModuleCache.noindex SHARED_PRECOMPS_DIR=/tmp/fink-build-HOME.o1Oo_jWsBi/Library/Developer/Xcode/DerivedData/PrecompiledHeaders

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES
    UsePerConfigurationBuildLocations = NO

Build settings from command line:
    HOME = /tmp/fink-build-HOME.o1Oo_jWsBi
    MODULE_CACHE_DIR = /tmp/fink-build-HOME.o1Oo_jWsBi/Library/Developer/Xcode/DerivedData/ModuleCache.noindex
    OBJROOT = .
    SHARED_PRECOMPS_DIR = /tmp/fink-build-HOME.o1Oo_jWsBi/Library/Developer/Xcode/DerivedData/PrecompiledHeaders
    SYMROOT = .

2024-01-06 01:06:24.456 xcodebuild[96395:26968449] Error Domain=com.apple.CoreSimulator.SimError Code=400 "Unable to determine SimDeviceSet for subscriptions, s
et_path=/var/empty/Library/Developer/CoreSimulator/Devices" UserInfo={NSLocalizedDescription=Unable to determine SimDeviceSet for subscriptions, set_path=/var/e
mpty/Library/Developer/CoreSimulator/Devices, NSUnderlyingError=0x600000e46d90 {Error Domain=NSPOSIXErrorDomain Code=12 "Cannot allocate memory" UserInfo={NSLocalizedFailureReason=Allocation or initialization failed., NSLocalizedDescription=Failed to initialize simulator device set.}}}
2024-01-06 01:06:24.457 xcodebuild[96395:26968449]  iOSSimulator: [SimServiceContext defaultDeviceSetWithError:] returned nil (Error Domain=com.apple.CoreSimulator.SimError Code=400 "Failed to initialize simulator device set." UserInfo={NSLocalizedFailureReason=Failed to subscribe to notifications from CoreSimulatorService., NSLocalizedDescription=Failed to initialize simulator device set., NSUnderlyingError=0x600000e46e20 {Error Domain=com.apple.CoreSimulator.SimError Code=400 "Unable to determine SimDeviceSet for subscriptions, set_path=/var/empty/Library/Developer/CoreSimulator/Devices" UserInfo={NSLocalizedDescription=Unable to determine SimDeviceSet for subscriptions, set_path=/var/empty/Library/Developer/CoreSimulator/Devices, NSUnderlyingError=0x600000e46d90 {Error Domain=NSPOSIXErrorDomain Code=12 "Cannot allocate memory" UserInfo={NSLocalizedFailureReason=Allocation or initialization failed., NSLocalizedDescription=Failed to initialize simulator device set.}}}}}). Simulator device support disabled.
2024-01-06 01:06:24.472 xcodebuild[96395:26968448] [MT] IDELogStore: Failed to open log store at /var/empty/Library/Developer/Xcode/DerivedData/launch-ehjqpeknmgsahvbptwsevkqbqpyf/Logs/Build
2024-01-06 01:06:24.473 xcodebuild[96395:26968448] [MT] IDELogStore: Failed to open Build log store: Error Domain=IDEFoundationErrorDomain Code=1 "Unable to create log store directory at '/var/empty/Library/Developer/Xcode/DerivedData/launch-ehjqpeknmgsahvbptwsevkqbqpyf/Logs/Build': (513) You don?<80><99>t have permission to save the file ?<80><9C>Build?<80><9D> in the folder ?<80><9C>Logs?<80><9D>." UserInfo={NSLocalizedDescription=Unable to create log store directory at '/var/empty/Library/Developer/Xcode/DerivedData/launch-ehjqpeknmgsahvbptwsevkqbqpyf/Logs/Build': (513) You don?<80><99>t have permission to save the file ?<80><9C>Build?<80><9D> in the folder ?<80><9C>Logs?<80><9D>.}. User info: {
    NSLocalizedDescription = "Unable to create log store directory at '/var/empty/Library/Developer/Xcode/DerivedData/launch-ehjqpeknmgsahvbptwsevkqbqpyf/Logs/Build': (513) You don\U2019t have permission to save the file \U201cBuild\U201d in the folder \U201cLogs\U201d.";
}.
2024-01-06 01:06:24.476 xcodebuild[96395:26968478] NetworkStorageDB:_openDBReadConnections: failed to open read connection to DB @ /var/empty/Library/Caches/com.apple.dt.xcodebuild/Cache.db.  Error=14. Cause=unable to open database file

and so on...

@dmacks
Copy link
Member

dmacks commented Jan 6, 2024

Thanks for the centralized report on the underlying general bug! Possible lead (I didn't know MacPorts now uses a similar game to our fink-bld sandbox): https://trac.macports.org/ticket/57137

@dhomeier
Copy link
Contributor Author

dhomeier commented Jan 6, 2024

That seems to be a different and older issue, but setting derivedDataPath is in fact already implemented in our aquaterm, and it builds. Setting the same options in launch it builds, too!
The other 2 packages I found using xcodebuild, osxfuse and telnet still fail on other build errors; possibly those projects are too far behind any recent Xcode version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants