-
Notifications
You must be signed in to change notification settings - Fork 1
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
Cannot build on Docker (Debian) #3
Comments
Hey, thanks for bringing this up! I’ll look into it as soon as possible. |
Can you post the output of |
I managaed to recreate the error when using Docker. Running it on a fresh Debian instance worked though |
It looks like on Docker, In the meantime, if you pull the latest branch, you should be able to run the examples like so: swift run -Xswiftc -DSWIFTCURSES_OPAQUE Examples helloWorld To see all the possible example, see the switch at: SwiftCurses/Sources/Examples/main.swift Line 14 in 31b7edd
|
Possible explanation is that NCURSES_OPAQUE is defined by default on the Swift docker image. I should test this. |
Thank you so much for investigating this. While building the examples was the easy reproduction of this issue, my actual problem is that I can't build a Linux version of an app that depends on To try it out you can create a simple package that depends on BUILD_CMD="swift build -c release -Xswiftc -O -Xswiftc -DSWIFTCURSES_OPAQUE"
docker run -it -v $(pwd):/sources swift:latest /bin/bash -c "cd sources && $BUILD_CMD" Unfortunately the addition of |
Haven't been able to reproduce this on a linux machine with Docker. Will try this evening on macOS. |
Running on macOS 15.1.1, latest version of OrbStack for Docker though i don't think it matters for that part |
The latest commit should fix this. It works for me at least (I'm still on macOS 13.4 though, I'm due for a hardware upgrade 😅) Let me know if it works for you. |
No dice just yet, unfortunately. For the package config, i have made my package public https://github.com/dvkch/Polycam/blob/main/Package.swift If you have the energy you can try adding back SwiftCurses to the dependencies for good, or just commenting the conditionals, and running the If you'd prefer I can investigate a bit more on my side as well or make an easier repro repository :)
|
As for repro, i tried again the lines from my first posted issue, and those still don't compile on the latest commit. Edited the message to fix a mistake in the docker run command |
I checked my swift version on linux, it is 6.0.2 on First of all, it required installing Then it did build properly and ran EDIT (and sorry for the multiple notifications) : I actually can't use it on my project since I used typed throws. After searching a bit more, the |
Thanks for the info, I’ll look into it and see if I can figure it out. I’m guessing you’ve got arm-based hardware. It might be difference in architecture since I’m currently still on Intel hardware. |
I am indeed on an M1 Pro chip, but I think I had the same issue on both (my |
what happens if you change this line: to .package(url: "https://github.com/Jomy10/SwiftCurses.git", from: "1.3.0"), |
Sorry for the late reply, I finally got to try it today, but there is no tag or branch |
I believe I did make a typo. It should be |
Using version Computing version for https://github.com/Jomy10/SwiftCurses.git
error: Dependencies could not be resolved because root depends on 'swiftcurses' 1.1.0..<2.0.0.
'swiftcurses' >= 1.1.0 cannot be used because package 'swiftcurses' is required using a stable-version but 'swiftcurses' depends on an unstable-version package 'signalhandler' and no versions of 'swiftcurses' match the requirement 1.1.1..<2.0.0. Using version Building for production...
/sources/.build/checkouts/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:7:55: error: cannot find type 'WINDOW' in scope
5 | public typealias WindowPointer = OpaquePointer
6 | #else
7 | public typealias WindowPointer = UnsafeMutablePointer<WINDOW>
| `- error: cannot find type 'WINDOW' in scope
8 | #endif
9 |
/sources/.build/checkouts/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:16:10: error: constructing an object of class type 'WinType' with a metatype value must use a 'required' initializer
14 | throw CursesError(.couldNotOpenFile)
15 | }
16 | return WinType(ncurses.getwin(filePtr))
| `- error: constructing an object of class type 'WinType' with a metatype value must use a 'required' initializer
17 | }
18 |
/sources/.build/checkouts/SwiftCurses/Sources/SwiftCurses/Window.swift:34:24: note: selected non-required initializer 'init(rows:cols:begin:settings:)'
32 | }
33 |
34 | public convenience init(rows: Int32, cols: Int32, begin: (Int32, Int32), settings: [WindowSetting] = WindowSetting.defaultSettings) throws {
| `- note: selected non-required initializer 'init(rows:cols:begin:settings:)'
35 | let winPtr: WindowPointer = try newWindow(rows: rows, cols: cols, begin: begin, settings: settings)
36 | self.init(winPtr, rows: rows, cols: cols)
/sources/.build/checkouts/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:16:18: error: missing argument label 'rows:' in call
14 | throw CursesError(.couldNotOpenFile)
15 | }
16 | return WinType(ncurses.getwin(filePtr))
| `- error: missing argument label 'rows:' in call
17 | }
18 |
/sources/.build/checkouts/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:16:18: error: missing arguments for parameters 'cols', 'begin' in call
14 | throw CursesError(.couldNotOpenFile)
15 | }
16 | return WinType(ncurses.getwin(filePtr))
| `- error: missing arguments for parameters 'cols', 'begin' in call
17 | }
18 |
/sources/.build/checkouts/SwiftCurses/Sources/SwiftCurses/Window.swift:34:24: note: 'init(rows:cols:begin:settings:)' declared here
32 | }
33 |
34 | public convenience init(rows: Int32, cols: Int32, begin: (Int32, Int32), settings: [WindowSetting] = WindowSetting.defaultSettings) throws {
| `- note: 'init(rows:cols:begin:settings:)' declared here
35 | let winPtr: WindowPointer = try newWindow(rows: rows, cols: cols, begin: begin, settings: settings)
36 | self.init(winPtr, rows: rows, cols: cols)
/sources/.build/checkouts/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:16:26: error: cannot convert value of type 'OpaquePointer?' to expected argument type 'Int32'
14 | throw CursesError(.couldNotOpenFile)
15 | }
16 | return WinType(ncurses.getwin(filePtr))
| `- error: cannot convert value of type 'OpaquePointer?' to expected argument type 'Int32'
17 | }
18 |
/sources/.build/checkouts/SwiftCurses/Sources/SwiftCurses/Window.swift:36:18: error: incorrect argument labels in call (have '_:rows:cols:', expected 'rows:cols:begin:settings:')
34 | public convenience init(rows: Int32, cols: Int32, begin: (Int32, Int32), settings: [WindowSetting] = WindowSetting.defaultSettings) throws {
35 | let winPtr: WindowPointer = try newWindow(rows: rows, cols: cols, begin: begin, settings: settings)
36 | self.init(winPtr, rows: rows, cols: cols)
| `- error: incorrect argument labels in call (have '_:rows:cols:', expected 'rows:cols:begin:settings:')
37 | }
38 | |
Hi there!
First of all, thanks a lot for this amazing lib, I've been using it for a macOS CLI tool and it's worked wonders.
I've been trying to use that CLI tool on linux and I haven't been able to build properly. It seems even the
Examples
target in this project doesn't build either.The default Swift linux docker image already includes ncurses, confirmed by running
apt list --installed | grep ncurses
:Here is my test on macOS (ARM64) :
And the build output :
Would you happen to have any pointers as to what I'm doing wrong ?
The text was updated successfully, but these errors were encountered: