jpsim/SourceKitten

Linux question for GitHub Actions

Cyberbeni opened this issue · 4 comments

I'm creating a GitHub Action to build/cache swift based tools. Is it safe to use swift --version to decide if I need rebuilding or does using libsourcekitdInProc.so set additional requirements for when I need a new build as opposed to restoring the previous one.

jpsim commented

swift --version ought to be enough. SourceKitten also links libclang and SourceKit, but those should change in lockstep with Swift versions for all practical intents.

Looks like a neat project!

FYI there's a typo in the project description: "GitHun Action"

image

Thanks, I fixed the typo.

I did some testing before I opened this ticket by caching on ubuntu-18.04 and loading from cache on ubuntu-20.04 and it seemed to work but when I did the regular tests for the PR then ubuntu-20.04 managed to save it to the cache and after that it failed on ubuntu-18.04 with the following error: swiftlint: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by swiftlint)`

swift --version is the same on both systems:

  Swift version 5.3.1 (swift-5.3.1-RELEASE)
  Target: x86_64-unknown-linux-gnu

I think I also need to add this flag: realm/SwiftLint#3434

jpsim commented

Ah, I didn't understand what you were changing when you asked what would be sufficient to require a rebuild. Yes the binary produced by one OS might not be compatible with a different OS.

https://bugs.swift.org/browse/SR-648?focusedCommentId=59744&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-59744

I guess I'll just wait for this to get done, using uname -v and swift --version together seems to work fine for now and they are not changing that often.