Skip to content

Centralize dependency diagnostics in ValidateDependencies action #675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

neonichu
Copy link
Collaborator

Instead of emitting diagnostics directly, individual tasks emit .dependencies files which are read by a per-target action which aggregates them. This avoids duplication of diagnostics across tasks.

rdar://156174696

Instead of emitting diagnostics directly, individual tasks emit .dependencies files which are read by a per-target action which aggregates them. This avoids duplication of diagnostics across tasks.

rdar://156174696
@neonichu
Copy link
Collaborator Author

@swift-ci please test

@neonichu neonichu requested a review from bob-wilson July 25, 2025 23:57
contents: ByteString(
JSONEncoder(outputFormatting: .sortedKeys).encode(validationInfo)
)
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm a bit ambivalent on whether the validation action should just be directly consuming the trace files. It seems right for the Clang action to know about the implementation details here, but on the other hand it does seem a tiny bit wasteful to just process these files into other files?

@@ -493,7 +494,7 @@ fileprivate struct DependencyValidationTests: CoreBasedTests {
TestStandardTarget(
"CoreFoo", type: .framework,
buildPhases: [
TestSourcesBuildPhase(["CoreFoo.m"]),
TestSourcesBuildPhase(["CoreFoo.m", "CoreBar.m"]),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This makes it so that the test would see duplicate diagnostics in the old implementation which this PR then fixes.

@neonichu
Copy link
Collaborator Author

@swift-ci please test

@neonichu
Copy link
Collaborator Author

Linux jobs are failing with

Unable to find error: '.contains("Missing entries in MODULE_DEPENDENCIES: Foundation")' (other errors: ["Unexpected error in querying jobs from dependency graph: The operation could not be completed. The file doesn’t exist. (for task: [\"SwiftDriver\", \"TargetB\", \"normal\", \"x86_64\", \"com.apple.xcode.tools.swift.compiler\"])"])

@neonichu
Copy link
Collaborator Author

Also same issue on Windows (TIL on Windows, the testing output uses × instead of ).

The toolchains in CI are currently breaking this test.
@neonichu
Copy link
Collaborator Author

@swift-ci please test

@neonichu
Copy link
Collaborator Author

From the cmake job:

TaskGeneration.swift:192:35: error: cannot find type 'ValidateDependenciesSpec' in scope

I guess I need to update the configs for that.

@neonichu
Copy link
Collaborator Author

@swift-ci please test

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.

1 participant