Error: no member named writeAttr in anonymous namespace when trying to compile swift

I'm getting new compile errors when I try to build our branch of swift. It might be after rebasing to a more recent branch of swift that might have introduced hard dependencies that I did not have before in my build.

The error in full...

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libswiftBasic.a(Located.cpp.o) has no symbols
[226/923] Building CXX object lib/ClangImporter/CMakeFiles/swiftClangImporter.dir/Serializability.cpp.o
FAILED: lib/ClangImporter/CMakeFiles/swiftClangImporter.dir/Serializability.cpp.o 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -DSWIFT_LLVM_SUPPORT_IS_AVAILABLE -DSWIFT_TARGET -DSWIFT_THREADING_DARWIN -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_HARDENED_MODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/carl/Documents/Code/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/ClangImporter -I/Users/carl/Documents/Code/swift/swift/lib/ClangImporter -I/Users/carl/Documents/Code/swift/swift/stdlib/public/SwiftShims -I/Users/carl/Documents/Code/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/include -I/Users/carl/Documents/Code/swift/swift/include -I/Users/carl/Documents/Code/swift/llvm-project/llvm/include -I/Users/carl/Documents/Code/swift/build/Ninja-ReleaseAssert/llvm-macosx-x86_64/include -I/Users/carl/Documents/Code/swift/llvm-project/clang/include -I/Users/carl/Documents/Code/swift/build/Ninja-ReleaseAssert/llvm-macosx-x86_64/tools/clang/include -I/Users/carl/Documents/Code/swift/cmark/src/include -I/Users/carl/Documents/Code/swift/build/Ninja-ReleaseAssert/cmark-macosx-x86_64/src -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 -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O3 -DNDEBUG -std=c++17 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk  -fno-exceptions -funwind-tables -fno-rtti -Werror=gnu -Werror=c++98-compat-extra-semi -UNDEBUG -target x86_64-apple-macosx10.15 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -F/../../../Developer/Library/Frameworks -O2 -g0 -MD -MT lib/ClangImporter/CMakeFiles/swiftClangImporter.dir/Serializability.cpp.o -MF lib/ClangImporter/CMakeFiles/swiftClangImporter.dir/Serializability.cpp.o.d -o lib/ClangImporter/CMakeFiles/swiftClangImporter.dir/Serializability.cpp.o -c /Users/carl/Documents/Code/swift/swift/lib/ClangImporter/Serializability.cpp
In file included from /Users/carl/Documents/Code/swift/swift/lib/ClangImporter/Serializability.cpp:25:
In file included from /Users/carl/Documents/Code/swift/swift/include/swift/ClangImporter/SwiftAbstractBasicWriter.h:23:
In file included from /Users/carl/Documents/Code/swift/llvm-project/clang/include/clang/AST/AbstractTypeWriter.h:27:
/Users/carl/Documents/Code/swift/build/Ninja-ReleaseAssert/llvm-macosx-x86_64/tools/clang/include/clang/AST/AbstractTypeWriter.inc:207:25: error: no member named 'writeAttr' in '(anonymous namespace)::ClangTypeSerializationChecker'
    W.find("attribute").writeAttr(attribute);
    ~~~~~~~~~~~~~~~~~~~ ^

Here's my update-checkout call (which used to work for us)...

utils/update-checkout --clone-with-ssh --skip-repository swift-nio \
--skip-repository swift-nio-ssh --skip-repository swift-lmdb --skip-repository swift-docc \
--skip-repository swift-docc-render-artifact --skip-repository swift-docc-symbolkit \
--skip-repository swift-markdown --skip-repository swift-experimental-string-processing \
--skip-repository swift-llvm-bindings --skip-repository swift-xcode-playground-support \
--skip-repository swift-corelibs-libdispatch --skip-repository swift-corelibs-foundation \
--skip-repository swift-corelibs-xctest --skip-repository swift-stress-tester \
--skip-repository swift-crypto --skip-repository swift-atomics \
--skip-repository swift-nio-ssl --skip-repository sourcekit-lsp \
--skip-repository indexstore-db --skip-repository swiftpm \
--skip-repository swift-numerics --skip-repository swift

Then our build script is...

utils/build-script -R -S --clean ${DEBUG_SWIFT_OPT} --extra-cmake-options="-DLLVM_TARGETS_TO_BUILD=AVR;ARM"  --extra-cmake-options="-DLLVM_ENABLE_PROJECTS='clang'" \
--skip-build-benchmarks --skip-ios --skip-watchos --skip-tvos --darwin-deployment-version-osx 10.15 \
--skip-early-swift-driver=true --skip-early-swiftsyntax=true \
--swift-driver=false --swift-disable-dead-stripping --bootstrapping=hosttools

Our local patches are the usual ones from my fork.

llvm-project HEAD after the update-checkout is...

commit 3663531202b9d295e471b4cd28caad7230293cb7 (HEAD -> stable/20230725, origin/stable/20230725)
Author: Usama Hameed <u_hameed@apple.com>
Date:   Thu Jan 18 11:13:56 2024 -0800

    [CompilerRT][ASan] Add new substitutions for tests while using lto to (#78523)
    
    explicitly pass libLTO path. This fixes a failure in swift-ci where
    libLTO was being picked from the system instead which was an older
    version and caused issues.
    
    rdar://117474861

One thing I notice is llvm-project is very recent.

Our patches are rebased on a swift commit from mid December...

commit 1f9b074a8d708a98aeb0e02e54b03a1a9d818e7f (tag: swift-DEVELOPMENT-SNAPSHOT-2023-12-15-a)
Merge: 33e09f9e87a 09151bd8001
Author: Michael Gottesman <mgottesman@apple.com>
Date:   Fri Dec 15 11:17:41 2023 -0800

    Merge pull request #70481 from gottesmm/more-translation-stuff
    
    [region-isolation] Begin filling out unhandled instructions.

...the file it's complaining about is tablegen-ed from part of clang.

Any help gratefully received. It's frustrating that I seem to have broken my build and can't work out why!

Carl