JohnSundell / SwiftPlate

Easily generate cross platform Swift framework projects from the command line
MIT License
1.77k stars 88 forks source link

Does not build under Linux #23

Closed idcrook closed 7 years ago

idcrook commented 7 years ago

Not sure if this is a requirement for this project-- or is supported-- but wanted to put an issue out there. It might never be supported.

I do not need this for myself as I can build/run SwiftPlate on macOS, and once I have the boilerplate build, I can use git clones to share in Linux environment.

building under linux

I tried to build SwiftPlate from recent clone on Linux (Ubuntu 16.04), and get build errors. Most of them look like they are Swift Core library/Foundation related, which is known to be lagging in completeness compared to macOS/*OS.

$ swift ../SwiftPlate/main.swift test
../SwiftPlate/main.swift:56:16: error: value of type 'ObjCBool' (aka 'Bool') has no member 'boolValue'
        return objCBool.boolValue
               ^~~~~~~~ ~~~~~~~~~
../SwiftPlate/main.swift:176:19: error: use of unresolved identifier 'Process'
    let process = Process()
                  ^~~~~~~
Foundation.NSProgress:1:12: note: did you mean 'NSProgress'?
open class NSProgress : Foundation.NSObject {
           ^
Foundation.ProcessInfo:1:12: note: did you mean 'ProcessInfo'?
open class ProcessInfo : Foundation.NSObject {
           ^

Process changed to CommandLine?

I didn't really dig much into these errors. Googling the Process() one yielded something that would appear to related, but after further investigation, I do not think it is: Rename Process to CommandLine [SE-0086] https://github.com/apple/swift/commit/f65c1390cb23395fde5a798fb6731b32a31ec452

The change referred to has been in place for a while on Swift 3 branch.

I was able to confirm that Process is available in Foundation on macOS, but is not present in Foundation on Linux (at this time).

Platform versions

OS: Ubuntu 16.04.1

$ swift --version
Swift version 3.0.1 (swift-3.0.1-RELEASE)
Target: x86_64-unknown-linux-gnu
$ uname -a
Linux vader 4.4.0-49-generic #70-Ubuntu SMP Fri Nov 11 16:40:34 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
ikesyo commented 7 years ago

Process changed to CommandLine?

Process in Swift 3 on macOS was previously NSTask (SE-0086). But on Linux, the type is still defined as Task (just dropped NS prefix), not as Process in swift-corelibs-foundation.

idcrook commented 7 years ago

I created this issue more to document the build status under Linux. Since it appears at least partly due to Foundation lagging behind under Linux Swift, it would seem low ROI to spend time trying to to get this work, at least for now. Perhaps at some future time, we could revisit? I would be fine with closing this issue.

idcrook commented 7 years ago

Closing issue. Perhaps revisit when Foundation framework has caught up under Linux.