Coder Social home page Coder Social logo

v0.5.0 fails on CircleCI about swiftgen HOT 9 CLOSED

jschmid avatar jschmid commented on May 22, 2024
v0.5.0 fails on CircleCI

from swiftgen.

Comments (9)

AliSoftware avatar AliSoftware commented on May 22, 2024

Version 0.5.0 use some third-party frameworks (like Commander to parse the command-line, and in future versions I'll also use other frameworks like Stencil to add template support, etc).

That's probably why you have that "Library not loaded" error, because the dynamic linker (dyld) can't find them.

How did you install the app in your CircleCI server?

  • Using homebrew?
  • Using rake install?
    • If using rake install, did you specify a specific destination or did you let it use the default destinations (which are /usr/local/bin for the binary and /usr/local/Frameworks for the third-party frameworks)?
  • Or did you simply compile it on Xcode.app (which would then explain it as this doesn't work due to some Xcode subtleties & bugs, that's why the installation instructions in the README explains you must use rake or homebrew)?
  • Or did you install in on your Mac and then copy the binary file from your machine over to CircleCI… but forgot to copy the frameworks too? (which then need to be in the same relative-path to the app than it was on your Mac installation then)

from swiftgen.

jschmid avatar jschmid commented on May 22, 2024

Thank you for your reply.

I am using Homebrew.

Would you like me to try other methods?

from swiftgen.

AliSoftware avatar AliSoftware commented on May 22, 2024

So you ran Homebrew directly on the CircleCI VM, right?

Does your CircleCI have Xcode 7, if so what's its path?

I'd be interested to see the output of otool -L /usr/local/bin/swiftgen
and otool -l /usr/local/bin/swiftgen | grep -A 2 LC_RPATH

Also useful would be the output of your homebrew install swiftgen --verbose --debug on the CircleCI VM.

from swiftgen.

jschmid avatar jschmid commented on May 22, 2024

I created a test project.

You can see the results there: https://circleci.com/gh/utribo/test-swiftgen-circleci/, particularly there: https://circleci.com/gh/utribo/test-swiftgen-circleci/8

from swiftgen.

AliSoftware avatar AliSoftware commented on May 22, 2024

Hmmm so when SwiftGen was built by Homebrew, it built it with /Applications/Xcode.app (or at least it used this path as the @rpath to find the Swift core libraries), but when you try to run it, that path doesn't exist on the CircleCI VM.

That's probably because Homebrew built a bottle (pre-built binary that their CI build on its own and package in a tar.gz to avoid the need for you to build it yourself on the machine you're installing it to).
So the swiftgen version you have was build by Homebrew servers where their Xcode is at /Applications/Xcode.app… but on your CircleCI VM this path probably doesn't exist.

One quick way to solve it yourself is to add the path to Xcode (the one path on CircleCI I mean) to swiftgen's @rpath so SwiftGen can find the Swift binaries before invoking it.
Something probably similar to this:

rpath=$(dirname "$(dirname "$(xcrun -find swiftc)")")/lib/swift/macosx
install_name_tool -add_rpath "$rpath" "$(which swiftgen)"

I'll try to find a way to some this in the homebrew Formula so that the homebrew installation would automatically fix it after installing the bottle, if it can be done, but in the meantime that could allow you to workaround the issue.

from swiftgen.

jschmid avatar jschmid commented on May 22, 2024

Thanks for the thorough answer.
I have a few days off now. I'll let you know when I get back and try it.
Thanks!

On Thu, Oct 15, 2015, 21:43 AliSoftware [email protected] wrote:

Hmmm so when SwiftGen was built by Homebrew, it built it with
/Applications/Xcode.app (or at least it used this path as the @rpath to
find the Swift core libraries), but when you try to run it, that path
doesn't exist on the CircleCI VM.

That's probably because Homebrew built a bottle (pre-built binary that
their CI build on its own and package in a tar.gz to avoid the need for
you to build it yourself on the machine you're installing it to).
So the swiftgen version you have was build by Homebrew servers where
their Xcode is at /Applications/Xcode.app… but on your CircleCI VM this
path probably doesn't exist.

One quick way to solve it yourself is to add the path to Xcode (the one
path on CircleCI I mean) to swiftgen's @rpath so SwiftGen can find the
Swift binaries before invoking it.
Something probably similar to this:

rpath=$(dirname "$(dirname "$(xcrun -find swiftc)")")/lib/swift/macosx
install_name_tool -add_rpath "$rpath" "$(which swiftgen)"```�I'll try to find a way to some this in the homebrew Formula so that the homebrew installation would automatically fix it after installing the bottle, if it can be done, but in the meantime that could allow you to workaround the issue.


Reply to this email directly or view it on GitHub
#35 (comment)
.

from swiftgen.

AliSoftware avatar AliSoftware commented on May 22, 2024

This should be fixed once Homebrew/legacy-homebrew#45008 is merged by the Homebrew team.

I'm gonna close this issue now that a fix is pending release — but feel free to reopen in case it still doesn't work on your CircleCI even after the fix is merged.

from swiftgen.

jschmid avatar jschmid commented on May 22, 2024

The build passes now. Thanks! 👍

from swiftgen.

AliSoftware avatar AliSoftware commented on May 22, 2024

Thx for the feedback 👍

from swiftgen.

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.