In this tutorial you’ll discover everything you need to start developing Swift on Linux. You’ll learn about LLDB, using SourceKit-LSP, syntax highlighting and the power of autocomplete.
Well it did not build. I have swift version 5.2.1. During the build I got the following message:
/home/bruce/sourcekit-lsp/.build/checkouts/indexstore-db/lib/Support/Concurrencyunknown type name ‘dispatch_queue_priority_t’; did you mean 'dispatch_queue_attr
@bmontegani Hmm, that’s odd. Could you share some more info? Like the exact swift version from swift --version, your OS version, what command gave this error and the full stack trace?
That way we can better help figuring out what went wrong. Thanks! :]
Thank You.
BTW… I have noticed that source kit-lsp recommends using the latest development release of Swift. Is this stable enough if I am only doing server side swift?
Development Snapshots are prebuilt binaries that are automatically created from mainline development branches. These snapshots are not official releases. They have gone through automated unit testing, but they have not gone through the full testing that is performed for official releases.
What this means is that you can use them just fine, but I would be careful with. running production code on the snapshots. Usually there isn’t much breaking with them, but they can contain more bugs than the main releases, including big crashes.
Hey @bpashch, awesome to hear you liked the article. When you hit a breakpoint in VSCode you will get access to the lldb console. It should pop up from the bottom or side of the screen. In there you can add watchpoints (see the LLDB docs on how) or use your normal p and po commands
I am unsure if there are builtin GUI ways in VSCode to add watchpoints, I would suggest looking through the VSCode debugging documentation for this
Finding that lldb window is something that I’m struggling with - could you please perhaps point me to it on my screenshot? Typing po anywhere does not seem to work
warning: dependency 'SQLite' is not used by any target
'swift-nio-ssl-support' openssl.pc: warning: couldn't find pc file
/home/dolar/Downloads/Compressed/Todos/Starter/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/shims.c:16:
/home/dolar/Downloads/Compressed/Todos/Starter/.build/checkouts/swift-nio-ssl/So:17:10: fatal error: 'openssl/conf.h' file not found
^~~~~~~~~~~~~~~~
generated.
[0/50] Compiling CNIOSHA1 c_nio_sha1.c
Then I run $ curl http://localhost:8080` and got this message:
curl: (7) Failed to connect to localhost port 8080: Connection refused
I am new to Ubuntu, But I was able to install swift succesfully by following the official link of swift.
Swift version 5.3.2 (swift-5.3.2-RELEASE)
Ubuntu 20.04.1 LTS