homebrew-core icon indicating copy to clipboard operation
homebrew-core copied to clipboard

swift-format 0.50700.0

Open mrstegeman opened this issue 2 years ago • 8 comments

Created with brew bump-formula-pr.

mrstegeman avatar Sep 20 '22 18:09 mrstegeman

Running the binary fails with

  dyld[95921]: Library not loaded: '@rpath/lib_InternalSwiftSyntaxParser.dylib'
    Referenced from: '/opt/homebrew/Cellar/swift-format/0.50700.0/bin/swift-format'
    Reason: tried: '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/opt/homebrew/Cellar/swift-format/0.50700.0/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/swift/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/opt/homebrew/Cellar/swift-format/0.50700.0/bin/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/macosx/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/local/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file), '/usr/lib/lib_InternalSwiftSyntaxParser.dylib' (no such file)

Where should we be looking for lib_InternalSwiftSyntaxParser.dylib?

carlocab avatar Sep 20 '22 18:09 carlocab

Here's what I have on my system, with both Xcode 14.0 (with Swift 5.7) and the Swift 5.6.3 toolchain installed:

$ find /Library -name lib_InternalSwiftSyntaxParser.dylib
/Library/Developer/CommandLineTools/usr/lib/swift/macosx/lib_InternalSwiftSyntaxParser.dylib
/Library/Developer/Toolchains/swift-5.6.3-RELEASE.xctoolchain/usr/lib/swift/macosx/lib_InternalSwiftSyntaxParser.dylib

mrstegeman avatar Sep 20 '22 19:09 mrstegeman

And in /Applications, with both Xcode 14.0 and Xcode 13.4.1 installed:

$ find /Applications -name lib_InternalSwiftSyntaxParser.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/lib_InternalSwiftSyntaxParser.dylib
/Applications/Xcode_13.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/lib_InternalSwiftSyntaxParser.dylib

mrstegeman avatar Sep 20 '22 19:09 mrstegeman

The relevant change that broke rpath is: https://github.com/apple/swift-package-manager/pull/4208.

swift-syntax works around this via: https://github.com/apple/swift-syntax/commit/4f33e361829415ab913778a582eda3ad682f81c1.

I think lib_InternalSwiftSyntaxParser will be dropped as a dependency altogether in swift-format 0.50800.0 (Swift 5.8) from what I've seen.

Bo98 avatar Sep 20 '22 19:09 Bo98

Just realized it also gets pulled into the build and output as an artifact:

$ find . -name lib_InternalSwiftSyntaxParser.dylib
.build/release/lib_InternalSwiftSyntaxParser.dylib

mrstegeman avatar Sep 20 '22 19:09 mrstegeman

Ok, it wants the library to be in /opt/homebrew/Cellar/swift-format/0.50700.0/bin, but I'd really rather not do that. Any ideas for a workaround?

mrstegeman avatar Sep 20 '22 21:09 mrstegeman

macOS build is now working, but Linux build is failing due to https://github.com/apple/swift-format/issues/381 (which is due to https://github.com/apple/swift-syntax/issues/749).

mrstegeman avatar Sep 21 '22 07:09 mrstegeman

Actually, this just requires Swift 5.7 to build, so waiting on that. #110520

mrstegeman avatar Sep 21 '22 15:09 mrstegeman

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. To keep this pull request open, add a help wanted or in progress label.

github-actions[bot] avatar Sep 23 '22 22:09 github-actions[bot]

This is still waiting on Swift 5.7 support

mrstegeman avatar Sep 23 '22 22:09 mrstegeman

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. To keep this pull request open, add a help wanted or in progress label.

github-actions[bot] avatar Sep 26 '22 00:09 github-actions[bot]