Skip to content

Trace unresolved requirements by default - #74

Merged
zienag merged 1 commit into
yandex:mainfrom
zienag:trace-unresolved-by-default
Oct 28, 2026
Merged

zienag merged 1 commit into
yandex:mainfrom
zienag:trace-unresolved-by-default

Conversation

@zienag

@zienag zienag commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Every caller of the analyzer turns on tracing of unresolved requirements: the SPM plugin always passes traceUnresolved: true, and so does the browser's build tool. The default still said false, so a new caller would get errors without the call chain unless it knew to ask.

Changes

  • StaticAnalysis.Config traces unresolved requirements by default.
  • The SPM plugin's arguments drop traceUnresolved: the plugin only ever sent true, which is now the default.
  • resolveRequirements no longer has its own false default; its only caller passes the config's value.

Test plan

  • In a swift:6.2 Linux container, with the CI commands: the build, including the Showcase targets that run the plugin, and all 121 tests pass. The tests set traceUnresolved explicitly, so they don't depend on the default.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 23:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No objective defects were found and all callers of the updated Config and resolveRequirements signatures remain consistent with the intentional new default.

No open issues 🎉

What changed in this PR

This PR flips the analyzer's traceUnresolved option to default to true, so that any caller of the static analyzer gets the full call-chain trace for unresolved implicit requirements automatically, rather than only bare errors. Since both in-tree callers (the SPM plugin and the external browser build tool) already always requested tracing, the option is removed from the plugin's serialized args schema and now simply relies on the new default.

Changes:

  • StaticAnalysis.Config.init now defaults traceUnresolved to true.
  • The traceUnresolved field is dropped from both copies of the ImplicitsToolSPMPluginArgs Codable schema, and the plugin no longer passes it when constructing args/config.
  • RequirementsGraph.resolveRequirements drops its own false default; its only caller passes config.traceUnresolved explicitly.
File Description
Sources/​ImplicitsTool/​StaticAnalysis.swift Changes the public Config default for traceUnresolved to true.
Sources/​ImplicitsTool/​RequirementsGraph.swift Removes the false default on resolveRequirements(traceUnresolved:), making the argument required.
Sources/​implicits-tool-spm-plugin/​entry.swift Drops traceUnresolved from the tool-side args schema and simplifies the Config construction.
Plugins/​ImplicitsAnalysisPlugin/​ImplicitsAnalysisPlugin.swift Drops traceUnresolved from the plugin-side args schema and stops passing it.

I reviewed the full change set and did not find objective defects. The two ImplicitsToolSPMPluginArgs schema copies remain in sync, the only production/test callers of Config and resolveRequirements are consistent with the new signatures, and there are no stale traceUnresolved references in docs or elsewhere. The behavioral change to the public Config default is intentional and matches the PR's stated goal.

Review effort: Balanced

@zienag
zienag merged commit e8bd001 into yandex:main Oct 28, 2026
1 check passed
@zienag
zienag deleted the trace-unresolved-by-default branch October 28, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants