-
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
pre-fetch all dependencies for build envs without network #5175
Comments
First of all, I'm well aware that bazel's story for external dependencies is not in good shape. (Historically, bazel was used within google where all dependencies are in the one single repository, so external dependencies have been added as an after-thought.) We're working on it, but it is a long way to go, given all the quick hacks that have been added before a systematic approach was attempt. Also, the tendency of a lot projects to insist on building all dependencies themselves is unfortunate, but probably also motivated by that historical background. Concerning your question, a simply
So, most probably a patching of the Besides using
But, in summary: no, there is no supported use case of "just fetch everything and cache it". An unsupported way is to build and then look into the Given the even more urgent problems we currently have with external dependencies, I also doubt that a satisfying solution will happen soon. Sorry for not having any better news. I hope you can get along with one of the work-arounds described. |
@AheliG, thanks a lot for your detailed reply. I will look into it again and provide feedback here. |
https://bazel-review.googlesource.com/c/bazel/+/56490 shows how a set of dependencies can be fetched and put into an archive. d703a5e added a new option Also, it doesn't help the underlying problem that projects like to bundle random snapshots of random other projects; but it is not the task of a build system to change upstream's development model. |
The option --experimental_distdir has been introduced 4 months ago and was completely unproblematic ever since. Moreover, it is now used productively, both in our own bootstrapping process[1], as well as in external packaging of projects using bazel[2]. So make this option non-experimental. We still keep the old name as an alternative to not break existing uses. Related: #5175. RELNOTES: The --distdir option is no longer experimental. This option allows to specify additional directories to look for files before trying to fetch them from the network. Files from any of the distdirs are only used if a checksum for the file is specified and both, the filename and the checksum, match. [1] Commit 3c9cd82 [2] https://github.com/gentoo/gentoo/blob/7379cdb578b0c070c846c3fa9f71470e2c5d1320/sci-libs/tensorflow/tensorflow-1.8.0-r1.ebuild#L168 Change-Id: I536238f9bdbad6b4f7222b4f6a1464d70d9f3be3 PiperOrigin-RevId: 199637265
Make all external repositories depend on an additional SkyValue controllable via commands, so support unconditional fetching of all external repositories, as it is needed by the the `sync` command. Improves on #5175, provides a work around for #4907. Change-Id: I30033614c1a2fad3f1363b85ff69cf92f697c255 PiperOrigin-RevId: 200543985
Make all external repositories depend on an additional SkyValue controllable via commands, so support unconditional fetching of all external repositories, as it is needed by the the `sync` command. Improves on bazelbuild#5175, provides a work around for bazelbuild#4907. Change-Id: I30033614c1a2fad3f1363b85ff69cf92f697c255 PiperOrigin-RevId: 200543985
The option --experimental_distdir has been introduced 4 months ago and was completely unproblematic ever since. Moreover, it is now used productively, both in our own bootstrapping process[1], as well as in external packaging of projects using bazel[2]. So make this option non-experimental. We still keep the old name as an alternative to not break existing uses. Related: bazelbuild#5175. RELNOTES: The --distdir option is no longer experimental. This option allows to specify additional directories to look for files before trying to fetch them from the network. Files from any of the distdirs are only used if a checksum for the file is specified and both, the filename and the checksum, match. [1] Commit 3c9cd82 [2] https://github.com/gentoo/gentoo/blob/7379cdb578b0c070c846c3fa9f71470e2c5d1320/sci-libs/tensorflow/tensorflow-1.8.0-r1.ebuild#L168 Change-Id: I536238f9bdbad6b4f7222b4f6a1464d70d9f3be3 PiperOrigin-RevId: 199637265
Make all external repositories depend on an additional SkyValue controllable via commands, so support unconditional fetching of all external repositories, as it is needed by the the `sync` command. Improves on bazelbuild#5175, provides a work around for bazelbuild#4907. Change-Id: I30033614c1a2fad3f1363b85ff69cf92f697c255 PiperOrigin-RevId: 200543985
According to google/gvisor#31 (comment) the issue has been resolved. Thank you very much! |
@vrothberg According to google/gvisor#31 (comment) the issue is being worked on, with a reference to this issue here. So I think it's not resolved, at least that doesn't follow from that comment. |
This is a follow-up discussion from the newly introduced gvisor project: google/gvisor#31
The problem context is that most Linux distributions (in my case openSUSE/SUSE) disable network connections when building a package (e.g., with https://openbuildservice.org/). Fetching external dependencies at build-time, however, is an integral part of Bazel, which, in my humble opinion, may explain why many distributions do not yet package Bazel. For some projects that are build with Bazel, we could find workarounds, but the more dependencies a project has the more complicated is the process to untangle the deps.
The problem I am trying to solve to package gvisor is to pre-fetch all dependencies of gvisor into a specific folder in order to subsequently compress them into tar ball, which can then be used in the build context (no network). In order to do so, I made use of the
--repository_cache
option (for both, fetch and build), but did not succeed as Bazel was still missing some dependencies. Hence the question: Is this a supported use-case, and if, how can I make it work?The text was updated successfully, but these errors were encountered: