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

goma-linux-arm64.tgz contains x86-64 binaries, not arm64 #532

Closed
jtbandes opened this issue Dec 19, 2023 · 2 comments
Closed

goma-linux-arm64.tgz contains x86-64 binaries, not arm64 #532

jtbandes opened this issue Dec 19, 2023 · 2 comments

Comments

@jtbandes
Copy link

I'm trying to build electron on an Ubuntu 22.04 arm64 machine and running into errors because the goma download for arm64 is not actually an arm64 binary. I've described more of my workflow in depth in another ticket, but copying some details from electron/electron#40790 (comment) here:

Operating System

Ubuntu 22.04 arm64

Expected Behavior

Goma is able to run on arm64 linux

Actual Behavior

Running e build downloads https://dev-cdn.electronjs.org/goma-clients/5d1c3bf476097de6db9176e4d88ad3549661c1544bdc14a1701fa46fd70df2e2/goma-linux-arm64.tgz.

All of the binaries contained in this archive except http_proxy are actually x86-64 binaries:

$ file goma/*
goma/LICENSE:              ASCII text, with very long lines (460)
goma/android:              directory
goma/c++:                  ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/cc:                   ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/clang:                ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/clang++:              ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/compiler_proxy:       ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/compiler_proxy.sym:   ASCII text
goma/diagnose_goma_log.py: Python script text executable, ASCII text
goma/g++:                  ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/gcc:                  ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/goma_auth:            Bourne-Again shell script text executable, ASCII text
goma/goma_auth.py:         Python script text executable, ASCII text
goma/goma_ctl.py:          Python script text executable, ASCII text
goma/goma_fetch:           ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/gomacc:               ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/gomacc.sym:           ASCII text, with very long lines (459)
goma/http_proxy:           ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=K-woq5CZne0U5XSNMDJ_/iQ5M21D2UtoIi7za53Mu/GgEGuv8yPVGho7rMpQrZ/R2yC_7q76GX_oJoa9jwE, with debug_info, not stripped
goma/javac:                ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
goma/report_env.sh:        POSIX shell script text executable, ASCII text
goma/sha256.json:          JSON data

Running gomacc results in cannot execute binary file: Exec format error.

To Reproduce

$ wget https://dev-cdn.electronjs.org/goma-clients/5d1c3bf476097de6db9176e4d88ad3549661c1544bdc14a1701fa46fd70df2e2/goma-linux-arm64.tgz
$ tar -xvf goma-linux-arm64.tgz
$ goma/gomacc 
bash: goma/gomacc: cannot execute binary file: Exec format error

Full build workflow (running in GitHub Actions on an Ubuntu 22.04 arm64 runner from BuildJet):

    steps:
      - uses: actions/checkout@v4.1.1
      - uses: actions/setup-node@v4.0.0
        with:
          node-version: 20

      # setup-python does not support linux arm64: https://github.com/actions/setup-python/issues/108
      - run: sudo apt-get update && sudo apt-get install python3 python3-pip

      - run: |
          sudo apt-get update && sudo apt-get install \
            build-essential \
            clang \
            libdbus-1-dev \
            libgtk-3-dev \
            libnotify-dev \
            libasound2-dev \
            libcap-dev \
            libcups2-dev \
            libxtst-dev \
            libxss1 \
            libnss3-dev \
            gcc-multilib \
            g++-multilib \
            curl \
            gperf \
            bison \
            python3-dbusmock \
            openjdk-8-jre
      - run: npm i -g @electron/build-tools@1.1.0
      - run: e init foxglove-builder --import release
      - run: e sync --revision v27.1.3
      - run: echo 'target_cpu = "arm64"' >> electron/src/electron/build/args/all.gn
      - run: e build
      - run: electron/src/electron/script/strip-binaries.py -d electron/src/out/Release
      - run: e build electron:dist
@codebytere
Copy link
Member

This is unfortunately a fundamental support issue, not a bug. There is no cipd support for Linux except on amd64: https://chrome-infra-packages.appspot.com/p/infra/goma/client. We can add documentation for this but it's not something we can fix on our end, especially given Goma is disappearing upstream.

@codebytere codebytere closed this as not planned Won't fix, can't repro, duplicate, stale Dec 31, 2023
@jtbandes
Copy link
Author

Thanks for the reply. If the configuration is not supported, it would help to have a clearer error message earlier in the process if possible, rather than failing with an obscure error like this mid-build.

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

2 participants