bazelbuild / bazelbuild/bazel

Bootstrapping Bazel in Alpine+ARM hangs forever

Open
#17,220 13 comments 0 reactions 0 assignees View on GitHub
help wanted P3 team-OSS type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description of the bug:

Hi there, awhile ago I opened: https://github.com/bazelbuild/bazel/issues/16484

I was able to get around the issue by running the container on an x86 Linux machine. I am now trying to do the same thing with aarch64. I assumed the issue was exclusive to Docker just being bad on Mac; however, I am running into the same issue on EC2. I've tried various versions of Alpine and Bazel (5.3, 6.0) with no success. This is what I run to bootstrap:

I've tried this on these EC2 AMIs, as well as on a Raspberry Pi with Alpine 3.16 installed:

- `alpine-ami-3.14.2-aarch64-r0 ami-00604621aea32b1f5`
- `alpine-3.16.0-x86_64-bios-cloudinit-r0 ami-0c9f21a3f1772d2d8`

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

This is what I've been using to bootstrap:

```
export BAZEL_VERSION="5.3.0" \
BAZEL_SHA256SUM="ee801491ff0ec3a562422322a033c9afe8809b64199e4a94c7433d4e14e6b921 bazel-5.3.0-dist.zip" \
JAVA_HOME="/usr/lib/jvm/default-jvm"

apk update && apk upgrade && \
apk add --no-cache python3 py3-pip python3-dev && \
apk add --no-cache libstdc++ openjdk11 && \
apk add --no-cache bash curl git wget && \
apk add --no-cache musl-dev make libexecinfo libexecinfo-dev && \
apk add --no-cache coreutils gcc g++ linux-headers unzip zip && \
apk add --no-cache automake gcc subversion && \
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip && \
echo ${BAZEL_SHA256SUM} | sha256sum --check && \
unzip bazel-${BAZEL_VERSION}-dist.zip && \
EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" bash ./compile.sh && \
cp ${DIR}/output/bazel /usr/local/bin/ && \
rm -rf ${DIR}
```

### Which operating system are you running Bazel on?

Alpine

### What is the output of `bazel info release`?

n/a

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

See above

### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?

_No response_

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

Most of the time is just hangs at:

```
🍃 Building Bazel from scratch......
🍃 Building Bazel with Bazel.
.
```

Or something like `patching repository` for one of the first few packages

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported bootstrap command on Alpine aarch64, using compile.sh from the downloaded Bazel distribution and the listed Java and package setup. Observe whether the build hangs during “Building Bazel with Bazel” or repository patching, then trace that stage to identify the cause. Done means bootstrapping completes successfully on the reported Alpine aarch64 environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, java, linux
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.