-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support for building plugin dependencies for the host #6060
Merged
Conversation
This file contains 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
Hacky support for building plugin dependencies for the host. This is achieved by creating a second build operation with altered build parameters and individually building dependencies using that build operation, somewhat similar to how command plugins operate.
b3549b3
to
e6195a3
Compare
@swift-ci please smoke test |
tomerd
approved these changes
Feb 8, 2023
seems like macOS is failing for infra reasons, cc @shahmishal -- maybe this is the error?
|
@swift-ci please smoke test macOS |
euanh
added a commit
to euanh/swift-package-manager
that referenced
this pull request
Aug 9, 2023
When cross-compiling, SwiftPM plugins and their dependencies run on the host and so must be compiled for the host OS and architecture, not the cross-compiled target OS and architecture. SwiftPM will correctly compile a command plugin for the host but if the plugin depends on an executable SwiftPM will cross-compile the executable for the target, so the plugin will not be able to run it: error: Error Domain=NSPOSIXErrorDomain Code=8 "Exec format error" Command plugin dependencies are already handled specially in PluginCommand.run; this commit makes that special build step use the host toolchain instead of the target toolchain. swiftlang#6060 handled the equivalent problem for build tool plugins.
euanh
added a commit
to euanh/swift-package-manager
that referenced
this pull request
Aug 9, 2023
When cross-compiling, SwiftPM plugins and their dependencies run on the host and so must be compiled for the host OS and architecture, not the cross-compiled target OS and architecture. SwiftPM will compile a command plugin for the host but if the plugin depends on an executable it will cross-compile the executable for the target, so the plugin will not be able to run it: error: Error Domain=NSPOSIXErrorDomain Code=8 "Exec format error" Command plugin dependencies are already handled specially in PluginCommand.run; this commit makes that special build step use the host toolchain instead of the target toolchain. swiftlang#6060 handled the equivalent problem for build tool plugins.
euanh
added a commit
to euanh/swift-package-manager
that referenced
this pull request
Aug 10, 2023
When cross-compiling, SwiftPM plugins and their dependencies run on the host and so must be compiled for the host OS and architecture, not the cross-compiled target OS and architecture. SwiftPM will compile a command plugin for the host but if the plugin depends on an executable it will cross-compile the executable for the target, so the plugin will not be able to run it: error: Error Domain=NSPOSIXErrorDomain Code=8 "Exec format error" Command plugin dependencies are already handled specially in PluginCommand.run; this commit makes that special build step use the host toolchain instead of the target toolchain. swiftlang#6060 handled the equivalent problem for build tool plugins.
euanh
added a commit
that referenced
this pull request
Aug 10, 2023
…et (#6791) When cross-compiling, SwiftPM plugins and their dependencies run on the host and so must be compiled for the host OS and architecture, not the cross-compiled target OS and architecture. SwiftPM will compile a command plugin for the host but if the plugin depends on an executable it will cross-compile the executable for the target, so the plugin will not be able to run it: error: Error Domain=NSPOSIXErrorDomain Code=8 "Exec format error" Command plugin dependencies are already handled specially in PluginCommand.run; this commit makes that special build step use the host toolchain instead of the target toolchain. #6060 handled the equivalent problem for build tool plugins.
MaxDesiatov
pushed a commit
that referenced
this pull request
Aug 11, 2023
When cross-compiling, SwiftPM plugins and their dependencies run on the host and so must be compiled for the host OS and architecture, not the cross-compiled target OS and architecture. SwiftPM will compile a command plugin for the host but if the plugin depends on an executable it will cross-compile the executable for the target, so the plugin will not be able to run it: error: Error Domain=NSPOSIXErrorDomain Code=8 "Exec format error" Command plugin dependencies are already handled specially in PluginCommand.run; this commit makes that special build step use the host toolchain instead of the target toolchain. #6060 handled the equivalent problem for build tool plugins. (cherry picked from commit 1daaa1c) # Conflicts: # Sources/CoreCommands/SwiftTool.swift
MaxDesiatov
added a commit
that referenced
this pull request
Aug 14, 2023
…6799) When cross-compiling, SwiftPM plugins and their dependencies run on the host and so must be compiled for the host OS and architecture, not the cross-compiled target OS and architecture. SwiftPM will compile a command plugin for the host but if the plugin depends on an executable it will cross-compile the executable for the target, so the plugin will not be able to run it: error: Error Domain=NSPOSIXErrorDomain Code=8 "Exec format error" Command plugin dependencies are already handled specially in PluginCommand.run; this commit makes that special build step use the host toolchain instead of the target toolchain. #6060 handled the equivalent problem for build tool plugins. (cherry picked from commit 1daaa1c) ``` # Conflicts: # Sources/CoreCommands/SwiftTool.swift ``` Co-authored-by: Euan Harris <euan_harris@apple.com>
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.
Hacky support for building plugin dependencies for the host. This is achieved by creating a second build operation with altered build parameters and individually building dependencies using that build operation, somewhat similar to how command plugins operate.