-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Check if schemes are buildable with projects, not workspaces #2372
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found another regression (see issue #2373) that I believe to be from #2344.
Larger, structural changes (away from what was implemented in #2344) might be necessary, so I’d vouch for holding off on this particular commit, and incorporate the ideas into whatever is needed to fix issue #2373.
For what it's worth. This change does fix my original problem in #2369. |
Updated to fix #2373 too. |
Okay, I think I found the disconnect between #2344 and the code that preceded it — Here’s a bug: if there's an shared scheme Carthage/Source/CarthageKit/Xcode.swift Lines 142 to 160 in 26fb61a
…will eschew any actually buildable-by-carthage Example schemes in favor of passing only the scheme for the macOS app to Carthage/Source/CarthageKit/Xcode.swift Lines 162 to 166 in 26fb61a
To a larger point, the following probably holds false-by-convention for most repos, but would cause enough failures to be non-optimal for us: scheme names don’t hold universal·meaning/non-duplication across the boundaries of different xcodeproj/xcworkspace. We avoided this issue in the past, largely, by potentially-duplicated scheme names being treated as identifiers only for the subset of shared schemes that |
I don't see how the logic here in #2372 is different from the behavior before #2344. In both cases:
#2344 broke (1) by checking build ability against the workspace instead of the container, but this PR fixes it. So I think this fix restores the previous behavior while retaining the potential performance benefits of #2344. Am I missing something @jdhealy? |
Unlike when Carthage/Source/CarthageKit/Xcode.swift Line 779 in 19e5846
…the |
I'm not seeing how that matters. The |
Yeah, difference being: what’s given to the |
Okay, let's try this again. 😅 @jdhealy provided a very helpful reproduction of the issue he described. 👏 |
bump |
let buildArguments = BuildArguments(project: project, scheme: scheme, configuration: configuration) | ||
return shouldBuildScheme(buildArguments, platforms) | ||
.filter { $0 } | ||
.map { _ in project } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Know you just relocated this from elsewhere, but this could be .filterMap { $0 ? project : nil }
, if that sits right with you.
return .init(schemes) | ||
} else { | ||
return .init(error: .noSharedFrameworkSchemes(.git(GitURL(directoryURL.path)), platforms)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less readably intuitive, but more performant (potentially ↜ untested), might be:
.lift {
func noSharedFrameworkSchemesError(_ directoryURL: URL) -> CarthageError {
return .noSharedFrameworkSchemes(.git(GitURL(directoryURL.path)), platforms)
}
return Signal.merge( // merge in error iff no values are sent
$0,
$0.materialize()
.reduce(into: false) { if case .value = $1 { $0 = true } }
.flatMap(.race) {
$0 ? SignalProducer.empty : .init(error: noSharedFrameworkSchemesError(directoryURL))
}
)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments, if you’d like to run with them @mdiep…
…larger point: the logic is sound and this is good to merge with or without those minor comments being addressed! 🎉
I'd say let's just merge so we can release. |
Fixes #2369.
This broke in #2344. The check for whether a scheme should be built needs to occur against the project it's from, not against the workspace that includes it.
cc @jdhealy @allenhumphreys