[plugin] Move cross-compile backend factory to BuilderConfiguration; fix log handler deprecation warning#680
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small follow-ups on top of the build-backend refactor (#679).
1. Move the cross-compile backend factory onto
BuilderConfigurationThe call site read circularly:
— reaching through the configuration to get the method, then handing the
configuration straight back. The factory needs three values that the
configuration already owns (
crossCompileToolPath,baseDockerImage,disableDockerImageUpdate) plus the method, so it belongs on the configuration.CrossCompileMethodis now purely the parsed user choice (parse+ cases +description); itsmakeBackend(...)is gone.BuilderConfigurationgainsmakeCrossCompileBackend() -> any BuildBackend,which reads everything it needs from
self.backend = try configuration.makeCrossCompileBackend().No behaviour change. Also adopts explicit
any(any BuildBackend,any ContainerCLI).The backend-selection tests now drive through
BuilderConfiguration(...).makeCrossCompileBackend()(passing--cross-compile).The old "unsupported methods throw" test on the factory was dropped: unsupported
methods (
swift-static-sdk,custom-sdk) are now rejected earlier, atBuilderConfiguration.initviaCrossCompileMethod.parse, and that behaviour isalready covered by
UnsupportedCrossCompileMethodsPropertyTests.2. Fix a deprecation warning in the test log handler
swift-log 1.13 added a
log(event:)requirement toLogHandlerand deprecated theold
log(level:message:source:...)method.CollectEverythingLogHandler(testhelper) still implemented the deprecated method, so it fell back to the deprecated
default implementation of
log(event:), producing a build warning. It nowimplements
log(event:)directly. (JSONLogHandlerin the library already did.)Verification
sources (
Sources/,Tests/); remaining output is only unrelatedld:macOSdylib-version notes and the pre-existing Docs.docc "unhandled file" note.
AWSLambdaRuntimeTests, 83AWSLambdaPluginHelperTests.swift format lint --strictclean.