Closed
Description
With swift from swiftly main-snapshot-2025-06-03, BuildCommand expects executable
to be a URL.
swift-package-manager/Sources/PackagePlugin/Command.swift
Lines 45 to 53 in ff7ea75
Swift version 6.2-dev (LLVM b5d039be1fbae13, Swift 4fb4945ab972c85)
Target: x86_64-unknown-linux-gnu
Build config: +assertions
The example in Plugins.md passes a Path
instead.
return .buildCommand(
displayName: "Generating \(outputName) from \(inputPath.lastComponent)",
=> executable: try context.tool(named: "SomeTool").path,
arguments: [ "--verbose", "\(inputPath)", "\(outputPath)" ],
inputFiles: [ inputPath, ],
outputFiles: [ outputPath ]
)
Trying this pattern in my own code is a hard error.
Swift version 6.2-dev (LLVM b5d039be1fbae13, Swift 4fb4945ab972c85)
Target: x86_64-unknown-linux-gnu
/home/andrew/ladybird-org/htmlparser-swift/Plugins/GenerateNamedCharacterReferencesPlugin/main.swift:35:89: error: cannot convert value of type 'Path' to expected argument type 'URL'
33 | .buildCommand(
34 | displayName: "Generate Named Character References",
35 | executable: try context.tool(named: "GenerateNamedCharacterReferences").path,
| `- error: cannot convert value of type 'Path' to expected argument type 'URL'
36 | arguments: [
37 | "--generated-header-path", outputHeader.path,
error: build planning stopped due to build-tool plugin failures