Coder Social home page Coder Social logo

Comments (13)

nilslice avatar nilslice commented on May 11, 2024 1

Good catch!

@ananthdurai - you may also be able to install via brew and get the native arm64 build of Go using:

arch -arm64 brew install go

from extism.

ananthdurai avatar ananthdurai commented on May 11, 2024 1

@nilslice yes, that is the issue. I installed the ARM64 version of Go, and everything is working fine now. Thank you.

from extism.

bhelx avatar bhelx commented on May 11, 2024

Could you check the type of the dylib file? it should be arm64. Run this command:

> file /usr/local/lib/libextism.dylib
/usr/local/lib/libextism.dylib: Mach-O 64-bit dynamically linked shared library arm64

It looks to me like your go program is for some reason trying to compile to x86, but let's make sure the dylib is right.

building for macOS-x86_64

Is the suspicious part to me

from extism.

bhelx avatar bhelx commented on May 11, 2024

Also please make sure your go is an arm64 version:

> go version
go version go1.19.2 darwin/arm64

from extism.

nilslice avatar nilslice commented on May 11, 2024

Ya I think you may be running a Go toolchain that was built for x86, but extism installed the native arm64 release since you're on a M1.

This line in your error caught my eye:

ld: symbol(s) not found for architecture x86_64

Did you install Go via brew?

from extism.

bhelx avatar bhelx commented on May 11, 2024

That's my suspicion too. If that's the case you will want to uninstall go (instructions depend on how you installed it) then install it again but explicitly use the arm version. I think the easiest way to do that is to get the pkg from: https://go.dev/dl/
The one labeled Apple macOS (ARM64)

from extism.

ananthdurai avatar ananthdurai commented on May 11, 2024

I tried to uninstall Go and install it back,

>go version ✘ 2 go version go1.19.3 darwin/amd64

>file /usr/local/lib/libextism.dylib
/usr/local/lib/libextism.dylib: Mach-O 64-bit dynamically linked shared library arm64

Both seem arm64, trying to debug further to see if I can find any insights.

from extism.

ananthdurai avatar ananthdurai commented on May 11, 2024

From the error,

ignoring file /usr/local/lib/libextism.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
GoLang Extism C lib compiled for macOS-x86_64, but the machine has the macOS-arm64. I suppose some issue with Extism Go dependency. Perhaps it requires compilation for M1 as a target?

I'm on 13.0.1 (22A400) MacOs version.

from extism.

nilslice avatar nilslice commented on May 11, 2024

extism install latest should have downloaded an arm64 build based on detecting your system. But, you could download a release directly for your architecture and replace these files:

/usr/local/lib/libextism.dylib
/usr/local/include/extism.h

Release url: https://github.com/extism/extism/releases/download/v0.1.0/libextism-aarch64-apple-darwin-v0.1.0.tar.gz

from extism.

bhelx avatar bhelx commented on May 11, 2024

@nilslice i don't think that's it. His dylib file is correct. He's on an M1 and it's an arm binary. His Go install is still x86

go version ✘ 2 go version go1.19.3 darwin/amd64
Both seem arm64, trying to debug further to see if I can find any insights.

@ananthdurai darwin/amd64 is x86 not arm

How are you installing Go? if you are using homebrew it might be installing the x86 version. I suggest uninstalling Go and installing via the instructions I listed above. Directly from the pkg from go.

from extism.

bhelx avatar bhelx commented on May 11, 2024

GoLang Extism C lib compiled for macOS-x86_64, but the machine has the macOS-arm64. I suppose some issue with Extism Go dependency. Perhaps it requires compilation for M1 as a target?

@ananthdurai I believe the reason is that you have x86 version of go. Your M1 can run both binaries so it's not a problem until it needs to compile something. But now that it needs cgo it's expecting it to be x86 code. It's not the extism dependency i don't think.

from extism.

nilslice avatar nilslice commented on May 11, 2024

Hi @ananthdurai - just wanted to check in and see if you were able to get this resolved?

from extism.

nilslice avatar nilslice commented on May 11, 2024

Excellent, glad to hear that! Going to close the issue now, but please feel free to reopen if the issue reemerges.

from extism.

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.