Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not run on Intel mac #19

Closed
larstvei opened this issue Dec 28, 2024 · 11 comments
Closed

Does not run on Intel mac #19

larstvei opened this issue Dec 28, 2024 · 11 comments

Comments

@larstvei
Copy link

Hi!

Thank you for this great interface for sqlite3!

I shared a babashka script using this pod to a user running an Intel mac, resulting in the following error:

java.io.IOException: Cannot run program "/Users/user/.user/pods/repository/org.babashka/go-sqlite3/0.2.4/mac_os_x/x86_64/pod-babashka-go-sqlite3": error=86, Bad CPU type in executable

I found #12, and suggested downgrading 0.1.0, which worked perfectly. I think maybe the fix for M1 macs broke intel macs? I run an M1 mac myself, so it's hard for me to verify that the issue was introduced by #12, but it is so far my best guess!

@borkdude
Copy link
Contributor

I have an Intel mac here as well (as well as an M1) one and can reproduce with 0.2.4. 0.2.3 still works for me.

borkdude added a commit that referenced this issue Dec 28, 2024
@borkdude borkdude reopened this Dec 28, 2024
@borkdude
Copy link
Contributor

I thought adding GOARCH=amd64 to the go invocation would fix this problem, but apparently not, with 0.2.5 I still get the same problem.

@lispyclouds perhaps you can take a look at this go stuff?

@larstvei
Copy link
Author

I am glad that you were able to get something out of the not-very-informative bug report!

@borkdude
Copy link
Contributor

At least you can still use 0.2.3 for now. Will take a look later. In can make a specific intel runner on circle to fix the problem for sure.

@lispyclouds
Copy link
Member

I will take a closer look soon.

@lispyclouds
Copy link
Member

lispyclouds commented Dec 28, 2024

Found the issue:

  • The build step is correct, it does build the amd64 one as expected
  • But, the test script has another build step which doesn't take in that param and overwrites the binary resulting in the amd64 becoming arm64 🤦🏽
  • It seems we always were building amd64 binaries for mac and rosetta was hiding that

@lispyclouds
Copy link
Member

@borkdude Fix on #21 tested with the produced artifacts as well.

lispyclouds added a commit that referenced this issue Dec 28, 2024
@borkdude borkdude reopened this Dec 29, 2024
@borkdude
Copy link
Contributor

@lispyclouds Now none of the pods work anymore, I get:

$ bb examples/go_sqlite3.clj
Downloading pod org.babashka/go-sqlite3 (0.2.6)
Successfully installed pod org.babashka/go-sqlite3 (0.2.6)
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

I'll take a look...

@lispyclouds
Copy link
Member

Interesting, I'm taking a look as well

@borkdude
Copy link
Contributor

Alright, 0.2.7 finally works, tested both on mac intel and arm locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants