Skip to content

Releases: aspect-build/bazel

Aspect patches for bazel 4.0.0

12 Aug 21:01
Compare
Choose a tag to compare

Based on the bazelbuild/bazel 4.0.0 tag
https://github.com/bazelbuild/bazel/releases/tag/4.0.0

This is released from the aspect-4.0.0 branch in this repo.
Therefore the delta between the upstream Bazel release and ours is
4.0.0...aspect-4.0.0

We do this because our clients need some fixes and cannot wait for the long journey of getting Google to merge changes and release them.

To publish a new binary:

Checkout the HEAD of aspect-4.0.0 branch.

Amend the bazel docker container with a layer that adds a user ID matching yours.

Needed to avoid python2 KeyError: 'getpwuid(): uid not found: 1000

$ cat Dockerfile 
FROM l.gcr.io/google/bazel:latest
RUN echo "alexeagle:x:1000:1000:Alex Eagle,,,:/home/alexeagle:/bin/bash" >> /etc/passwd

build that docker container to run bazel in it with docker build . -t bazel_with_uid

set arguments

docker_args=(
    -v "$PWD":/workspace
    -v /tmp/build_output:/tmp/build_output
    -v /var/run/docker.sock:/var/run/docker.sock
    -v "$HOME/.npm:/home/.npm"
    -w /workspace
    -e USER="$(id -u)"
    -u="$(id -u)"
    -e HOME=/home
    -p 3000:3000
)

build bazel

docker run "${docker_args[@]}" bazel_with_uid --output_user_root=/tmp/build_output build -c opt --stamp src:bazel

then copy the resulitng
/tmp/build_output/eab0d61a99b6696edb3d2aff87b585e8/execroot/io_bazel/bazel-out/k8-opt/bin/src/bazel