Jomy10 / Jomy10/SwiftCurses

Cannot build on Docker (Debian)

Open
#3 18 comments 0 reactions 1 assignee Claimed by @Jomy10 View on GitHub
bug
Dominant language
Swift
Stars
16
Forks
2
PR merge metrics
No merged PRs in 30d

Description

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` :

```
libncurses-dev/noble,now 6.4+20240113-1ubuntu2 arm64 [installed]
libncurses6/noble,now 6.4+20240113-1ubuntu2 arm64 [installed,automatic]
libncursesw6/noble,now 6.4+20240113-1ubuntu2 arm64 [installed]
ncurses-base/noble,now 6.4+20240113-1ubuntu2 all [installed]
ncurses-bin/noble,now 6.4+20240113-1ubuntu2 arm64 [installed]
```

Here is my test on macOS (ARM64) :

```
docker run -it --platform linux/arm64/v8 swift:latest /bin/bash
git clone https://github.com/Jomy10/SwiftCurses.git
cd SwiftCurses
swift run Examples
```

And the build output :

```
root@17b970fdb815:/yo/SwiftCurses# swift run Examples
Building for debugging...
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer

/yo/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 |
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
error: emit-module command failed with exit code 1 (use -v to see invocation)
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:10: error: constructing an object of class type 'WinType' with a metatype value must use a 'required' initializer
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: constructing an object of class type 'WinType' with a metatype value must use a 'required' initializer
16 | }
17 |

/yo/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)

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:18: error: missing argument label 'rows:' in call
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: missing argument label 'rows:' in call
16 | }
17 |

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:18: error: missing arguments for parameters 'cols', 'begin' in call
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: missing arguments for parameters 'cols', 'begin' in call
16 | }
17 |

/yo/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)

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:26: error: cannot convert value of type 'OpaquePointer?' to expected argument type 'Int32'
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: cannot convert value of type 'OpaquePointer?' to expected argument type 'Int32'
16 | }
17 |
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:10: error: constructing an object of class type 'WinType' with a metatype value must use a 'required' initializer
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: constructing an object of class type 'WinType' with a metatype value must use a 'required' initializer
16 | }
17 |

/yo/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)

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:18: error: missing argument label 'rows:' in call
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: missing argument label 'rows:' in call
16 | }
17 |

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:18: error: missing arguments for parameters 'cols', 'begin' in call
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: missing arguments for parameters 'cols', 'begin' in call
16 | }
17 |

/yo/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)

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:26: error: cannot convert value of type 'OpaquePointer?' to expected argument type 'Int32'
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: cannot convert value of type 'OpaquePointer?' to expected argument type 'Int32'
16 | }
17 |
/yo/SwiftCurses/Sources/SwiftCurses/LinuxCompatibility.swift:4:55: error: cannot find type 'WINDOW' in scope
2 |
3 | #if canImport(FoundationNetworking)
4 | public typealias WindowPointer = UnsafeMutablePointer
| `- error: cannot find type 'WINDOW' in scope
5 | #else
6 | public typealias WindowPointer = OpaquePointer

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:10: error: constructing an object of class type 'WinType' with a metatype value must use a 'required' initializer
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: constructing an object of class type 'WinType' with a metatype value must use a 'required' initializer
16 | }
17 |

/yo/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)

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:18: error: missing argument label 'rows:' in call
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: missing argument label 'rows:' in call
16 | }
17 |

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:18: error: missing arguments for parameters 'cols', 'begin' in call
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: missing arguments for parameters 'cols', 'begin' in call
16 | }
17 |

/yo/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)

/yo/SwiftCurses/Sources/SwiftCurses/Window+dump.swift:15:26: error: cannot convert value of type 'OpaquePointer?' to expected argument type 'Int32'
13 | throw CursesError(.couldNotOpenFile)
14 | }
15 | return WinType(ncurses.getwin(filePtr))
| `- error: cannot convert value of type 'OpaquePointer?' to expected argument type 'Int32'
16 | }
17 |
[15/19] Emitting module SwiftCurses
root@17b970fdb815:/yo/SwiftCurses#
```

Would you happen to have any pointers as to what I'm doing wrong ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.