Darling: /usr/lib/swift/libswiftCore.dylib: file too short

Created on 16 Aug 2020  Â·  7Comments  Â·  Source: darlinghq/darling

Expected Result
Xcode, Swift and Brew will work fine

Actual Result

Darling [~]$ xcodebuild 
dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
  Reason: no suitable image found.  Did find:
    /usr/lib/swift/libswiftCore.dylib: file too short
    /usr/lib/swift/libswiftCore.dylib: stat() failed with errno=22
abort_with_payload: reason: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
  Reason: no suitable image found.  Did find:
    /usr/lib/swift/libswiftCore.dylib: file too short
    /usr/lib/swift/libswiftCore.dylib: stat() failed with errno=22; code: 1
Abort trap: 6 (core dumped)
Darling [~]$ swift
dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
  Reason: no suitable image found.  Did find:
    /usr/lib/swift/libswiftCore.dylib: file too short
    /usr/lib/swift/libswiftCore.dylib: stat() failed with errno=22
abort_with_payload: reason: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
  Reason: no suitable image found.  Did find:
    /usr/lib/swift/libswiftCore.dylib: file too short
    /usr/lib/swift/libswiftCore.dylib: stat() failed with errno=22; code: 1
Abort trap: 6 (core dumped)
Darling [~]$ brew
Abort trap: 6 (core dumped)

Steps To Reproduce
Download Xcode 11.6 xip and move it to /Applications then unxip it after that install brew by following command

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

and allow it install xcode command line tools etc..
then set the variables for xcode-select

export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
xcode-select -s /Applications/Xcode.app/Contents/Developer

then try xcodebuild and now you get the Error :smile:

I installed Swift latest version from there website and same thing no improvements

installer -pkg swift-5.2.5-RELEASE-osx.pkg -target /

System Information
Ubuntu 20.04 LTS
CPU: Intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8
RAM: 15.6 GiB

| Software | Version |
| --- | --- |
| Linux Kernel | 5.4.0 |
| Darling | c03f2b9702c00bda95e580aae01e461cbeb2a0d0 |

Most helpful comment

That is not a solution

Well, then you have to implement that library :-)

All 7 comments

Seems that https://github.com/darlinghq/darling-swift uses git-lfs, but its not in the build instructions so we just get a bunch of text files instead if its not installed.

apt install git-lfs
git lfs install

And then a reclone of the external/swift seems to give the correct files.

Seems that https://github.com/darlinghq/darling-swift uses git-lfs, but its not in the build instructions so we just get a bunch of text files instead if its not installed.

apt install git-lfs
git lfs install

And then a reclone of the external/swift seems to give the correct files.

thank you, that fix it (I think)
now I got this message:
dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/Versions/A/UserNotifications
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/DVTFoundation
Reason: image not found
abort_with_payload: reason: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/Versions/A/UserNotifications
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/DVTFoundation
Reason: image not found; code: 1
Abort trap: 6 (core dumped)

@clienthax Would you be able to submit a PR to add git-lfs to the build instructions?

@xlmnxp It's saying that UserNotifications.framework does not exist. A framework stub needs to be created.

@clienthax Would you be able to submit a PR to add git-lfs to the build instructions?

@xlmnxp It's saying that UserNotifications.framework does not exist. A framework stub needs to be created.

I will,
How to create the framework?

https://docs.darlinghq.org/contributing/generating-stubs.html has an explanation on how to create stub. You will need to do it on a system running macOS.

https://docs.darlinghq.org/contributing/generating-stubs.html has an explanation on how to create stub. You will need to do it on a system running macOS.

That is not a solution

That is not a solution

Well, then you have to implement that library :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stek29 picture stek29  Â·  3Comments

Arucard1983 picture Arucard1983  Â·  3Comments

LubosD picture LubosD  Â·  5Comments

fervi picture fervi  Â·  3Comments

LubosD picture LubosD  Â·  5Comments