Hello all,
tldr: I'm trying to figure out why adding a Swift file to this ObjC project breaks compilation specifically when I try to run the existing test suite, complaining about .pcm
files not found (including several that seem to be builtins).
I'm trying to add Swift support to one of the core frameworks in Quicksilver, with the ultimate goal of converting various parts of the project from objc to Swift over time.
I never learned much objc, and I'm not terribly interested in learning, but I've read the Swift book and it appeals to me, which is part of my motivation.
I've added a blank Swift file to the QuickStep Core
(QSCore
) framework, and just adding this file initially broke the build. After adding the SWIFT_VERSION
build setting (to 6.0
) I can build and run, but the tests fail due to a mountain of .pcm file not found
errors.
I've pushed my branch to: GitHub - n8henrie/Quicksilver at swift-qsobj
Here's an example of the error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -ferror-limit 19 -serialize-diagnostic-file /tmp/QS/build/ExplicitPrecompiledModules/_Builtin_float-ZYILCJBUUQN9VL46L7D42OCY.dia -index-store-path /Users/n8henrie/Library/Developer/Xcode/DerivedData/Quicksilver-ansgkardtljcsedwuirmtbxgmigg/Index.noindex/DataStore -fsystem-module -fmodule-map-file\=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c_standard_library.modulemap -o /tmp/QS/build/ExplicitPrecompiledModules/_Builtin_float-ZYILCJBUUQN9VL46L7D42OCY.pcm -disable-free -emit-module -x objective-c /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include/module.modulemap -target-abi darwinpcs -target-cpu apple-m1 -target-feature +v8.5a -target-feature +aes -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +lse -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sha2 -target-feature +sha3 -target-feature +neon -target-feature +zcm -target-feature +zcz -target-feature +fullfp16 -triple arm64-apple-macosx10.14.0 -target-linker-version 1115.7.3 -target-sdk-version\=15.2 -fmodules-validate-system-headers -fno-modules-prune-non-affecting-module-map-files -fno-modulemap-allow-subdirectory-search -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16 -fmodule-format\=obj -fmodule-file\=_float\=/tmp/QS/build/ExplicitPrecompiledModules/_float-8V1LSJ1R0FMV1F1FGJ2FIL87I.pcm -isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include -std\=c99 -fexceptions -fmodules -fmodule-name\=_Builtin_float -fmodules-search-all -fno-implicit-modules -fobjc-exceptions -fmax-type-align\=16 -fstack-check -mdarwin-stkchk-strong-link -fno-odr-hash-protocols -pic-level 2 -disable-objc-default-synthesize-properties -stack-protector 1 -fmodule-related-to-pch -fobjc-runtime\=macosx-10.14.0 -fobjc-arc -fobjc-runtime-has-weak -fobjc-weak -fgnuc-version\=4.2.1 -fblocks -ffp-contract\=off -fclang-abi-compat\=4.0 -fno-experimental-relative-c++-abi-vtables -fno-file-reproducible -clang-vendor-feature\=+disableNonDependentMemberExprInCurrentInstantiation -clang-vendor-feature\=+enableAggressiveVLAFolding -clang-vendor-feature\=+revert09abecef7bbf -clang-vendor-feature\=+thisNoAlignAttr -clang-vendor-feature\=+thisNoNullAttr -clang-vendor-feature\=+disableAtImportPrivateFrameworkInImplementationError -O0 -fcommon -fno-sanitize-address-use-odr-indicator -fno-sanitize-memory-param-retval -fmerge-all-constants -fno-verbose-asm -fregister-global-dtors-with-atexit -fno-use-init-array -funique-basic-block-section-names -dwarf-version\=4 -debugger-tuning\=lldb -llvm-verify-each -dwarf-ext-refs -no-struct-path-tbaa -fexperimental-assignment-tracking\=disabled -no-enable-noundef-analysis -stack-protector-buffer-size 0 -debug-info-kind\=standalone -fdiagnostics-hotness-threshold\=0 -fdiagnostics-misexpect-tolerance\=0 -D DEBUG -D OBJC_OLD_DISPATCH_PROTOTYPES\=0 -D __GCC_HAVE_DWARF2_CFI_ASM\=1 -MT moduledependenciestarget -dependency-file /tmp/QS/build/ExplicitPrecompiledModules/_Builtin_float-ZYILCJBUUQN9VL46L7D42OCY.d -sys-header-deps -skip-unused-modulemap-deps -module-file-deps
While building module '_Builtin_float':
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include/float.h:28:4: fatal error: module file '/tmp/QS/build/ExplicitPrecompiledModules/_float-8V1LSJ1R0FMV1F1FGJ2FIL87I.pcm' not found: module file not found
28 | # include_next <float.h>
| ^
1 error generated.
That file is indeed not there, or anywhere:
$ find -L /tmp/QS ~/Library/Developer/Xcode/DerivedData -name '*8V1LSJ1R0FMV1F1FGJ2FIL87I*.pcm'
$
I've been trying to sort this out for several weeks with no luck (though some of these aren't committed to that branch yet, as they didn't seem to fix anything)
DEFINES_MODULE = YES
- Watched the Apple Dev video on the new explicit modules stuff in XCode 16
- Cleaned and removed
DerivedData
and the/tmp/QS
build folder between all changes CLANG_ENABLE_MODULES = YES
Is this error familiar to anyone? I'd love to hear any suggestions. I've tried making a PoC XCode app with an objc framework, an objc binary using that framework, and a Swift file, and it compiles and tests fine, so I'm not sure where I'm going wrong here. Many thanks in advance for suggestions!
xcode Version 16.2 (16C5032a)
$ sw_vers
ProductName: macOS
ProductVersion: 15.2
BuildVersion: 24C101