You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're on Mac OS, you can try using the docker-swift image. They reported seeing the exact same issue. Their workaround doesn't fix lldb, though, so we'll skip that for now.
If you're on Linux or have the docker image ready:
Run swift. That should open the Swift REPL
Inside the REPL, run print("Hi"). That should work.
Inside the REPL, run import Foundation. That should fail and throw an error of many, many lines:
2> import Foundation/home/felix/.swiftenv/versions/4.1/usr/lib/swift/CoreFoundation/CoreFoundation.h:25:10: note: while building module 'SwiftGlibc' imported from /home/felix/.swiftenv/versions/4.1/usr/lib/swift/CoreFoundation/CoreFoundation.h:25:#include <sys/types.h> ^<module-includes>:3:10: note: in file included from <module-includes>:3:#include "///usr/include/utmp.h" ^///usr/include/utmp.h:23:10: note: in file included from ///usr/include/utmp.h:23:#include <sys/types.h>...
LLDB shows the same type of errors.
Details of the problem
I found this and this, but those fixes require (a) to change how you invoke swift and (b) don't fix lldb.
Here, however, they've come up with a better solution that actually fits swiftenv better. The details are below.
How to fix it (from console)
I managed to make it all work like this on bash: (use the equivalent for zsh or fish)
Lemme explain.
How are they broken
If you're on Mac OS, you can try using the docker-swift image. They reported seeing the exact same issue. Their workaround doesn't fix lldb, though, so we'll skip that for now.
If you're on Linux or have the docker image ready:
swift
. That should open the Swift REPLprint("Hi")
. That should work.import Foundation
. That should fail and throw an error of many, many lines:LLDB shows the same type of errors.
Details of the problem
I found this and this, but those fixes require (a) to change how you invoke
swift
and (b) don't fix lldb.Here, however, they've come up with a better solution that actually fits
swiftenv
better. The details are below.How to fix it (from console)
I managed to make it all work like this on
bash
: (use the equivalent forzsh
orfish
)After that, it works the expected way:
Should it be fixed from
swiftenv
?Dunno. I think so. This bug is really old, and until it gets fixed... well, I'd prefer to have it easier on the Linux devs.
As always, my hands are here to help :)
(although it may take me a week to respond, depending on the week)
The text was updated successfully, but these errors were encountered: