-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Make sure offline build can be achieved with vendor mode and the new lockfile format #22554
Comments
Another question, should we vendor local registry at |
I find the hash scheme to be unnecessarily opaque as most registries will probably be hosted under purely lowercase URLs. I would be in favor of a scheme that preserve lowercase URLs as they are, similar to the Go module path escape scheme which escapes Since unconstrained URL hosts and paths can contain exclamation marks, we could use another character prohibited by https://www.ietf.org/rfc/rfc3986.txt but widely supported according to https://en.wikipedia.org/wiki/Filename#Problematic_characters, which leaves one of
I would say no. If users want to vendor them, they can move them to a workspace relative path. |
Indeed it's opaque, but I think we'll have upper case in registry URL more often than we hope, for example, they can show up in GitHub org name or repo name. However, I do think having conflicts due to case or port number will be very rare overall. How about we just throw an error and let the user deal with it? If
SGTM |
I agree, in the case of a public suffix domain its single owner can avoid collisions and in the case of a content hoster such as GitHub, collisions are more likely to arise due to typo squatting than intentionally. |
- Vendor registry files needed for Bazel module resolution to achieve offline build with vendor mode. - Also refactored bazel_vendor_test to avoid vendoring dependencies of bazel_tools, which speeds up the test significantly. Fixes bazelbuild#22554
- Vendor registry files needed for Bazel module resolution to achieve offline build with vendor mode. - Also refactored bazel_vendor_test to avoid vendoring dependencies of bazel_tools, which speeds up the test significantly. Fixes bazelbuild#22554
- Vendor registry files needed for Bazel module resolution to achieve offline build with vendor mode. - Also refactored bazel_vendor_test to avoid vendoring dependencies of bazel_tools, which speeds up the test significantly. Fixes bazelbuild#22554
- Vendor registry files needed for Bazel module resolution to achieve offline build with vendor mode. - Also refactored bazel_vendor_test to avoid vendoring dependencies of bazel_tools, which speeds up the test significantly. Fixes bazelbuild#22554
- Vendor registry files needed for Bazel module resolution to achieve offline build with vendor mode. - Also refactored bazel_vendor_test to avoid vendoring dependencies of bazel_tools, which speeds up the test significantly. Fixes bazelbuild#22554
- Vendor registry files needed for Bazel module resolution to achieve offline build with vendor mode. - Also refactored bazel_vendor_test to avoid vendoring dependencies of bazel_tools, which speeds up the test significantly. Fixes bazelbuild#22554 Closes bazelbuild#22566. PiperOrigin-RevId: 641246903 Change-Id: I01a78612ad7ca454df2c70dc5dcc38ec2fbfb71c
Description of the feature request:
Vendor mode is being implemented at #19563, while the new lockfile format landed in #22154
We need to make sure vendor mode can actually vendor everything needed to achieve offline build easily. The new lockfile format contains less information than before and requires us to vendor more things.
Which category does this issue belong to?
No response
What underlying problem are you trying to solve with this feature?
With the new lockfile format, the bazel module graph is no longer stored in the lockfile, which means we need to do module resolution every time after a server restart. Although the resolution is fast, but it means we'll have to access the internet to fetch
MODULE.bazel
andsource.json
files even with required repositories being vendored.To make sure a clean build without any download cache works offline, we'll need to vendor the registry files under the vendor directory besides the external repo sources.
Proposed solutions
1. Vendor with the similar layout of
mirror.bazel.build
So a registry URL like
is stored at a path like
However, there could be special characters in the URL:
my.company.com:8080
, which is not a valid directory name on Windows.my.company.com/REGISTRY
vsmy.company.com/registry
. This might cause conflicts on case-insensitive file systems.2. Hash the registry URL
We could use a truncated sha256 hash as directory name for each registry, since we can be sure the normal registry paths like
modules/foo/1.0/MODULE.bazel
won't have above problems. We could add a README.md file to indicate which registry was cached.The vendored source would look like
Which operating system are you running Bazel on?
linux, macos, windows
What is the output of
bazel info release
?HEAD
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: