Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Sources/SWBCore/BuildParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public struct BuildParameters: Hashable, SerializableCodable, Sendable {
try container.encodeIfPresent(activeRunDestination, forKey: .activeRunDestination)
try container.encodeIfPresent(activeArchitecture, forKey: .activeArchitecture)
try container.encodeIfPresent(arena, forKey: .arena)
try container.encode(overrides, forKey: .overrides)
try container.encode(filterOverrides(overrides), forKey: .overrides)
try container.encode(commandLineOverrides, forKey: .commandLineOverrides)
try container.encodeIfPresent(commandLineConfigOverridesPath, forKey: .commandLineConfigOverridesPath)
try container.encode(commandLineConfigOverrides, forKey: .commandLineConfigOverrides)
Expand Down Expand Up @@ -228,7 +228,7 @@ public struct BuildParameters: Hashable, SerializableCodable, Sendable {
hasher.combine(activeRunDestination)
hasher.combine(activeArchitecture)
hasher.combine(arena)
hasher.combine(overrides)
hasher.combine(filterOverrides(overrides))
hasher.combine(commandLineOverrides)
hasher.combine(commandLineConfigOverridesPath)
hasher.combine(commandLineConfigOverrides)
Expand All @@ -237,6 +237,15 @@ public struct BuildParameters: Hashable, SerializableCodable, Sendable {
hasher.combine(toolchainOverride)
return hasher.finalize()
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of removing the settings override from the hash here, I think we should add the verbose flag to the output agnostic flags list for clang, swift, and ld, which is a narrower and safer change and ensures if -v.

commandLineForSignature() in SwiftCompilerSpec is an example of how this works today for other flags

private func filterOverrides(_ overrides: [String: String]) -> [String: String] {
overrides.mapValues { value in
// Remove -v flag from the value to avoid rebuild
value.split(separator: " ")
.filter { $0 != "-v" }
.joined(separator: " ")
}
}
}

extension BuildParameters {
Expand Down