bazelbuild / bazelbuild/bazelisk

.bazelversion not being read in parent directory outside of WORKSPACE

Open
#523 5 comments 4 reactions 0 assignees View on GitHub
P2 type:bug
Dominant language
Go
Stars
2.7k
Forks
424
PR merge metrics
No merged PRs in 30d

Description

Hi wonderful bazelisk folks,

First and foremost, thanks for a stupendous launcher. Bazelisk is really valuable and I really appreciate all the work you've done here.

I'm writing in to report a bug--or at least an instance where the docs are inconsistent with bazelisk's behavior.

The readme says:
> Otherwise, if a .bazelversion file exists in the current directory or recursively any parent directory, it will read the file and use the version specified in it.

but Bazelisk seems to stop that search at a workspace boundary rather than *any* parent directory.

I think the documented behavior is probably the more desirable one. Projects often have a nested test workspace, and it'd be nice to inherit from the parent workspace. At least that was true of https://github.com/Neargye/magic_enum, where this was causing confusion. And I'd imagine any hardcoding of WORKSPACE files might need updating with the bzlmod changes, where a WORKSPACE file is no longer required. (But there might be other good reasons for the other behavior! In that case, the docs could use a change.)

Thanks so much for all you do,
Chris
(ex-Googler)

Contributor guide

Open the contributing guide

Research direction

Start with the README statement about searching for .bazelversion in parent directories and trace Bazelisk's workspace-boundary behavior. Determine whether the implementation or documentation should change, then verify that nested workspaces and the documented parent-directory search agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.