Git Product home page Git Product logo

Comments (5)

tirsen avatar tirsen commented on June 11, 2024 5

We're using bzlmod and instead of a WORKSPACE file we have a WORKSPACE.bzlmod file. It was really hard to understand why .bazelversion wasn't being used. Either .bazelversion should be used without a WORKSPACE file or WORKSPACE.bzlmod should also be or this should be clearly stated in the documentation. The current state of things is quite confusing.

from bazelisk.

ian-h-chamberlain avatar ian-h-chamberlain commented on June 11, 2024 1

@philwo – I seem to have a use case for this. In my organization we use a strictly pinned version of bazel and so most of the organization has no need for a .bazelversion file. However, I would like to set for myself (e.g. in ~/.bazelversion) a default version, while still creating specific workspaces with their own version (e.g. ~/my/workspace/.bazelversion).

I can get around this with USE_BAZEL_VERSION but since it takes precedence over .bazelversion I don't have a great option to support multi-version for personal workspaces (with .bazelversion) vs shared workspaces (without .bazelversion).

From README.md:

  • 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.

It would be nice if at least the documentation was updated to indicate the behavior, since there is no mention of the WORKSPACE file in the README.

from bazelisk.

philwo avatar philwo commented on June 11, 2024

I think we can change the logic to check for .bazelversion files from the current working directory up to the workspace root, but I'm not really sure what the use case is.

Except for bazel help or bazel version you can't do anything without a WORKSPACE file - not even bazel info:

$ bazel info
ERROR: The 'info' command is only supported from within a workspace (below a directory having a WORKSPACE file).
See documentation at https://docs.bazel.build/versions/master/build-ref.html#workspace

Could you explain a bit more why you'd need this?

from bazelisk.

philwo avatar philwo commented on June 11, 2024

@bmuschko Friendly ping - I'm curious about your use case for this. :)

from bazelisk.

bmuschko avatar bmuschko commented on June 11, 2024

@philwo When I opened the issue, I didn't realize that a WORKSPACE is pretty much required no matter what as I was very new to Bazel. IMHO it's not a use case. ;-)

from bazelisk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.