You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[5.9] Build command plugin dependencies for the host, not the target (#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 <[email protected]>
// Build or bring up-to-date any executable host-side tools on which this plugin depends. Add them and any binary dependencies to the tool-names-to-path map.
0 commit comments