Skip to content

Conversation

@neonichu
Copy link
Collaborator

@neonichu neonichu commented Nov 7, 2025

Since #874, we are dumping per-target dependency information, this adds a new task which merges these for a given build request. The task is only created if there's at least one target in the graph that will dump dependency information, so should be a no-op for all builds right now.

Additionally, this declares the dependency info file as an output of ValidateDependencies which I neglected to do in my earlier PR.

Since swiftlang#874, we are dumping per-target dependency information, this adds a new task which merges these for a given build request. The task is only created if there's at least one target in the graph that will dump dependency information, so should be a no-op for all builds right now.

Additionally, this declares the dependency info file as an output of `ValidateDependencies` which I neglected to do in my earlier PR.
@neonichu neonichu force-pushed the bbuegling/merge-dependency-info-during-build branch from e097892 to 952eece Compare November 7, 2025 20:53
@neonichu
Copy link
Collaborator Author

neonichu commented Nov 7, 2025

@swift-ci please test

@neonichu
Copy link
Collaborator Author

neonichu commented Nov 7, 2025

Looks like the failure in Static Linux Swift SDK Build (nightly-main - rhel-ubi9) is a crash in SwiftPM?

guard let target = $0.configuredTarget?.target as? SWBCore.StandardTarget else {
return nil
}
guard target.sourcesBuildPhase?.buildFiles.isEmpty == false else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note there are some edge cases where empty targets still do some work (generation of the apple versioning .c file for example), I think there is code somewhere to handle that. If it doesn't hurt, you might just want to not skip based on this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right that we should handle this, but it seems like today the knowledge only exists inside SourcesTaskProducer and isn't readily accessible? Unless someone knows another way, I think I'd rather address this in a follow-up to keep a refactor of the logic in SourcesTaskProducer separate.

fatalError("unexpected direct invocation")
}

public func createTasks(_ cbc: CommandBuildContext, _ delegate: any TaskGenerationDelegate, dumpDependencyPaths: [Path]) async {
Copy link
Collaborator

Choose a reason for hiding this comment

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

dumpDependencyPaths here could probably be cbc.inputs

@neonichu neonichu merged commit 9268518 into swiftlang:main Nov 12, 2025
118 of 119 checks passed
@neonichu neonichu deleted the bbuegling/merge-dependency-info-during-build branch November 12, 2025 21:42
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.

3 participants