Sudden `Circular swiftly proxy invocation`?

I had a project that was building fine, but I wanted to test something involving a fresh build. I deleted the .build folder and then ran swift build, and now -- with no code changes -- my project no longer compiles!

The normal output from swift build gives me no hint on where to start:

Building for debugging...
Circular swiftly proxy invocation
Circular swiftly proxy invocation
[0/26] Write swift-version-153478B9C6236F53.txt

Even adding the -v flag is not particularly helpful:

Building for debugging...
Write auxiliary file /home/bbrk24/workspace/swift-cross-data/.build/x86_64-unknown-linux-gnu/debug/swift-version-153478B9C6236F53.txt
/home/bbrk24/.local/share/swiftly/bin/clang -target x86_64-unknown-linux-gnu -O0 -DSWIFT_PACKAGE=1 -DDEBUG=1 -fblocks -I /home/bbrk24/workspace/swift-cross-data/.build/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include -fPIC -g -fno-omit-frame-pointer -w -MD -MT dependencies -MF /home/bbrk24/workspace/swift-cross-data/.build/x86_64-unknown-linux-gnu/debug/_SwiftSyntaxCShims-tool.build/dummy.c.d -c /home/bbrk24/workspace/swift-cross-data/.build/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/dummy.c -o /home/bbrk24/workspace/swift-cross-data/.build/x86_64-unknown-linux-gnu/debug/_SwiftSyntaxCShims-tool.build/dummy.c.o
/home/bbrk24/.local/share/swiftly/bin/clang -target x86_64-unknown-linux-gnu -O0 -DSWIFT_PACKAGE=1 -DDEBUG=1 -fblocks -I /home/bbrk24/workspace/swift-cross-data/.build/checkouts/swift-toolchain-sqlite/Sources/CSQLite/include -fPIC -g -fno-omit-frame-pointer -w -MD -MT dependencies -MF /home/bbrk24/workspace/swift-cross-data/.build/x86_64-unknown-linux-gnu/debug/SwiftToolchainCSQLite.build/sqlite3.c.d -c /home/bbrk24/workspace/swift-cross-data/.build/checkouts/swift-toolchain-sqlite/Sources/CSQLite/sqlite3.c -o /home/bbrk24/workspace/swift-cross-data/.build/x86_64-unknown-linux-gnu/debug/SwiftToolchainCSQLite.build/sqlite3.c.o
Circular swiftly proxy invocation
Circular swiftly proxy invocation

In both cases the exit code is 1.

What on earth could cause this, and how do I fix it?

:person_facepalming: well, I wasn't expecting to figure it out this quickly.

$ echo $CC
/home/bbrk24/.local/share/swiftly/bin/clang
$ unset CC
$ swift build
warning: 'swift-cross-data': found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
    /home/bbrk24/workspace/swift-cross-data/Sources/SwiftCrossData/ProxyExtensions.swift.gyb
warning: 'sqlite.swift': found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
    /home/bbrk24/workspace/swift-cross-data/.build/checkouts/SQLite.swift/Sources/SQLite/PrivacyInfo.xcprivacy
[1/1] Planning build
Building for debugging...
[378/378] Linking SwiftCrossDataClient
Build complete! (34.90s)

Should I file a bug report about this somewhere? I would like my build system not to blow up just because I pointed $CC at the Clang that Swift provides.

1 Like