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

install via brew on silicon macOS fails #5254

Closed
2 tasks done
netskink opened this issue Oct 2, 2023 · 5 comments
Closed
2 tasks done

install via brew on silicon macOS fails #5254

netskink opened this issue Oct 2, 2023 · 5 comments

Comments

@netskink
Copy link

netskink commented Oct 2, 2023

New Issue Checklist

Describe the bug

Updated brew
installed SwiftLint via brew
My path already had /opt/ fix for silicon macOS

works

$ swiftlint -h

fails

$ swiftlint
SourceKittenFramework/library_wrapper.swift:31: Fatal error: Loading sourcekitdInProc.framework/Versions/A/sourcekitdInProc failed

Adding to build phase like so:

# Type a script or drag a script file from your workspace to insert its path.
if which swiftlint > /dev/null; then
    swiftlint
else
    echo "Warning: swiftlint not installed. Use brew install swiftlint"
fi

Does nothing. I don't see any messages on pass or fail. I suspect it fails sine running at prompt fails.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
SourceKittenFramework/library_wrapper.swift:31: Fatal error: Loading sourcekitdInProc.framework/Versions/A/sourcekitdInProc failed
[1]    12738 trace trap  swiftlint lint

Environment

  • SwiftLint version (run swiftlint version to be sure)?
    • 0.53.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)?
    • brew install swiftlint
  • Paste your configuration file:

no mods other that brew install. No knowledge of whee this file is located

# insert yaml contents here
  • Are you using nested configurations?
    If so, paste their relative paths and respective contents.

    • got me
  • Which Xcode version are you using (check xcodebuild -version)?

    • xcode -version

    • zsh: command not found: Xcode

    • Xcode uI says 14.3
  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
    to quickly test if your example is really demonstrating the issue. If your example is more
    complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.

// This triggers a violation:
let foo = try! bar()
@netskink netskink changed the title install via brew on silico install via brew on silicon macOS fails Oct 2, 2023
@SimplyDanny
Copy link
Collaborator

Is Xcode installed? This might help.

@netskink
Copy link
Author

netskink commented Oct 3, 2023

I'll have to check. I have the extra tools installed for using home brew but I'll check the workflow in the post provided.

Thanks

@netskink
Copy link
Author

netskink commented Oct 3, 2023

Initially, I have the following setting:

❯ xcode-select -p
/Library/Developer/CommandLineTools

Following that link gives

❯ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Password:
❯ xcode-select -p
/Applications/Xcode.app/Contents/Developer
❯

After that swiftlint works

> swiftlet 
.... <lines trucated>
empty line; currently 4 (vertical_whitespace)
Done linting! Found 897 violations, 10 serious in 39 files.

Many thanks

@netskink
Copy link
Author

netskink commented Oct 3, 2023

Thanks again @SimplyDanny . BTW, I updated the docs to address via #5260

Furthermore, I see errors in terminal, but sadly with the Xcode mod described in the build phase in place I don't see the same errors. In fact, I don't see any errors/output. 8-(

@netskink
Copy link
Author

netskink commented Oct 3, 2023

Ahh, even though I have my terminal path setup correctly, I still need the path set in the build script. This setup to modify path fixed the issue where its not found. This is revealed to the error in the build log where it says to brew install swiftlintt

if [[ "$(uname -m)" == arm64 ]]; then
    export PATH="/opt/homebrew/bin:$PATH"
fi

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

No branches or pull requests

2 participants