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

GitHub action fails on linux/arm64 host #1564

Closed
sixlettervariables opened this issue Apr 17, 2024 · 4 comments · Fixed by #1596
Closed

GitHub action fails on linux/arm64 host #1564

sixlettervariables opened this issue Apr 17, 2024 · 4 comments · Fixed by #1596
Labels
bug Something isn't working

Comments

@sixlettervariables
Copy link

Description & Reproduction

Our GitHub workflows run on linux/arm64 hosts in AWS and we're receiving the following error with the action:

Bearer/bearer info Checking dependencies...
git version 2.34.1
Bearer/bearer crit platform linux/arm64 is not supported.  Make sure this script is up-to-date and file request at https://github.com/Bearer/bearer/issues/new
Error: Process completed with exit code 1.

Expected Behavior

A binary is available for linux/arm64 (I saw darwin/arm64 support).

Actual Behavior

Our linux/arm64 host is unsupported.

Possible Fix

Build for linux/arm64 as well.

Your Environment

  • Operating System and version: Ubuntu 22.04 aarch64 (6.2.0-1017-aws kernel)
  • Output of 'bearer version' (from the GH action):
bearer version: [v1.43.2](https://github.com/Bearer/bearer/releases/tag/v1.43.2)
sha: https://github.com/Bearer/bearer/commit/1bccddcd46e1476ce31476820e12e6f4b2405799
@sixlettervariables sixlettervariables added the bug Something isn't working label Apr 17, 2024
sixlettervariables added a commit to sixlettervariables/bearer that referenced this issue Apr 17, 2024
@gotbadger
Copy link
Contributor

@sixlettervariables from recollection there was some issues with the build on linux/arm64 so i think its going to be a bit more involved than just adding a new build target. Let me take a look and get back to you.

@gotbadger
Copy link
Contributor

gotbadger commented May 3, 2024

Just an update on this as expected just adding the target in go does not work.

 building                                       binary=dist/linux/linux_linux_amd64_v1/bearer
    • took: 1m40s
  ⨯ release failed after 1m48s               error=failed to build for linux_arm64: exit status 1: # runtime/cgo
gcc_arm64.S: Assembler messages:
gcc_arm64.S:30: Error: no such instruction: `stp x29,x30,[sp,'
gcc_arm64.S:34: Error: too many memory references for `mov'
gcc_arm64.S:36: Error: no such instruction: `stp x19,x20,[sp,'
gcc_arm64.S:39: Error: no such instruction: `stp x21,x22,[sp,'
gcc_arm64.S:42: Error: no such instruction: `stp x23,x24,[sp,'
gcc_arm64.S:45: Error: no such instruction: `stp x25,x26,[sp,'
gcc_arm64.S:48: Error: no such instruction: `stp x27,x28,[sp,'
gcc_arm64.S:52: Error: too many memory references for `mov'
gcc_arm64.S:53: Error: too many memory references for `mov'
gcc_arm64.S:54: Error: too many memory references for `mov'
gcc_arm64.S:56: Error: no such instruction: `blr x20'
gcc_arm64.S:57: Error: no such instruction: `blr x19'
gcc_arm64.S:59: Error: no such instruction: `ldp x27,x28,[sp,'
gcc_arm64.S:62: Error: no such instruction: `ldp x25,x26,[sp,'
gcc_arm64.S:65: Error: no such instruction: `ldp x23,x24,[sp,'
gcc_arm64.S:68: Error: no such instruction: `ldp x21,x22,[sp,'
gcc_arm64.S:71: Error: no such instruction: `ldp x19,x20,[sp,'
gcc_arm64.S:74: Error: no such instruction: `ldp x29,x30,[sp],'

This is because we use some C bindings so we cant just use golangs cross compile features.

In theory it should be just a case of installing gcc tooling for arm64 for the linux build step but this doesnt seem to work either

  ⨯ release failed after 59s                 error=failed to build for linux_arm64: exit status 1: # github.com/bearer/bearer/cmd/bearer
/usr/local/go/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/usr/bin/ld: /tmp/go-link-2937251157/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-2937251157/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-2937251157/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-2937251157/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-2937251157/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-2937251157/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-2937251157/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-2937251157/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-2937251157/go.o: Relocations in generic ELF (EM: 183)
/tmp/go-link-2937251157/go.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status

Next step is probably trying to get this to build on a linux/arm64 runner unfortuantly they are not available on github yet so its a bit tricky. Might have to give a QEMU setup a try.

@sixlettervariables
Copy link
Author

Interesting! So if we were to build Bearer on our hosted runner this may be workable?

@gotbadger
Copy link
Contributor

@sixlettervariables yeah using your own binary is probably the best option untill the build tooling is a bit more workable on github and we can get something working.

I've managed to confrim you can actually build on linux/arm64 locally using docker on my M1 Mac so should be all good although there where some warnings:

# CGO_ENABLED=1 go run ./cmd/bearer/bearer.go version
# github.com/smacker/go-tree-sitter/yaml
scanner.cc: In member function 'bool {anonymous}::Scanner::scn_dir_tag_pfx(TSLexer*, TSSymbol)':
scanner.cc:635:9: warning: case label value is less than minimum value for type
         case SCN_FAIL:
         ^~~~
scanner.cc: In member function 'bool {anonymous}::Scanner::scn_tag(TSLexer*, TSSymbol)':
scanner.cc:664:11: warning: case label value is less than minimum value for type
           case SCN_FAIL:
           ^~~~
scanner.cc:674:11: warning: case label value is less than minimum value for type
           case SCN_FAIL:
           ^~~~
bearer version dev, build devSHA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants