I've made a command-line application in Swift that until recently ran just fine. I believe it was after upgrading to macOS 14.4, however, that it stopped working properly. I can still build the application in Xcode with ⌘B, but building it from terminal with swift build -c debug (or release) produces an error message stating that linking failed:
Undefined symbols for architecture arm64:
"(extension in pmax):Swift.String.includeCommentsInAssembly.unsafeMutableAddressor : Swift.Bool", referenced from:
pmax.Build.run() throws -> () in Build.swift.o
pmax.AssemblyLowerer.(lowerAsExecutable in _B842627F49AC85AC0E595B2E225F391B)(inout Swift.String) -> () in _AssemblyLowerer.swift.o
pmax.TACStatement.lowerToBreadboardAssembly() -> Swift.String in _asm_tac.swift.o
"(extension in pmax):Swift.String.build(Swift.String, Swift.String?) -> Swift.String", referenced from:
pmax.TACStatement.lowerToBreadboardAssembly() -> Swift.String in _asm_tac.swift.o
(extension in pmax):Swift.String.ldraw(Swift.Int, Swift.Int, Swift.String?) -> Swift.String in instructions.swift.o
(extension in pmax):Swift.String.li(Swift.Int, Swift.Int, Swift.String?) -> Swift.String in instructions.swift.o
(extension in pmax):Swift.String.lidata(Swift.Int, Swift.Int, Swift.String?) -> Swift.String in instructions.swift.o
(extension in pmax):Swift.String.mv(Swift.Int, Swift.Int, Swift.String?) -> Swift.String in instructions.swift.o
(extension in pmax):Swift.String.mv(Swift.Int, Swift.Int, Swift.String?) -> Swift.String in instructions.swift.o
(extension in pmax):Swift.String.addi(Swift.Int, Swift.Int, Swift.Int, Swift.String?) -> Swift.String in instructions.swift.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: fatalError
I've tried cleaning the build folder (rm -rf .build) and updating packages (swift package update). What's interesting is that other Swift applications can still be built from the terminal, indicating that this is an issue with my application, and not with the Swift compiler or toolchain. I realize that it may be difficult to point to exactly where things go wrong, but if this seems familiar or anyone has an idea, input is greatly appreciated.