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

Invalid binary compiled for swiftlint #68

Closed
sk- opened this issue Oct 28, 2020 · 6 comments · Fixed by #70
Closed

Invalid binary compiled for swiftlint #68

sk- opened this issue Oct 28, 2020 · 6 comments · Fixed by #70
Assignees

Comments

@sk-
Copy link

sk- commented Oct 28, 2020

The actions looks great, however the compiled binary for swiftlint fails with the error:

Run swiftlint --strict
  swiftlint --strict
  shell: /bin/bash -e {0}
Loading configuration from '.swiftlint.yml'
Fatal error: Loading libsourcekitdInProc.so failed: file SourceKittenFramework/library_wrapper.swift, line 39
/home/runner/work/_temp/8c14c813-f4f1-4307-b0e6-78983f636737.sh: line 1:  3112 Illegal instruction     (core dumped) swiftlint --strict
Error: Process completed with exit code 132.

Below is my configuration

  lint:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Install swiftlint
      uses: Cyberbeni/install-swift-tool@v2
      with:
        url: https://github.com/realm/SwiftLint
        version: "0.39.2"  # TODO: change to 0.40.3

    - name: Lint
      run: swiftlint --strict

Is there something I'm missing?

The only difference I could find with respect to the build command we have in CircleCI is that we are passing the flag --static-swift-stdlib.

Also, I noted that the tests don't execute the compiled files, they just check whether they are in the path.
ps: It'd be great if you could add https://github.com/apple/swift-format to the tests

@sk-
Copy link
Author

sk- commented Oct 28, 2020

I managed to make it work by running instead LINUX_SOURCEKIT_LIB_PATH=/usr/share/swift/usr/lib swiftlint --strict

@Cyberbeni Cyberbeni self-assigned this Oct 30, 2020
@Cyberbeni
Copy link
Owner

Oh, I was not getting notifications from this repo.
Never had similar issue with SwiftFromat in my workflow, so I assumed that if it builds, it runs. I'll take a look at this issue on the weekend.

@Cyberbeni
Copy link
Owner

After a quick search it seems like this env var is the official solution for this and the we'll just have to find libsourcekitdInProc.so and export it's path on Linux.

@Cyberbeni
Copy link
Owner

Fixed in v2.1.8

@Cyberbeni
Copy link
Owner

ps: It'd be great if you could add https://github.com/apple/swift-format to the tests

That would also require some additional version matching (or specifying a fix swift version and using docker/swiftenv to download it at the start of the workflow). If you already have a working workflow for that, feel free to make a PR.

@Cyberbeni
Copy link
Owner

SInce I already knew how to do it, I added test for apple/swift-format to run after merge and on manual trigger with Swift 5.3

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

Successfully merging a pull request may close this issue.

2 participants