Skip to content

swift-frontend crashes when importing the Merge package #55

@PatrikTheDev

Description

@PatrikTheDev

When I try building a trivial node-swift project (single function export) with the Merge package as a dependency (seems to fail when compiling Swallow, which is its dependency), I get a swift-frontend crash when building. Reproduction repo url: https://github.com/PatrikTheDev/node-swift-repro

This is the crash log of the build:

etched https://github.com/swift-precompiled/swift-syntax/releases/download/601.0.1/SwiftSyntax.xcframework.zip from cache (15.32s)
warning: 'node-swift': Conflicting identity for swift-syntax: dependency 'github.com/swiftlang/swift-syntax' and dependency 'github.com/swift-precompiled/swift-syntax' both point to the same package identity 'swift-syntax'. The dependencies are introduced through the following chains: (A) /users/patrikthedev/developer/preternaturalai/node-swift repro->/users/patrikthedev/developer/preternaturalai/node-swift repro/node_modules/node-swift->github.com/swiftlang/swift-syntax (B) /users/patrikthedev/developer/preternaturalai/node-swift repro->github.com/vmanot/merge->github.com/vmanot/swallow->github.com/swift-precompiled/swift-syntax. If there are multiple chains that lead to the same dependency, only the first chain is shown here. To see all chains use debug output option. To resolve the conflict, coordinate with the maintainer of the package that introduces the conflicting dependency. This will be escalated to an error in future versions of SwiftPM.
Building for production...
warning: /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/_SwiftConcurrencyShims-2989G9GLT3DSZ.pcm: No such file or directory
note: while processing /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/_SwiftConcurrencyShims-2989G9GLT3DSZ.pcm
note: Linking a static library that was built with -gmodules, but the module cache was not found.  Redistributable static libraries should never be built with module debugging enabled.  The debug experience will be degraded due to incomplete debug information.
warning: /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/SwiftShims-2989G9GLT3DSZ.pcm: No such file or directory
note: while processing /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/SwiftShims-2989G9GLT3DSZ.pcm
warning: /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/os-1DIG4WL3COIEV.pcm: No such file or directory
note: while processing /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/os-1DIG4WL3COIEV.pcm
warning: /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/_SwiftSyntaxCShims-W1JVF2739CML.pcm: No such file or directory
note: while processing /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/_SwiftSyntaxCShims-W1JVF2739CML.pcm
warning: /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/Darwin-1FDXAULVNOBC7.pcm: No such file or directory
note: while processing /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/Darwin-1FDXAULVNOBC7.pcm
warning: /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/_stdio-3U4CIMKS93NEK.pcm: No such file or directory
note: while processing /Users/admin/actions-runner/_work/swift-precompiled-workflows/swift-precompiled-workflows/output_swift-syntax_601.0.1/build/swift-syntax_601.0.1_Precompile/.build/scipio/DerivedData/ModuleCache.noindex/2J61N9D3N6Z3X/_stdio-3U4CIMKS93NEK.pcm
error: compile command failed due to signal 11 (use -v to see invocation)
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.      Program arguments: /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -filelist /var/folders/ds/3_x9r7c16bl2vwb9sm6y8k7m0000gn/T/TemporaryDirectory.y4KU6F/sources-1 -supplementary-output-file-map /var/folders/ds/3_x9r7c16bl2vwb9sm6y8k7m0000gn/T/TemporaryDirectory.y4KU6F/supplementaryOutputs-1 -target arm64-apple-macosx11.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk -I "/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/.build/arm64-apple-macosx/release/Modules" -I /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -F /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -color-diagnostics -Xcc -fcolor-diagnostics -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path "/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/.build/arm64-apple-macosx/release/ModuleCache" -suppress-warnings -swift-version 5 -O -D SWIFT_PACKAGE -D SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE -new-driver-path /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -enable-experimental-feature AccessLevelOnImport -empty-abi-descriptor -plugin-path /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing -file-compilation-dir "/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro" -Xcc "-fmodule-map-file=/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/.build/checkouts/Swallow/Sources/_RuntimeC/include/module.modulemap" -Xcc -I -Xcc "/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/.build/checkouts/Swallow/Sources/_RuntimeC/include" -Xcc -isysroot -Xcc /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk -Xcc -F -Xcc /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -F -Xcc /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -Xcc -fPIC -Xcc -g -no-auto-bridging-header-chaining -module-name Swallow -package-name swallow -disable-clang-spi -target-sdk-version 26.0 -target-sdk-name macosx26.0 -external-plugin-path /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -in-process-plugin-server-path /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode-26.0.0-Beta.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -enable-default-cmo -parse-as-library -num-threads 8 -output-filelist /var/folders/ds/3_x9r7c16bl2vwb9sm6y8k7m0000gn/T/TemporaryDirectory.y4KU6F/outputs-1
1.      Apple Swift version 6.2 (swiftlang-6.2.0.10.950 clang-1700.3.10.950)
2.      Compiling with effective version 5.10
3.      While emitting IR SIL function "@$s7Swallow21_initializeNilLiteral6ofTypexxm_tKlFAA12_StaticSwiftC07GenericF21ParameterNameProtocol_pSg_Tt0g5".
 for '_initializeNilLiteral(ofType:)' (at /Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/.build/checkouts/Swallow/Sources/Swallow/Intermodular/Helpers/Swift/OptionalProtocol.swift:128:8)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x000000010969b450 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000109698de0 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x000000010969ba7c SignalHandler(int, __siginfo*, void*) + 344
3  libsystem_platform.dylib 0x0000000199dca704 _sigtramp + 56
4  swift-frontend           0x00000001038e9088 swift::irgen::emitWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanType, llvm::Value**, swift::ProtocolConformanceRef) + 52
5  swift-frontend           0x00000001038e9088 swift::irgen::emitWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanType, llvm::Value**, swift::ProtocolConformanceRef) + 52
6  swift-frontend           0x00000001038286a4 forEachProtocolWitnessTable(swift::irgen::IRGenFunction&, swift::CanType, llvm::Value**, swift::CanType, llvm::ArrayRef<swift::ProtocolDecl const*>, llvm::ArrayRef<swift::ProtocolConformanceRef>, llvm::function_ref<void (unsigned int, llvm::Value*)>) + 284
7  swift-frontend           0x0000000103828d0c swift::irgen::emitExistentialMetatypeContainer(swift::irgen::IRGenFunction&, swift::irgen::Explosion&, swift::SILType, llvm::Value*, swift::SILType, llvm::ArrayRef<swift::ProtocolConformanceRef>) + 740
8  swift-frontend           0x00000001039c9740 (anonymous namespace)::IRGenSILFunction::visitSILBasicBlock(swift::SILBasicBlock*) + 84360
9  swift-frontend           0x00000001039b36e8 (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 15996
10 swift-frontend           0x00000001039af3c0 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 2848
11 swift-frontend           0x00000001037c75ec swift::irgen::IRGenerator::emitLazyDefinitions() + 5204
12 swift-frontend           0x000000010395f9f4 swift::performIRGeneration(swift::ModuleDecl*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, llvm::GlobalVariable**) + 2844
13 swift-frontend           0x000000010330d964 generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>) + 216
14 swift-frontend           0x0000000103308f50 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 2108
15 swift-frontend           0x00000001033085c0 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 2680
16 swift-frontend           0x000000010330b274 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1764
17 swift-frontend           0x0000000103309e90 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3580
18 swift-frontend           0x000000010328b444 swift::mainEntry(int, char const**) + 5412
19 dyld                     0x0000000199a09924 start + 6400
[138/144] Compiling _SwallowSwiftOverlay NSError++.swift
323 |                 },
324 |             }
325 |         );
326 | 
327 |         if (result.status !== 0) {
328 |             throw new Error(`swift build exited with status ${result.status}`);
                        ^
error: swift build exited with status 1
      at build (/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/node_modules/node-swift/src/builder.ts:328:19)
      at build (/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/node_modules/node-swift/src/builder.ts:90:29)
      at doBuild (/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/node_modules/node-swift/src/cli.ts:25:19)
      at doBuild (/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/node_modules/node-swift/src/cli.ts:15:23)
      at <anonymous> (/Users/patrikthedev/Developer/PreternaturalAI/node-swift repro/node_modules/node-swift/src/cli.ts:42:19)

Bun v1.2.17 (macOS arm64)
error: script "postinstall" exited with code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions