Commit Graph

17 Commits

Author SHA1 Message Date
Bryan Ricker
1938bdf841 [Ubuntu] add out-of-the-box SourceKitten support (#5634)
[SourceKitten](https://github.com/jpsim/SourceKitten), a popular Swift
library for interacting with SourceKit, needs to know (or be told) the
location of the sourcekitd framework. SourceKitten is somewhat
[ubiquitous](https://github.com/jpsim/SourceKitten#projects-built-with-sourcekitten);
most Swift projects I've seen or worked on used SourceKitten in some
way.

On macOS, the sourcekit framework is baked-in to the Xcode toolchain(s) and
therefore its location is generally known. On Linux, the location of the
sourcekit framework is wherever swift is installed, which is unknown to
libraries like SourceKitten.

SourceKitten searches for the sourcekit framework in [a few
locations](f7cf1e3b63/Source/SourceKittenFramework/library_wrapper.swift (L51-L104)),
but it's unable to infer the location of the framework on these ubuntu
images. The result when attempting to run any SourceKitten-based tool in
Github Actions on an ubuntu VM is the following error:

```
SourceKittenFramework/library_wrapper.swift:31: Fatal error: Loading libsourcekitdInProc.so failed
/home/runner/work/_temp/cb002a5e-1916-4e05-ba4d-f70ad3bb2266.sh: line 1:  3944 Illegal instruction     (core dumped) mint run swiftlint .
```

(to be clear, this error is not specific to the Github Actions ubuntu
VMs. The same error occurs on any Ubuntu system).

Individual users can work around this by setting the following
environment variable:

```
LINUX_SOURCEKIT_LIB_PATH="/usr/share/swift/usr/lib"
```

This is not a good workaround for the following reasons:

1. The end user doesn't necessarily know where swift is installed.
2. A change to the location of the swift installation would break this
   workaround.
3. The error will occur virtually 100% of the time on a user's first
   attempt to run SourceKitten on ubuntu, and takes at least a
   few minutes to troubleshoot. This will quickly add up to a
   non-trivial amount of lost productivity.

So, anyways, my proposal is to just link sourcekitd to a location where
SourceKitten will find it, so most developers don't have to think about it.
`LINUX_SOURCEKIT_LIB_PATH` can be defined by the user if they have an
unusual setup.

Alternative:

- Don't symlink, add `LINUX_SOURCEKIT_LIB_PATH` to `/etc/environment`.
2022-05-31 08:50:57 +02:00
Jay W
49a7578313 [ubuntu] Fix swift installation (#4429) 2021-11-07 19:07:58 +03:00
Aleksandr Chebotov
a533011008 use download_with_retries (#3054) 2021-03-30 15:23:57 +03:00
Vladimir Safonkin
0ae118c6ae [Ubuntu] Create symlink for Pester test running (#2349)
* Create symlink for test running

* Fix 1604 and 2004 templates

* Fix php and haskell running

* Minor fix

* Fix new added tests

* Fix symlink

* Minor fix

* Fix script permissions

* Minor fix

* Fix firefox and rust tests

* Fix new merged tests
2020-12-30 09:57:11 +03:00
Vladimir Safonkin
0a768b0726 [Ubuntu] Migrate tests to Pester (#2340)
* Add Pester tests

* Fix incorrect merging

* Remove swift test from installing script

* Minor fix

* Remove Haskell tests from commons tests

* Fix selenium test

* Fix SVN test

* Fix pipx tests

* Debug

* Fix pipx packages test

* Skip pipx for 16.04
2020-12-29 10:02:46 +03:00
Leonid Lapshin
af562625fc added a swiftc symlink [Ubuntu] (#1832)
* added a swiftc symlink

* swiftc points to swiftc

Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
2020-10-20 11:45:08 +03:00
Sergey Dolin
1d4f281899 Add -e to .sh scripts 2020-10-12 15:47:09 +05:00
Vladimir Safonkin
7b3bfbdf61 [Ubuntu] Remove docs logic from Ubuntu provisioner (#1603)
* Remove docs logic on Ubuntu

* Cleanup templates

* Fix oras-cli.sh

* Remove announcements.md
2020-09-17 14:15:31 +03:00
Nikita Bykov
db9a568512 updated swift_version 2020-03-27 14:52:12 +03:00
Nikita Bykov
47dfa35375 fixed getting the swift version 2020-03-27 14:12:53 +03:00
Nikita Bykov
8bf9b15316 added getting the latest version by default 2020-03-27 13:55:47 +03:00
Nikita Bykov
01d87333d8 updated the swift version 2020-03-27 09:04:35 +03:00
Nikita Bykov
09dd3401fe added document.sh 2020-03-25 11:25:36 +03:00
Nikita Bykov
80399e072a resolve comment 2020-03-25 09:26:22 +03:00
Nikita Bykov
6f557cf84c removed unused libs and fixed swift.sh 2020-03-24 16:32:31 +03:00
Nikita Bykov
0903a6eaf2 fixed swift.sh 2020-03-24 15:56:42 +03:00
Nikita Bykov
07e1f37d74 added swift support 2020-03-24 09:27:15 +03:00