hijack bazel invocations in grpc workspace

pull/19249/head
Jan Tattermusch 6 years ago
parent cd807e4ecd
commit a64ddff19c
  1. 26
      tools/bazel
  2. 11
      tools/remote_build/README.md

@ -19,17 +19,21 @@
# supported version, and then calling it. This way, we can make sure
# that running bazel will always get meaningful results, at least
# until Bazel 1.0 is released.
# NOTE: This script relies on bazel's feature where //tools/bazel
# script can be used to hijack "bazel" invocations in given workspace.
set -e
VERSION=0.24.1
CWD=`pwd`
echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation."
CWD=$(pwd)
BASEURL=https://github.com/bazelbuild/bazel/releases/download/
cd `dirname $0`
TOOLDIR=`pwd`
cd "$(dirname "$0")"
TOOLDIR=$(pwd)
case `uname -sm` in
case $(uname -sm) in
"Linux x86_64")
suffix=linux-x86_64
;;
@ -37,17 +41,17 @@ case `uname -sm` in
suffix=darwin-x86_64
;;
*)
echo "Unsupported architecture: `uname -sm`"
echo "Unsupported architecture: $(uname -sm)"
exit 1
;;
esac
filename=bazel-$VERSION-$suffix
filename="bazel-$VERSION-$suffix"
if [ ! -x $filename ] ; then
curl -L $BASEURL/$VERSION/$filename > $filename
chmod a+x $filename
if [ ! -x "$filename" ] ; then
curl -L "$BASEURL/$VERSION/$filename" > "$filename"
chmod a+x "$filename"
fi
cd $CWD
$TOOLDIR/$filename $@
cd "$CWD"
"$TOOLDIR/$filename" $@

@ -17,27 +17,22 @@ and tests run by Kokoro CI.
## Running remote build manually from dev workstation
*At the time being, tools/bazel.sh is used instead of invoking "bazel" directly
to overcome the bazel versioning problem (our BUILD files currently only work with
a specific window of bazel version and bazel.sh wrapper makes sure that version
is used).*
Run from repository root (opt, dbg):
```
# manual run of bazel tests remotely on Foundry
tools/bazel.sh --bazelrc=tools/remote_build/manual.bazelrc test --config=opt //test/...
bazel --bazelrc=tools/remote_build/manual.bazelrc test --config=opt //test/...
```
Sanitizer runs (asan, msan, tsan, ubsan):
```
# manual run of bazel tests remotely on Foundry with given sanitizer
tools/bazel.sh --bazelrc=tools/remote_build/manual.bazelrc test --config=asan //test/...
bazel --bazelrc=tools/remote_build/manual.bazelrc test --config=asan //test/...
```
Run on Windows MSVC:
```
# RBE manual run only for c-core (must be run on a Windows host machine)
tools/bazel.sh --bazelrc=tools/remote_build/windows.bazelrc build :all [--credentials_json=(path to service account credentials)]
bazel --bazelrc=tools/remote_build/windows.bazelrc build :all [--credentials_json=(path to service account credentials)]
```
Available command line options can be found in

Loading…
Cancel
Save