pwsacademy / swift-setup

Student-friendly setup instructions for platforms, editors, and IDEs that support Swift.
150 stars 11 forks source link

Added installation instructions for Fedora and CentOS #1

Closed tachoknight closed 3 years ago

tachoknight commented 3 years ago

Followed the Ubuntu template for consistency.

svanimpe commented 3 years ago

Thanks @tachoknight. I will try to test these out myself before I add them to the repo.

[UPDATE: I'll attempt to answer some of these questions myself. Answers in bold.]

Some questions about Fedora:

Some questions about CentOS/RHEL:

Editor-related questions:

tachoknight commented 3 years ago

Some questions about Fedora:

  • Which versions does this apply to? 32? Earlier versions also?

Swift has been available since around Fedora 29, if I recall the version correctly.

  • Which editions does this apply to? Workstation/server/IoT, or all?

All versions, including the aarch64 architecture (e.g. the Raspberry Pi).

  • Which version of Swift is currently supported? 5.3?

I try to keep in sync with Apple's releases, so 5.3 is what is currently supported. Whenever they release a new version, I'll update Fedora (and CentOS/RHEL) to match

  • Does this meet the requirements for platforms listed here or are there still missing/broken pieces?

There are no broken/missing pieces; it is the complete toolchain.

Some questions about CentOS/RHEL:

  • Which versions does this apply to? 7 and 8?

8 and later.

  • Which version of Swift is currently supported? 5.3?

Currently 5.3

  • What software does the user have to install during installation? Is a minimal install enough?

Installing via the package manager takes care of all the dependencies; the dependencies are as few as necessary to make Swift work.

  • How does this compare to the toolchains from swift.org? Is it functionally equivalent, and just a different way of distributing?

It is functionally equivalent.

  • Does this meet the requirements for platforms listed here or are there still missing/broken pieces?

There are no broken/missing pieces; it is the complete toolchain.

Editor-related questions:

  • Do Fedora Workstation and CentOS (with GUI) include Gedit as the "Text Editor" app? If so, I can indicate that the instructions for Gedit apply to these platforms as well.

Gedit is available. If you're referring to the default editor, that will be different depending on the spin/version (e.g. the KDE version of Fedora uses something completely different).

  • How would you install VS Code on these platforms? On Ubuntu, I install it from via the "Ubuntu Software" app (which uses snap I believe).

It's available from the Snap store. I have not personally installed it that way; I use these instructions from Microsoft.

  • What's the state of SourceKit-LSP on these platforms? Is the language server included with the Swift installation? If so, I can use the SourceKit-LSP extension for VS Code.

SourceKit-LSP works; I installed the extension for VS Code and it works fine.

  • Where do these platform install Swift? For the CodeLLDB extension for VS Code, I need to configure the location of the Swift-specific LLDB library. On Ubuntu, this is toolchain/usr/lib/liblldb.so.

The entire toolchain is installed in /usr/libexec/swift with symlinks to /usr/bin for swift, swiftc, and sourcekit-lsp.

svanimpe commented 3 years ago

Thanks! Your answers and my edits seem to have crossed 🙂

So far, I've gotten everything working on Fedora 32 (Swift 5.3 + VS Code + SourceKit-LSP + CodeLLDB). If you're confident this will work just as well on CentOS/RHEL 8, I will go ahead and include these platforms and update the instructions for Gedit and Visual Studio Code.

tachoknight commented 3 years ago

If you're confident this will work just as well on CentOS/RHEL 8, I will go ahead and include these platforms and update the instructions for Gedit and Visual Studio Code.

Yep, Fedora is what RHEL is based on, and CentOS is based off that 😂.

tachoknight commented 3 years ago

Ugh, sorry about the close/reopen; my laptop slipped and I hit the 'close with comment' button instead of 'comment'. Wish GitHub would give a confirmation about closing something. :)

svanimpe commented 3 years ago

@tachoknight I did find one issue. The swift-lang package doesn't seem to include Git as a dependency, even though that's required by SwiftPM. On Fedora, Git was already installed, but on CentOS, it wasn't.

For now, I'll include installing Git in the instructions, so students don't run into unexpected issues.