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

Not building with Swift 5.2 on Linux #31

Closed
lschmierer opened this issue Aug 20, 2020 · 5 comments
Closed

Not building with Swift 5.2 on Linux #31

lschmierer opened this issue Aug 20, 2020 · 5 comments

Comments

@lschmierer
Copy link

lschmierer commented Aug 20, 2020

My project stopped working.
I am getting a bunch of the following errors:

/GLibObject/GObject-2.0-unions.swift:378:45: error: value of tuple type 'Void' has no member 'v_int'
            let rv: Int = cast(_ptr.pointee.v_int)
swift --version
Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.5.0

Edit:
On Ubuntu 18.04 I am getting:

GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
@Dadoum
Copy link

Dadoum commented Aug 25, 2020

same here:

/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )
/home/dadoum/Téléchargements/SwiftHelloGtk/.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-unions.swift:1094:30: error: cannot convert value of type 'Int' to specified type 'UInt64'
            let rv: UInt64 = cast(_ptr.pointee.v_int64)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
                             UInt64(                   )

@lschmierer
Copy link
Author

The latest commits fixed this on macOS.
Thanks a lot, great work!

On Linux, it is still not wokring
Different Errors are thrown, mostly

.../.build/checkouts/SwiftGLib/Sources/GLib/GLib.swift:96:77: error: use of unresolved identifier 'cast'
    g_logv(nil, level.value, msg, CVaListPointer(_fromUnsafeMutablePointer: cast(msg)))

and

.../.build/checkouts/SwiftGLib/Sources/GLib/GLib-2.0-BookmarkFile.swift:631:47: error: cannot convert value of type 'UnsafeMutablePointer<UnsafeMutablePointer<gchar>?>?' (aka 'Optional<UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>>') to expected argument type 'UnsafeMutablePointer<UnsafePointer<gchar>?>?' (aka 'Optional<UnsafeMutablePointer<Optional<UnsafePointer<Int8>>>>')
        g_bookmark_file_set_groups(_ptr, uri, groups, gsize(length))

@lschmierer lschmierer changed the title Not building with Swift 5.2.4 on macOS Not building with Swift 5.2 on Linux Sep 1, 2020
@rhx
Copy link
Owner

rhx commented Sep 6, 2020

Should work on Linux now (tested with Ubuntu 18.04 and 20.04). Can you try

./distclean.sh
git pull
./build.sh

and see if this works for you now?

@lschmierer
Copy link
Author

Great, works 👍

@rhx
Copy link
Owner

rhx commented Sep 6, 2020

👍

@rhx rhx closed this as completed Sep 6, 2020
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

No branches or pull requests

3 participants