-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: self-downloading/installing wrapper script #1491
Comments
Is this not more a thing you would like to do with docker? |
Docker is ideal for remote builds (like a continuous integration machine), but it is a very heavy-weight solution for ordinary developers. It's also not compatible with all environments (e.g. for developers working on Cloud 9 or other hosted environments that are, themselves, running in Docker and, therefore, incapable of running Docker). So I think there is still a reason to desire something like this. |
I swear we had a bug open before to create a gradlew-similar wrapper script for Bazel, but now I can't find it. I think this is a good idea. |
FYI, I've started to sketch out just such a wrapper script: (Feel free to crib from that for going forward). |
FYI, there is also dazel: https://github.com/nadirizr/dazel |
This is still really important, 2 years later. There needs to be a standard way to version bazel itself, like this proposes. |
It won't be sufficient to just download a specific version of Bazel. You will also want to get the rule sets at the versions the Bazel version was tested against. We are thinking about better versioning across core Bazel and the rules, but there may not be anything new for a quarter or so. |
@philwo made a wrapper here: https://github.com/philwo/bazelisk |
While we wait for an officially support solution, this isn't too difficult to implement on your own:
We check this into our git repo with a filename of
|
@ebracho Bazelisk is the "official" solution - it will move into the bazelbuild org, soon. Any reason you didn't consider using it? (Just want to make sure that it's as usable as possible for all of you. :)) |
(Co-worker of @ebracho here) We don't want to rely on github, so we actually reupload bazel binaries into our object store and pull it from there, as our CI system is fairly transient, and we don't want builds to fail just cause of network/github issues. If bazelisk was able to be told a specific url, or ideally even a command to run to pull it, that would probably be a viable solution for us. |
@philwo To add to that, until now I didn't realize that Bazelisk had a python version we could check into our own repo (as opposed to provisioning every environment with an external dependency), which was the main deciding factor. I'm glad to hear that Bazelisk is being adopted as the official solution though! Our script is concise but fairly limited (e.g. no macOS/windows support). |
|
It would be great if there were a wrapper script (let's call it "bazelw") that downloads a specific version (which could be the latest version) of bazel, and executes the given command with the downloaded copy of bazel. I'm thinking of something similar to the gradle wrapper ("gradlew"):
This would make it more palatable to use Bazel in opensource projects, as it would reduce the number of steps required for users to setup their machine. It would also make the build even more reliable by ensuring that a specific version (encoded in the wrapper) is used, rather than whatever version of bazel happens to installed on the user's machine (which may be incompatible with the BUILD/WORKSPACE).
The text was updated successfully, but these errors were encountered: