Bazel: cannot execute binary file: Exec format error

Created on 24 Oct 2018  路  3Comments  路  Source: bazelbuild/bazel

Description of the problem / feature request:

I have tried to install bazel multiple times following these steps:
1)sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python
2)downloading https://github.com/bazelbuild/bazel/releases/download/0.18.0/bazel-0.18.0-installer-darwin-x86_64.sh
3) chmod +x bazel-0.18.0-installer-linux-x86_64.sh
./bazel-0.18.0-installer-linux-x86_64.sh --user
4)export PATH="$PATH:$HOME/bin

bazel version outputs following error
/home/ai/bin/bazel: line 88: /home/ai/.bazel/bin/bazel-real: cannot execute binary file: Exec format error
/home/ai/bin/bazel: line 88: /home/ai/.bazel/bin/bazel-real: Success

Feature requests: what underlying problem are you trying to solve with this feature?

I would like to use bazel for testing

What operating system are you running Bazel on?

Linux ai-VirtualBox 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

What's the output of bazel info release?

/home/ai/bin/bazel: line 88: /home/ai/.bazel/bin/bazel-real: cannot execute binary file: Exec format error
/home/ai/bin/bazel: line 88: /home/ai/.bazel/bin/bazel-real: Success

team-Bazel support / not a bug (process) untriaged

Most helpful comment

Can you verify that you really used https://github.com/bazelbuild/bazel/releases/download/0.18.0/bazel-0.18.0-installer-darwin-x86_64.sh on a Linux box?
That will certainly not work. The executable would be for Mach, not Linux.
The instructions for install on Linux are here
https://docs.bazel.build/versions/master/install-ubuntu.html

All 3 comments

Can you verify that you really used https://github.com/bazelbuild/bazel/releases/download/0.18.0/bazel-0.18.0-installer-darwin-x86_64.sh on a Linux box?
That will certainly not work. The executable would be for Mach, not Linux.
The instructions for install on Linux are here
https://docs.bazel.build/versions/master/install-ubuntu.html

thank you!

Oh... I forgot to open Python... smh... THANKS!!!

Was this page helpful?
0 / 5 - 0 ratings