Skip to content

Swift build-mode: manual — xcodebuild "Resolve Package Graph" hangs ~12 min under the build tracer (local path packages, nothing to fetch) #22121

Description

@ax-jkikta

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions