Build ignoring changes in .def files

Hi everyone!

I've been trying to get started contributing to the Swift project. I've followed the Getting started guide in GitHub and I was able to set up the dev environment and make changes to swift-frontend successfully. Yay!

However, I'm having trouble editing .def files. It seems like editing these files has no effect: changing an error string (for example) in DiagnosticsSema.def and type-checking a test file with $ bin/swift-frontend type-check still uses the old error string (even though there's no reference to it anywhere in the project anymore!).

On the other hand, changes to any other files (like .cpp files) do change the output of bin/swift-frontend just fine.

Any ideas why this is happening? :sweat_smile: I'm rebuilding with this command:

ninja -C ../build/Ninja-RelWithDebInfoAssert/swift-${platform}-$(uname -m) bin/swift-frontend

But even doing a full rebuild with this:

utils/build-script --skip-build-benchmarks \
  --skip-ios --skip-watchos --skip-tvos --skip-xros --swift-darwin-supported-archs "$(uname -m)" \
  --sccache --release-debuginfo --swift-disable-dead-stripping \
  --bootstrapping=hosttools

Seems to use the "old" version of the .def file.

EDIT: If it helps, Xcode is perfectly able to see and autocomplete with changes in this .def file, it's just ninja that can't see them afterwards. The error logs in this case are:

Summary
raul@Rauls-MacBook-Pro swift % ninja -C ../build/Ninja-RelWithDebInfoAssert/swift-${platform}-$(uname -m) bin/swift-frontend
ninja: Entering directory `../build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64'
[3/3] Linking CXX executable bin/swift-frontend
FAILED: bin/swift-frontend 
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O2 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -lobjc   -target arm64-apple-macosx10.13 -Xlinker -no_warn_duplicate_libraries -Xlinker /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/libz.tbd -Xlinker /opt/homebrew/lib/libzstd.dylib -Xlinker /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/libcurses.tbd -Xlinker /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMDemangle.a -Xlinker -add_ast_path -Xlinker /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/ASTGen/modules/swiftASTGen.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/ASTGen/modules/_CompilerRegexParser.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib/ASTGen/modules/swiftIDEUtilsBridging.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/SwiftCompilerSources/Basic.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/SwiftCompilerSources/SIL.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/SwiftCompilerSources/Optimizer.swiftmodule tools/driver/CMakeFiles/swift-frontend.dir/driver.cpp.o -o bin/swift-frontend -L/Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/./lib   -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx   -L/Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/lib -Wl,-rpath,/usr/lib/swift -Wl,-rpath,@executable_path/../lib/swift/host/compiler  lib/libswiftDriverTool.a  lib/libswiftCompilerModules.a  -lswiftCore  lib/libswiftFrontendTool.a  lib/libswiftDependencyScan.a  lib/libswiftDependencyScanImpl.a  lib/libswiftImmediate.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMCJIT.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMOrcJIT.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMExecutionEngine.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMRuntimeDyld.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMJITLink.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMOrcTargetProcess.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMOrcShared.a  lib/libswiftIndex.a  lib/libswiftMigrator.a  lib/libswiftPrintAsClang.a  lib/libswiftFrontend.a  lib/libswiftAPIDigester.a  lib/libswiftConstExtract.a  lib/libswiftLocalization.a  lib/libswiftIRGen.a  lib/libswiftLLVMPasses.a  lib/libswiftSILGen.a  lib/libswiftSILOptimizer.a  lib/libswiftThreading.a  lib/libswiftSymbolGraphGen.a  lib/libswiftIDE.a  lib/libswiftDriver.a  lib/libswiftSerialization.a  lib/libswiftSIL.a  lib/libswiftSema.a  lib/libswiftSerialization.a  lib/libswiftSIL.a  lib/libswiftSema.a  lib/libswiftOption.a  lib/libswiftClangImporter.a  lib/libswiftParse.a  lib/libswiftIDEUtilsBridging.a  lib/libswiftASTGen.a  lib/libswiftAST.a  lib/libswiftBasic.a  lib/libswiftDemangling.a  lib/libswiftMarkup.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/cmark-macosx-arm64/src/libcmark-gfm.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangFrontendTool.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangExtractAPI.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangARCMigrate.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangStaticAnalyzerFrontend.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangStaticAnalyzerCheckers.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangStaticAnalyzerCore.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangCrossTU.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangDependencyScanning.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMX86CodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMX86AsmParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMX86Desc.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMX86Disassembler.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMX86Info.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMARMCodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMARMAsmParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMARMDisassembler.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMARMDesc.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMARMInfo.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMARMUtils.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAArch64CodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMCFGuard.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAArch64AsmParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAArch64Disassembler.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAArch64Desc.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAArch64Info.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAArch64Utils.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMPowerPCCodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMPowerPCAsmParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMPowerPCDesc.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMPowerPCDisassembler.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMPowerPCInfo.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMSystemZCodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMSystemZAsmParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMSystemZDisassembler.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMSystemZDesc.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMSystemZInfo.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMipsCodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMipsAsmParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMipsDesc.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMipsDisassembler.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMipsInfo.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMRISCVCodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMGlobalISel.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMRISCVAsmParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMRISCVDisassembler.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMRISCVDesc.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMRISCVInfo.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMWebAssemblyCodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAsmPrinter.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMSelectionDAG.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMWebAssemblyAsmParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMWebAssemblyDisassembler.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMCDisassembler.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMWebAssemblyUtils.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMWebAssemblyDesc.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMWebAssemblyInfo.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangCodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMCoverage.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMLTO.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMExtensions.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMPasses.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMCoroutines.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMipo.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMInstrumentation.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMLinker.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMIRPrinter.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMCodeGen.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMBitWriter.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMObjCARCOpts.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMTarget.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMCodeGenTypes.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMVectorize.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangTooling.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangToolingRefactor.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangToolingRefactoring.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangIndex.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangFormat.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangToolingInclusions.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangToolingSyntax.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangToolingCore.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangRewriteFrontend.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangFrontend.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangDriver.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMWindowsDriver.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMOption.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangParse.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMRemoteCachingService.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMRemoteNullService.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangCAS.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMCCAS.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangSerialization.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangSema.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangAPINotes.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangAnalysis.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangASTMatchers.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMFrontendHLSL.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangSupport.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangEdit.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangRewrite.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangAST.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMFrontendOpenMP.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMScalarOpts.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAggressiveInstCombine.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMInstCombine.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMTransformUtils.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAnalysis.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMProfileData.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMSymbolize.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMDebugInfoDWARF.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMDebugInfoPDB.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMDebugInfoMSF.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMDebugInfoBTF.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMObject.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMIRReader.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMBitReader.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMAsmParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMCParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMMC.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMCASUtil.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMCAS.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMDebugInfoCodeView.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMTextAPI.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMCore.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMRemarks.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMBitstreamReader.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMDemangle.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMBinaryFormat.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangLex.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libclangBasic.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMTargetParser.a  /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/libLLVMSupport.a  -lm  lib/swift/host/compiler/lib_CompilerSwiftCompilerPluginMessageHandling.dylib  lib/swift/host/compiler/lib_CompilerSwiftSyntaxMacroExpansion.dylib  lib/swift/host/compiler/lib_CompilerSwiftOperators.dylib  lib/swift/host/compiler/lib_CompilerSwiftSyntaxMacros.dylib  lib/swift/host/compiler/lib_CompilerSwiftSyntaxBuilder.dylib  lib/swift/host/compiler/lib_CompilerSwiftParserDiagnostics.dylib  lib/swift/host/compiler/lib_CompilerSwiftBasicFormat.dylib  lib/swift/host/compiler/lib_CompilerSwiftIDEUtils.dylib  lib/swift/host/compiler/lib_CompilerSwiftParser.dylib  lib/swift/host/compiler/lib_CompilerSwiftDiagnostics.dylib  lib/swift/host/compiler/lib_CompilerSwiftSyntax.dylib  lib/lib_CompilerRegexParser.a && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-driver swift && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-driver swiftc && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-legacy-driver && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swiftc-legacy-driver && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend sil-opt && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend sil-func-extractor && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend sil-nm && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend sil-llvm-gen && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend sil-passpipeline-dumper && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-dependency-tool && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-llvm-opt && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-indent && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-symbolgraph-extract && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-api-extract && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-autolink-extract && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-api-digester && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-cache-tool && cd /Users/raul/Developer/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin && /opt/homebrew/Cellar/cmake/3.29.6/bin/cmake -E create_symlink swift-frontend swift-parse-test
ld: warning: Could not find or use auto-linked library '_CompilerSwiftBasicFormat': library '_CompilerSwiftBasicFormat' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftCompilerPluginMessageHandling': library '_CompilerSwiftCompilerPluginMessageHandling' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftDiagnostics': library '_CompilerSwiftDiagnostics' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftIDEUtils': library '_CompilerSwiftIDEUtils' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftOperators': library '_CompilerSwiftOperators' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftParser': library '_CompilerSwiftParser' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftParserDiagnostics': library '_CompilerSwiftParserDiagnostics' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftSyntax': library '_CompilerSwiftSyntax' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftSyntaxBuilder': library '_CompilerSwiftSyntaxBuilder' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftSyntaxMacroExpansion': library '_CompilerSwiftSyntaxMacroExpansion' not found
ld: warning: Could not find or use auto-linked library '_CompilerSwiftSyntaxMacros': library '_CompilerSwiftSyntaxMacros' not found
Undefined symbols for architecture arm64:
  "swift::diag::inferred_opaque_type_to_explicit", referenced from:
      swift::PatternBindingEntryRequest::evaluate(swift::Evaluator&, swift::PatternBindingDecl*, unsigned int) const in libswiftSema.a[72](TypeCheckStorage.cpp.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

The "Undefined symbol" is a new symbol I added to this .def file, but the compiler seems to be unable to see it.

1 Like

Well, if anyone else faces this issue, looks like nuking Ninja-RelWithDebInfoAssert and rebuilding with:

utils/build-script --skip-build-benchmarks \
  --skip-ios --skip-watchos --skip-tvos --skip-xros --swift-darwin-supported-archs "$(uname -m)" \
  --sccache --release-debuginfo --swift-disable-dead-stripping \
  --bootstrapping=hosttools

Solves the issue. I'm now able to edit the .def file and see the changes.

1 Like