Skip to content

Allow task spec to filter command line for signature #507

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

Conversation

ldaley
Copy link
Contributor

@ldaley ldaley commented May 13, 2025

This wires TaskTypeDescription#commandLineForSignature() into the default implementation of TaskAction#getSignature(), allowing task action implementations to get correct signature normalization by default.

@ldaley
Copy link
Contributor Author

ldaley commented May 13, 2025

@swift-ci test

@@ -69,8 +69,8 @@ open class TaskAction: PlannedTaskAction, PolymorphicSerializable
{
let md5 = InsecureHashContext()
md5.add(bytes: serializedRepresentationSignature!)
for arg in task.commandLine {
md5.add(bytes: arg.asByteString)
for arg in task.type.commandLineForSignature(for: task) ?? [] {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the meaning of a nil result here? Should the fallback be the regular command line instead of empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@ldaley ldaley marked this pull request as ready for review May 13, 2025 15:51
@ldaley
Copy link
Contributor Author

ldaley commented May 13, 2025

@swift-ci test

@neonichu neonichu merged commit f0db110 into swiftlang:main May 13, 2025
24 checks passed
@jakepetroules
Copy link
Collaborator

Nice catch, this was a bug waiting to happen!

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.

4 participants