Skip to content

Commit aa730da

Browse files
authored
Replace raw use of bazel with bazelisk (#2286)
Summary: Replace raw use of bazel with bazelisk Using bazelisk makes it possible to trigger builds against new bazel versions. This will be leveraged as part of migrating to bazel 6.5.0 and later to bazel 7. Relevant Issues: #2282 Type of change: /kind cleanup Test Plan: Build should pass --------- Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 6f57997 commit aa730da

File tree

8 files changed

+23
-22
lines changed

8 files changed

+23
-22
lines changed

docker.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DOCKER_IMAGE_TAG=202508131912
2-
LINTER_IMAGE_DIGEST=db3238ae3ab3f0fe307aef8920a29b5f0df808248c16a1650baa228c4cefbd4c
3-
DEV_IMAGE_DIGEST=42c7f00b68db0835c266c5aceb6f67ec7e43342336f95218af14e19858e08854
4-
DEV_IMAGE_WITH_EXTRAS_DIGEST=bbcd6dc6d269231163be9782d42bdf2b2855a34ab384a853fa67e13e946948ec
1+
DOCKER_IMAGE_TAG=202512082352
2+
LINTER_IMAGE_DIGEST=441fc5a65697dab0b38627d5afde9e38da6812f1a5b98732b224161c23238e73
3+
DEV_IMAGE_DIGEST=cac2e8a1c3e70dde4e5089b2383b2e11cc022af467ee430c12416eb42066fbb7
4+
DEV_IMAGE_WITH_EXTRAS_DIGEST=e84f82d62540e1ca72650f8f7c9c4fe0b32b64a33f04cf0b913b9961527c9e30

tools/chef/base_image_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
202503281433
1+
202512091427

tools/chef/cookbooks/px_dev/attributes/linux.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
default['owner'] = 'root'
2323
default['group'] = 'root'
2424

25-
default['bazel']['download_path'] =
26-
"https://github.com/bazelbuild/bazel/releases/download/6.2.0/bazel-6.2.0-linux-x86_64"
27-
default['bazel']['sha256'] =
28-
'3d11c26fb9ba12c833844450bb90165b176e8a19cb5cf5923f3cec855837f17c'
25+
default['bazelisk']['download_path'] =
26+
"https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-amd64"
27+
default['bazelisk']['sha256'] =
28+
'e1508323f347ad1465a887bc5d2bfb91cffc232d11e8e997b623227c6b32fb76'
2929

3030
default['codecov']['download_path'] =
3131
'https://uploader.codecov.io/v0.2.3/linux/codecov'

tools/chef/cookbooks/px_dev/attributes/mac_os_x.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
default['owner'] = node['current_user']
2424
default['group'] = 'wheel'
2525

26-
default['bazel']['download_path'] =
27-
"https://github.com/bazelbuild/bazel/releases/download/6.2.0/bazel-6.2.0-darwin-x86_64"
28-
default['bazel']['sha256'] =
29-
'd2356012843ce3a2fbba89f88191673a6ad2f7716cc46ad43ec1bcee78d36b44'
26+
default['bazelisk']['download_path'] =
27+
"https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-darwin-amd64"
28+
default['bazelisk']['sha256'] =
29+
'8fcd7ba828f673ba4b1529425e01e15ac42599ef566c17f320d8cbfe7b96a167'
3030

3131
default['codecov']['download_path'] =
3232
'https://uploader.codecov.io/v0.2.3/macos/codecov'

tools/chef/cookbooks/px_dev/recipes/linters.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
action :create
4848
end
4949

50-
common_remote_bin 'bazel' do
51-
bin_name 'bazel_core'
50+
common_remote_bin 'bazelisk' do
51+
bin_name 'bazelisk'
5252
end
5353

5454
if platform_family?('debian')

tools/chef/cookbooks/px_dev/templates/bazel.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# * Adds a --config=clang by default if it's missing from the command line.
2020
# Check if this is this pixie repo, otherwise just passthrough to bazel_core.
2121
if ! grep 'workspace(name\s=\s"px")' "$(git rev-parse --show-toplevel 2> /dev/null)/WORKSPACE" &> /dev/null; then
22-
/opt/px_dev/bin/bazel_core "$@"
22+
/opt/px_dev/bin/bazelisk "$@"
2323
exit $?
2424
fi;
2525

@@ -36,4 +36,4 @@ fi;
3636
cmd=$1
3737
shift
3838

39-
/opt/px_dev/bin/bazel_core ${cmd:+"$cmd"} ${config:+"$config"} "$@"
39+
/opt/px_dev/bin/bazelisk ${cmd:+"$cmd"} ${config:+"$config"} "$@"

tools/chef/cookbooks/px_dev_extras/attributes/default.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#
1515
# SPDX-License-Identifier: Apache-2.0
1616

17-
default['bazel']['zsh_completions'] =
18-
"https://raw.githubusercontent.com/bazelbuild/bazel/6.0.0/scripts/zsh_completion/_bazel"
19-
default['bazel']['zcomp_sha256'] = '4094dc84add2f23823bc341186adf6b8487fbd5d4164bd52d98891c41511eba4'
17+
# Fetch bazel version from Pixie's .bazelversion on main branch
18+
bazel_version = Chef::HTTP.new('https://raw.githubusercontent.com').get('/pixie-io/pixie/main/.bazelversion').strip
19+
default['bazel']['zsh_completions'] =
20+
"https://raw.githubusercontent.com/bazelbuild/bazel/#{bazel_version}/scripts/zsh_completion/_bazel"

tools/chef/cookbooks/px_dev_extras/recipes/default.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343
remote_file '/usr/local/share/zsh/site-functions/_bazel' do
4444
source node['bazel']['zsh_completions']
45-
mode 0644
46-
checksum node['bazel']['zcomp_sha256']
45+
mode '0644'
46+
action :create
4747
end
4848

4949
common_remote_bin 'faq'

0 commit comments

Comments
 (0)