Skip to content
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

Error swift package pdc on Windows #68

Open
TylerJaacks opened this issue Jul 25, 2024 · 5 comments · May be fixed by #69
Open

Error swift package pdc on Windows #68

TylerJaacks opened this issue Jul 25, 2024 · 5 comments · May be fixed by #69

Comments

@TylerJaacks
Copy link

swift package pdc

error: plugin compilation failed: <PluginCompilationResult(
    succeeded: false,
    commandLine: C:\Users\tylerjaacks\AppData\Local\Programs\Swift\Toolchains\5.10.1+Asserts\usr\bin\swiftc.exe -L C:\Users\tylerjaacks\AppData\Local\Programs\Swift\Toolchains\5.10.1+Asserts\usr\lib\swift\pm\PluginAPI -lPackagePlugin -sdk C:\Users\tylerjaacks\AppData\Local\Programs\Swift\Platforms\5.10.1\Windows.platform\Developer\SDKs\Windows.sdk -libc MD -I C:\Users\tylerjaacks\AppData\Local\Programs\Swift\Platforms\5.10.1\Windows.platform\Developer\Library\XCTest-development\usr\lib\swift\windows -I C:\Users\tylerjaacks\AppData\Local\Programs\Swift\Platforms\5.10.1\Windows.platform\Developer\Library\XCTest-development\usr\lib\swift\windows\x86_64 -L C:\Users\tylerjaacks\AppData\Local\Programs\Swift\Platforms\5.10.1\Windows.platform\Developer\Library\XCTest-development\usr\lib\swift\windows\x86_64 -use-ld=lld -g -swift-version 5 -package-description-version 5.10.0 -I C:\Users\tylerjaacks\AppData\Local\Programs\Swift\Toolchains\5.10.1+Asserts\usr\lib\swift\pm\PluginAPI -parse-as-library -Xfrontend -serialize-diagnostics-path -Xfrontend D:\Desktop\PlaydateKitTemplate\.build\plugins\PDCPlugin\cache\PDCPlugin.dia D:\Desktop\PlaydateKitTemplate\.build\checkouts\PlaydateKit\Plugins\PDCPlugin\PDCPlugin.swift -o D:\Desktop\PlaydateKitTemplate\.build\plugins\PDCPlugin\cache\PDCPlugin.exe,
    executable: D:\Desktop\PlaydateKitTemplate\.build\plugins\PDCPlugin\cache\PDCPlugin.exe
    diagnostics: D:\Desktop\PlaydateKitTemplate\.build\plugins\PDCPlugin\cache\PDCPlugin.dia
    compilerOutput: "error: fatalError
error: emit-module command failed with exit code 1 (use -v to see invocation)
D:\Desktop\PlaydateKitTemplate\.build\checkouts\PlaydateKit\Plugins\PDCPlugin\PDCPlugin.swift:41:64: error: cannot call value of non-function type 'String'
    let home = FileManager.default.homeDirectoryForCurrentUser.path()
                                                               ^   ~~

D:\Desktop\PlaydateKitTemplate\.build\checkouts\PlaydateKit\Plugins\PDCPlugin\PDCPlugin.swift:317:52: error: no exact matches in call to initializer
                  let data = try? Data(contentsOf: URL(filePath: ""\(home)\(toolchainPath)/Info.plist"")),
                                                   ^
Foundation.URL:8:12: note: incorrect labels for candidate (have: '(filePath:)', expected: '(fileURLWithPath:)')
    public init(fileURLWithPath path: String)
           ^
Foundation.URL:2:12: note: incorrect labels for candidate (have: '(filePath:)', expected: '(fileReferenceLiteralResourceName:)')
    public init(fileReferenceLiteralResourceName name: String)
           ^
D:\Desktop\PlaydateKitTemplate\.build\checkouts\PlaydateKit\Plugins\PDCPlugin\PDCPlugin.swift:321:52: error: no exact matches in call to initializer
                  let data = try? Data(contentsOf: URL(filePath: ""/\(toolchainPath)/Info.plist"")),
                                                   ^
Foundation.URL:8:12: note: incorrect labels for candidate (have: '(filePath:)', expected: '(fileURLWithPath:)')
    public init(fileURLWithPath path: String)
           ^
Foundation.URL:2:12: note: incorrect labels for candidate (have: '(filePath:)', expected: '(fileReferenceLiteralResourceName:)')
    public init(fileReferenceLiteralResourceName name: String)
           ^
"
)>
@deevus
Copy link

deevus commented Jul 26, 2024

There are more issues than this on Windows. It looks like the build process would only run on MacOS or Linux. Paths are hardcoded based on the *nix Playdate SDK.

On Windows, the Playdate SDK uses CMake, whereas on MacOS/Linux it uses a bundled version of gcc for ARM.

This is not insurmountable, but it goes deeper than the OP's issue.

@TylerJaacks
Copy link
Author

So this works on Linux? Cause that is fine I can use WSL.

@deevus
Copy link

deevus commented Jul 26, 2024

So this works on Linux? Cause that is fine I can use WSL.

It may, if you have the linux Playdate SDK installed.

@deevus
Copy link

deevus commented Jul 26, 2024

It looks like the Linux version of swift also has the same problem that you encountered in the OP.

@finnvoor
Copy link
Owner

finnvoor commented Aug 2, 2024

Currently PlaydateKit only supports macOS. It should be fairly easy to get it working on Linux, probably just need to update PDCPlugin to switch out some paths and use swiftc directly instead of xcrun. If I get a Linux env set up I may spend some time trying to get this working soon.

Not entirely sure what's required for Windows support and I'm not planning on looking into this any time soon, but as you said you should be able to use WSL with Linux.

@finnvoor finnvoor linked a pull request Aug 3, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants