Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Commit

Permalink
Use bazelisk and Bazel 5.1.1
Browse files Browse the repository at this point in the history
https://github.com/bazelbuild/bazel/releases/tag/5.1.1

This release contains an important fix for remote execution:
bazelbuild/bazel#15181

The PATH environment variable needs to be included for linux, or else
`bazel run` commands will fail to find `bash` in order to run
executables. A future change will remove explicit passing of environment
variables.

Bazelisk expects to find the LocalAppData environment variable for where
to store Bazel downloads. This had to be added for Bazelisk to work.

Bug: n/a
Test: n/a
Change-Id: I5ff925eef37c3648ee10e49f90ae2b846266a7a5
  • Loading branch information
Tom Renn committed Apr 11, 2022
1 parent b06930f commit e5a3b22
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bazel/bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ def main():
else:
sys.exit('Platform %s is not yet supported.' % sys.platform)

env = {}
env['USE_BAZEL_VERSION'] = os.environ.get('USE_BAZEL_VERSION', '5.1.1')
bazel = os.path.join(workspace, 'prebuilts', 'tools', platform, 'bazel',
'bazel-real')
'bazelisk')
args = sys.argv[1:]
command = bazel_command(args)

env = {}
env['TERM'] = os.environ.get('TERM', '')
env['MAVEN_FETCH'] = os.environ.get('MAVEN_FETCH', '')
env['SHELL'] = os.environ.get('SHELL', '')
env['HOME'] = os.environ.get('HOME', '')
env['DISPLAY'] = os.environ.get('DISPLAY', '')
env['GOOGLE_APPLICATION_CREDENTIALS'] = os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', '')
env['PATH'] = os.environ.get('PATH','')
if 'QA_ANDROID_SDK_ROOT' in os.environ:
env['QA_ANDROID_SDK_ROOT'] = os.environ['QA_ANDROID_SDK_ROOT']
if sys.platform == 'darwin':
Expand Down Expand Up @@ -71,9 +73,9 @@ def main():
# will hang.
env['SYSTEMROOT'] = 'C:\\Windows'
env['TMP'] = os.environ.get('TMP','')
env['PATH'] = os.environ.get('PATH','')
env['USERPROFILE'] = os.environ.get('USERPROFILE', '')
env['APPDATA'] = os.environ.get('APPDATA', '')
env['LOCALAPPDATA'] = os.environ.get('LOCALAPPDATA', '')

else: # Linux
env['CC'] = os.environ.get('GCC', '/usr/bin/gcc')
Expand Down

0 comments on commit e5a3b22

Please sign in to comment.