Closed compnerd closed 1 month ago
Isn't this the same as https://github.com/apple/swift-package-manager/pull/5817?
Yes, #5817 might help paper over the underlying issue a bit.
I guess AbsolutePath
also doesn't fully work so it can only be a partial solution. At least we wouldn't have yet another bespoke path library with a very simplistic view of path computation.
IMO, the correct solution is probably to yank PackagePlugin.Path
and let people use Foundation.URL
. I don't think it makes sense to force package plugins to be their own little world of their own where we have to solve common concerns of Swift programs again.
Yeah, I agree, this is best resolved by use of Foundation.URL
. We should ensure that the URL is constructed properly (i.e. URL(fileURLWithPath:)
.).
Description
PackagePlugin.Path
has an unusable ctor:The paths in SPM are fundamentally unusable as they do not represent a real path but some fabricated reality. They drop the drive and the resulting path is unusable. This prevents the use of build tools as the input is never found and ignored by SPM. There is currently no way to reconstruct the true file system path within the context of the plugin, which prevents build plugins from being usable.
Expected behavior
Paths provided to the plugin would be real paths with drives.
Actual behavior
Paths provided to the plugin are relative to the current drive.
Steps to reproduce
No response
Swift Package Manager version/commit hash
No response
Swift & OS version (output of
swift --version ; uname -a
)No response