Debian Codegraph @

infra/bots/task_drivers/external_client/bazel_build_with_docker.sh

raw
1 #!/bin/bash
2 # Copyright 2023 Google LLC
3 #
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # Run a bazel build command from a specified subdirectory to build a specified target.
8 # Expects 2 params, the subdirectory and the target.
9 #
10 # Why is this needed? We want to be able to test building Skia using our Bazel rules
11 # with an off-the-shelf compiler and toolchain (and not require clients to use our own).
12 #
13 # This assumes it is being run inside a docker container with the following
14 # mount:
15 # /SRC: Base checkout directory
16 #
17 # This script has no outputs
18
19 set -e
20 set -x
21
22 mkdir /tmp/bazelisk_dl
23 pushd /tmp/bazelisk_dl
24 wget -O bazelisk.zip https://chrome-infra-packages.appspot.com/dl/skia/bots/bazelisk_linux_amd64/+/version:0
25 unzip bazelisk.zip
26 popd
27
28 export PATH="/tmp/bazelisk_dl:${PATH}"
29
30 gcc --version
31 cd /SRC/$1
32 bazelisk build $2