Replies: 4 comments 6 replies
-
Offline ModeHow is it different from Are you expecting the offline cache to be checked into version control or no? Vendor modeI guess this would be similar to In that case, I would expect similar behavior to My question is: how would these modes interact with an external registry available? |
Beta Was this translation helpful? Give feedback.
-
How would vendor mode deal with repos that contain non-source files, such as JAR files, SDKs or repos used to cache fetches of other repos? None of that is a problem for offline mode, but not all repos may qualify for being checked into VCS. |
Beta Was this translation helpful? Give feedback.
-
The things I would like to do (in no particular order): 1. cache downloaded archives to an arbitrary path This can be outside of bazel tree (that is, neither external or vendor) so that I can centrally manage external repositories for all my projects. I may have an organization private git repo which contains archives that our security team has examined and allowed. It would have different write permissions than the project repos. To use one of these I might have a WORKSPACE rule like
I don't know of a 2. No. 1, but with the archive expanded to files Think of this like Google's 3. Easy module pinning I should be able to specify in
bzlmod behavior must be so that I always get my version, regardless of how they are ordered. |
Beta Was this translation helpful? Give feedback.
-
Yes, I would prefer Bazel to automatically update vendored dependencies for local development to avoid hard to debug issues due to a mismatch. But, I would like to configure CI such that out-of-date vendored dependencies cause a failure. As I understand it, this corresponds to the currently intended default behavior.
A use-case for offline mode: Preload all dependencies onto a developer's machine so that builds can succeed later on even if the machine is no longer connected to the internet. Importantly, this should be robust against changes: I should not be able to irrevocably break offline mode by editing source files. E.g. if I change a remote dependency version and attempt a build, which fails due to missing network connection, and I then undo my changes and attempt the build again, then the build should still work. Bazel should not have discarded the cached dependencies in the meantime. |
Beta Was this translation helpful? Give feedback.
-
Hi Bazel Community!
I wanted to discuss two exciting new features we're planning to introduce in Bzlmod - Offline Mode and Vendor Mode. Before we proceed with the implementation, I'd love to gather your insights and expectations.
Offline Mode will enable Bzlmod to download and cache dependencies locally, making builds independent of internet access.
Vendor Mode allows users to vendor their dependencies by specifying a cache path under their source tree.
Now, I'd like to hear from you about what you expect to happen in the following scenario:
Imagine you have this code that generates a repo called
hello
and then you vendor it under a specific foldervendor
extension.bzl:
MODULE.bazel
After vendoring you make a change to the extension.bzl file:
ctx.file("BUILD", "filegroup(name='sea')")
When you try to build this repo using
@hello
, in this case the default behavior for Bazel will be to detect the updated version and use it. Unless you specify the--nofetch
flag, then this will result in an error, prompting to re-vendor your packages.We are currently working on a proposal document for these features that will soon be shared with you. Your valuable input will help ensuring these features best suits your needs.
Looking forward to an insightful discussion!
Beta Was this translation helpful? Give feedback.
All reactions