Giter Site home page Giter Site logo

Comments (22)

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024 10

For people still guided here by the Google Search Gods this is the solution:

  1. Run xcode-select -p, see your current Xcode path
  2. Update the name of your current Xcode application to Xcode.app, often this name can contain numbers or other characters that cause issues. Copy this new path.
  3. Run xcode-select -s YOUR_NEW_RENAMED_XCODE_APP_PATH
  4. Mockolo will work as expected

from mockolo.

elsh avatar elsh commented on May 21, 2024

Is the dylib in the same dir as the mockolo executable? If it's in a different location, it will throw the above error. Also, can you check what xcode versions are installed in the laptops that work and don't work? It shouldn't matter as the dylib is a compile time dependency, but would be good to narrow down what the differences are.

from mockolo.

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024

from mockolo.

elsh avatar elsh commented on May 21, 2024

I've attached two binaries to the release, mockolo.tar.gz built with swift 5.2 (xcode 11.4+), and mockolo-swift5.1.tar.gz built with swift 5.1 (< xcode 11.3). Can you try both and see if either one fails? thanks.

from mockolo.

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024

The thing is that in Homebrew we just compile without linking to a dylib

  def install
    system "swift", "build", "-c", "release", "--disable-sandbox"
    bin.install ".build/release/mockolo"
  end

from mockolo.

elsh avatar elsh commented on May 21, 2024

Looks like there's a compatibility issue between Xcode 11.4+ and 11.3- similar to realm/SwiftLint#3105. What happens if you set the depends_on :xcode version to 11.4? If that doesn't work, we might have to dynamically load it, like https://github.com/jpsim/SourceKitten/blob/master/Source/SourceKittenFramework/library_wrapper.swift.

from mockolo.

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024

We can have the brew formula rely on sourcekitten from brew itself, does this solve our issue?

from mockolo.

elsh avatar elsh commented on May 21, 2024

from mockolo.

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024

Sourcekitten can be installed via Brew

brew install sourcekitten

Can we somehow consume that binary?

from mockolo.

elsh avatar elsh commented on May 21, 2024

The error is not related to sourcekitten. It's due to swiftsyntax between the xcode versions. If we set the 'depends_on xcode' version to 11.4, this error might be resolved.

from mockolo.

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024

Could this approach work?

swift build --configuration release -Xlinker -weak-l_InternalSwiftSyntaxParser

from mockolo.

elsh avatar elsh commented on May 21, 2024

I don't think it resolves it, as @rpath to the internal dylib still shows up if you run otool -L mockolo.
Could you try setting the version to 11.4 and see if it fixes the error? If not, either we'll have to dynamically load the dylib or see if we can use lines 72-74 from install-script.sh (mockolo) in homebrew: def install.

from mockolo.

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024

Can we make another shell script that homebrew can run to do these 2 commands?

cp "$(xcode-select -p)"/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/lib_InternalSwiftSyntaxParser.dylib . 

install_name_tool -change @rpath/lib_InternalSwiftSyntaxParser.dylib @executable_path/lib_InternalSwiftSyntaxParser.dylib "$TARGET"

from mockolo.

elsh avatar elsh commented on May 21, 2024

It will require tarballing both the mockolo executable and the dylib to run the executable. Does homebrew allow that? Also, did you happen to see if requiring Xcode 11.4 fixes the error?

from mockolo.

elsh avatar elsh commented on May 21, 2024

Revisiting this; @tinder-maxwellelliott if you set the xcode version to 11.4 (now that mockolo requires 11.4+), does this error still repro?

from mockolo.

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024

This has gone away! Thanks!

from mockolo.

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024

@elsh Is there no possible way to avoid a Dylib here at all? Can we make a static framework and avoid this all together?

from mockolo.

elsh avatar elsh commented on May 21, 2024

from mockolo.

tinder-maxwellelliott avatar tinder-maxwellelliott commented on May 21, 2024

Static? no it required building too many pieces in swift repo the last time tried. We can try dlopen. What's the main issue anyway?

On Mon, Jul 20, 2020 at 2:45 PM Maxwell Elliott @.***> wrote: @elsh https://github.com/elsh Is there no possible way to avoid a Dylib here at all? Can we make a static framework and avoid this all together? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#108 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUG5PF3CJDMGQ3P6QYGH5DR4S3GBANCNFSM4MNWJXCA .

People keep getting into issues where Xcode is not where Mockolo expects it to be

from mockolo.

elsh avatar elsh commented on May 21, 2024

from mockolo.

elsh avatar elsh commented on May 21, 2024

Closing. Feel free to reopen if this issue arises agin.

from mockolo.

n-belokopytov avatar n-belokopytov commented on May 21, 2024

The issues is back, this time on Homebrew itself - it blocks the release of Mockolo 1.8.0.
https://github.com/Homebrew/homebrew-core/actions/runs/3349028971/jobs/5548712516

I've also opened a new issue for this, since I feel like this can be fixed on the build configuration level: #206

from mockolo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.