Skip to content

Conversation

@mikn
Copy link

@mikn mikn commented Jun 4, 2025

I hit this issue and spent a lot of confused time figuring out why it didn't work (this was using ARC runners with the default docker images). Thought I may do everyone else a favour and fix it.

  • Add automatic bazelisk installation when no version is specified and neither bazel nor bazelisk is available
  • Fixes issue where users on self-hosted runners would get no clear notification when bazelisk wasn't installed

Fixes: #78

  - Add automatic bazelisk installation when no version is specified and neither bazel nor bazelisk is available
  - Fixes issue where users on self-hosted runners would get no clear notification when bazelisk wasn't installed

Fixes: bazel-contrib#78
return
}
core.info('No bazelisk-version specified and bazel/bazelisk not found. Installing bazelisk v1.26.0.')
config.bazeliskVersion = 'v1.26.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think if we use 1.x instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put in a specific version (the latest one) to avoid you getting potential bug reports for new behaviour if they release a new version that's broken or similar. They're usually very annoying to chase down. But if you trust upstream's release process enough to not land you in that situation, I can definitely change it. :)

return true
} catch (error) {
try {
await exec.exec('bazel', ['version'], { silent: true })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be picky, but this would actually start downloading the bazel and extracting it. Maybe we should instead use which bazel and Windows-equivalent to avoid expensive download/extract operations.

@p0deje
Copy link
Member

p0deje commented Sep 30, 2025

@mikn It would be great to merge this PR, any chance you can address my comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check whether bazelisk installed

2 participants