Symbol graph output and swift 6.4

Since updating to swift 6.4 it seems symbol graph output no longer works. Previously

swift build -Xswiftc -emit-symbol-graph -Xswiftc -emit-symbol-graph-dir -Xswiftc .build/symbol-graphs

would output all the module symbol graphs to a .build/symbol-graphs folder. With the swift 6.4 compiler this no longer works. Has something changed (I know we have moved to a new build system), or is this something I should add an issue for.

It appears I can get it to work by adding --build-system native , but it'll warn me about it being deprecated.

I'd first check that the symbol graphs weren't output to an unexpected location. Before Swift 6.4 most compile tasks used per-package working directories which generated unnecessary module variants and hurt perf. Now they all use the workspace root, which in this case may resolve the relative path to be adjacent to the package dir instead of inside it in your example. In general I recommend using absolute paths when overriding compiler options via the CLI, assuming the working directory of the compiler is technically invoking undefined behavior for packages. If that doesn't account for what you're seeing an issue would be appreciated!

FYI - here are the results from some experiments: (a package at ~/code/swift/Hello/)

MPB-16 ➜   Hello swift build -Xswiftc -emit-symbol-graph -Xswiftc -emit-symbol-graph-dir -Xswiftc /users/diggory/symbol-graphs   
Building for debugging...
[7 / 8] Hello-product

Build complete! (0.68 secs)

Writes graph to absolute path /users/diggory/symbol-graphs

MPB-16 ➜   Hello swift build -Xswiftc -emit-symbol-graph -Xswiftc -emit-symbol-graph-dir -Xswiftc .                           
Building for debugging...
[7 / 8] Hello-product

Build complete! (0.59 secs)

Writes graph to path adjacent to package /users/diggory/code/swift

MPB-16 ➜   Hello swift build -Xswiftc -emit-symbol-graph -Xswiftc -emit-symbol-graph-dir -Xswiftc ./Hello
Building for debugging...
[7 / 8] Hello-product

Build complete! (0.53 secs)

Writes graph to inside package directory /users/diggory/code/swift/Hello

MPB-16 ➜   Hello swift build -Xswiftc -emit-symbol-graph -Xswiftc -emit-symbol-graph-dir -Xswiftc ./Hello/.build
Building for debugging...
[7 / 8] Hello-product

Build complete! (0.67 secs)

Doesn't write anything...

1 Like