Swift build-mode: manual — xcodebuild Resolve Package Graph hangs ~12 min under the build tracer (local path packages, nothing to fetch)
Summary
With CodeQL Swift build-mode: manual, an xcodebuild -scheme … build step spends ~11–12 minutes in Resolve Package Graph — with zero log output — on a project whose only dependencies are local path SwiftPM packages (nothing to fetch/clone). The identical command resolves in <1 second outside the CodeQL tracer (locally and in a plain xcodebuild CI job on the same runner image), and resolving the graph before codeql init (untraced) is also instant. Only the build performed under the CodeQL build tracer hangs.
Environment
- CodeQL Action
v4.36.3, CodeQL CLI 2.25.6
- Runner: GitHub-hosted
macos-26, Xcode 26.5/26.6
- Language:
swift, build-mode: manual
- Project: an
.xcodeproj app target depending on 3 local path SwiftPM packages; zero remote package dependencies
Evidence (timing)
Traced build step log:
23:10:15 Resolve Package Graph
… ~11 min, zero output …
23:21:09 Resolved source packages:
| Context |
Resolve Package Graph time |
Local xcodebuild -resolvePackageDependencies |
0.8 s |
| Local, network disabled |
2 s (succeeds) |
Untraced resolve step on the CodeQL runner (before codeql init) |
instant |
Plain CI xcodebuild -scheme … build on macos-26 (no CodeQL) |
<1 s |
xcodebuild build under CodeQL build-mode: manual tracer |
~11–12 min |
What we tried (none fixed it)
-disableAutomaticPackageResolution on the build → still 11m45s.
- Pre-resolving untraced (before
codeql init) into -clonedSourcePackagesDirPath, then a traced build reusing that path + -disableAutomaticPackageResolution → the traced build re-runs Resolve Package Graph and still hangs 11m03s.
Hypothesis
The build tracer's process interposition causes xcodebuild/SwiftPM's package-resolution network probe to block on a long timeout instead of returning immediately, despite there being no remote dependencies to resolve. The build succeeds after the timeout elapses, so the analysis is correct — just ~12 min slower than it should be.
Ask
- Is this a known interaction between the Swift build tracer and xcodebuild's package resolution?
- Is there a supported way to make the traced build skip/short-circuit package resolution when all dependencies are local?
Happy to provide full run logs.
Swift
build-mode: manual— xcodebuildResolve Package Graphhangs ~12 min under the build tracer (local path packages, nothing to fetch)Summary
With CodeQL Swift
build-mode: manual, anxcodebuild -scheme … buildstep spends ~11–12 minutes inResolve Package Graph— with zero log output — on a project whose only dependencies are local path SwiftPM packages (nothing to fetch/clone). The identical command resolves in <1 second outside the CodeQL tracer (locally and in a plainxcodebuildCI job on the same runner image), and resolving the graph beforecodeql init(untraced) is also instant. Only the build performed under the CodeQL build tracer hangs.Environment
v4.36.3, CodeQL CLI2.25.6macos-26, Xcode 26.5/26.6swift,build-mode: manual.xcodeprojapp target depending on 3 local path SwiftPM packages; zero remote package dependenciesEvidence (timing)
Traced build step log:
Resolve Package Graphtimexcodebuild -resolvePackageDependenciescodeql init)xcodebuild -scheme … buildonmacos-26(no CodeQL)xcodebuild buildunder CodeQLbuild-mode: manualtracerWhat we tried (none fixed it)
-disableAutomaticPackageResolutionon the build → still 11m45s.codeql init) into-clonedSourcePackagesDirPath, then a traced build reusing that path +-disableAutomaticPackageResolution→ the traced build re-runsResolve Package Graphand still hangs 11m03s.Hypothesis
The build tracer's process interposition causes xcodebuild/SwiftPM's package-resolution network probe to block on a long timeout instead of returning immediately, despite there being no remote dependencies to resolve. The build succeeds after the timeout elapses, so the analysis is correct — just ~12 min slower than it should be.
Ask
Happy to provide full run logs.