-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Re-add all SwiftSyntax rules and support #3108
Conversation
This reverts commit b744cf0.
@marcelofabri you can use this PR to iterate on the packaging issues discussed in #3105. |
Thanks! |
guard xcrunFindSwiftPath.hasSuffix("/usr/bin/swift") else { | ||
return nil | ||
} | ||
let xcrunFindPath = xcrunFindSwiftPath.appending(pathComponent: "macosx") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change this from the original library_wrapper
from SourceKitten
Do I need to change something in the Linux code path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be same with original like:
let xcrunFindPath = xcrunFindSwiftPath.appending(pathComponent: "macosx") | |
let xcrunFindPath = xcrunFindSwiftPath.deleting(lastPathComponents: 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With suggested changes, it still fails like:
$ swift build --configuration release -Xlinker -weak-l_InternalSwiftSyntaxParser
[2/2] Linking swiftlint
$ install_name_tool -delete_rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx .build/x86_64-apple-macosx/release/swiftlint
$ DYLD_PRINT_RPATHS=1 .build/x86_64-apple-macosx/release/swiftlint lint --enable-all-rules --no-cache
RPATH failed expanding @rpath/lib_InternalSwiftSyntaxParser.dylib to: /usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib
RPATH successful expansion of @rpath/libswiftCore.dylib to: /usr/lib/swift/libswiftCore.dylib
RPATH successful expansion of @rpath/libswiftDarwin.dylib to: /usr/lib/swift/libswiftDarwin.dylib
RPATH successful expansion of @rpath/libswiftDispatch.dylib to: /usr/lib/swift/libswiftDispatch.dylib
RPATH successful expansion of @rpath/libswiftFoundation.dylib to: /usr/lib/swift/libswiftFoundation.dylib
RPATH successful expansion of @rpath/libswiftObjectiveC.dylib to: /usr/lib/swift/libswiftObjectiveC.dylib
Loading configuration from '.swiftlint.yml'
Linting Swift files at paths
Linting 'Location.swift' (1/440)
Linting 'RuleDocumentation.swift' (2/440)
Linting 'RuleListDocumentation.swift' (3/440)
Linting 'RuleDescription.swift' (4/440)
dyld: lazy symbol binding failed: can't resolve symbol _swiftparse_syntax_structure_versioning_identifier in /Users/norio/github/SwiftLint/.build/x86_64-apple-macosx/release/swiftlint because dependent dylib #3 could not be loaded
dyld: can't resolve symbol _swiftparse_syntax_structure_versioning_identifier in /Users/norio/github/SwiftLint/.build/x86_64-apple-macosx/release/swiftlint because dependent dylib #3 could not be loaded
fish: 'DYLD_PRINT_RPATHS=1 .build/x86_…' terminated by signal SIGABRT (Abort)
I don't know how to resolve this error. 🤷♂
guard xcrunFindSwiftPath.hasSuffix("/usr/bin/swift") else { | ||
return nil | ||
} | ||
let xcrunFindPath = xcrunFindSwiftPath.appending(pathComponent: "macosx") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be same with original like:
let xcrunFindPath = xcrunFindSwiftPath.appending(pathComponent: "macosx") | |
let xcrunFindPath = xcrunFindSwiftPath.deleting(lastPathComponents: 3) |
} | ||
|
||
var usrLibDir: String { | ||
return appending(pathComponent: "/usr/lib/swift") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macosx
should be appended at here:
return appending(pathComponent: "/usr/lib/swift") | |
return appending(pathComponent: "/usr/lib/swift/macosx") |
return unsafeBitCast(sym, to: T.self) | ||
} | ||
let errorString = String(validatingUTF8: dlerror()) | ||
fatalError("Finding symbol \(symbol) failed: \(errorString ?? "unknown error")") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It produces a violation:
fatalError("Finding symbol \(symbol) failed: \(errorString ?? "unknown error")") | |
queuedFatalError("Finding symbol \(symbol) failed: \(errorString ?? "unknown error")") |
} | ||
} | ||
|
||
fatalError("Loading \(path) failed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fatalError("Loading \(path) failed") | |
queuedFatalError("Loading \(path) failed") |
/// If we hit this path, the user is invoking Swift via swiftenv shims and has not set the | ||
/// environment variable; this means we're going to end up trying to load from `/usr/lib` | ||
/// which will fail - and instead, we can give a more useful error message. | ||
fatalError("Swift is installed via swiftenv but swiftenv is not initialized.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fatalError("Swift is installed via swiftenv but swiftenv is not initialized.") | |
queuedFatalError("Swift is installed via swiftenv but swiftenv is not initialized.") |
Can Carthage manage the SwiftSyntax submodule just like any other? |
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions! |
I won't be trying to fix this any time soon. |
This reverts #3107.