-
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
Recursive WORKSPACE file loading #1943
Comments
#1943 -- Change-Id: Ic7b4378acb4d3661a1b61ff887c9cc8592df9f7e Reviewed-on: https://bazel-review.googlesource.com/c/6131/ MOS_MIGRATED_REVID=136154990
Drive by review. I love watching the amazing work you do @kchodorow. This seems like a potential solution for #1550. You're tackling a very difficult problem. Many people have tried to solve this problem and only introduced new ones. One of Bazel's virtues is that it's held off on trying to solve this so far until it can come up with a solution it knows is going to be awesome. I'd like to help you find that solution.
The PNG files seems to be broken in https://github.com/bazelbuild/bazel/blob/master/site/designs/_posts/2016-09-19-recursive-ws-parsing.md so it's not clear to me yet how this is going to work.
I want to only pay for the dependencies I use. If I depend on A lot of people have opinions on this topic, as you know. I'm sure you hear user complaints all the time about why Bazel can't solve all their problems without them having to do additional work. Allow me to counteract some of those opinions by saying this. I don't care if Bazel is convenient. I don't care if it's easy. I just care that it's performant, minimal, deterministic, reproducible, and correct (PMDRC). Even if that means I'm configuring my build on the hardest difficulty setting. I like difficult things, as long as I'm reaping significant benefits from that difficulty. This level of high precision professionalism is what sets Bazel apart from many other build systems, which play fast and loose with dependencies. I also believe that once we figure out how to make our builds PMDRC, then we can add abstractions later that make PMDRC easy. |
Sorry, missed this comment! Thanks for the props, commit in progress to fix the images.
I've read the internal doc on it :) I'm not really trying to solve the problem, fwiw. The tl;dr of that design doc is:
There's also some cool strictness stuff we'll be doing, like only allowing external dependencies that have been declared in that WS (so @x can't use @y unless it's declared in x's WS file).
We're not doing that! They'll be downloaded as-needed, as it is today. |
Somehow they were all uploaded as 0 bytes, but that's okay because the URLs in the design doc were wrong, anyway. Relavant design doc: https://bazel.build/designs/2016/09/19/recursive-ws-parsing.html, issue #1943. -- PiperOrigin-RevId: 145799866 MOS_MIGRATED_REVID=145799866
*** Reason for rollback *** The go rules have tons of transitive dependencies that are not declared in their "local" WORKSPACE files, so this broke lots of projects on ci.bazel.build I'll fix up the go rules, update all of _their_ reverse-dep projects, and resubmit. *** Original change description *** Repositories can only be accessed in projects that define them in their WORKSPACE file This is prep for #1943 - hierarchical workspace loading. RELNOTES[INC]: Remote repositories must define any remote repositories they themselves use (e.g., if @x//:foo depends on @y//:bar, @y must be defined in @x's WORKSPACE file). PiperOrigin-RevId: 154321845
Bazel is moving to a model where child repository WORKSPACE files will be parsed (see bazelbuild/bazel#1943). This means that top-level WORKSPACE files won't have to declare every dependency (yay!) but, as a part of this, child repositories will have to start declaring the repositories they use. This should be a no-op, though, since the top-level WORKSPACE file overrides all of these repository definitions. So it doesn't really matter what they are (hence the dummy paths).
@kchodorow is this still being targeted for 0.6? |
It depends when 0.6 is getting cut, I'd like it to be! |
Also eagerly awaiting this, as we have |
Will this enable me to have a nested WORKSPACE which has (for example) a If the answer is yes then any rough estimates on when this will land in HEAD? |
@gnossen No. When @dslomov decided on the priorities for Bazel 1.0, recursive workspaces were not in scope. So, unfortunately, nobody will be working on recursive workspaces before Bazel 1.0 is out. |
Understood. I'd just like to raise awareness that this gap is causing a fair bit of pain. Related: census-instrumentation/opencensus-cpp#378 |
This could be useful for projects that use gRPC as an external repository. This could not be done within the same grpc_deps.bzl due to the problem discussed in - bazelbuild/bazel#1550 - bazelbuild/bazel#1943
Hi, is there any update for this feature? I came across this issue and #1550 . Seems it's really hard to make WORKSPACE modularized without this one. Since 1.2.0 is out now, could you please consider putting this feature somewhere in the roadmap? thanks. |
Friendly ping, this is a highly anticipated feature for my group. Can we get an update on it's status? |
Friendly ping, this is a big problem for open sourcing Google projects. |
@smolkaj In our project, we try to ensure that our repository rules and toolchains can ultimately be grouped into one macro, and is crafted such that you only need one The example macro: Example usage in downstream Bazel project: Disclaimer: Not the author of the implementation ;) Meta: I tried searching the doc for something that talks about the
Multiple loads here, but does not appear to have inter-dependencies? |
This pull request contains various cleanup/quality-of-life improvements for the repository by clearly grouping and defining dependencies for the docs and examples workspaces. Ultimately, the files that are created in here can be moved entirely into their neighboring WORKSPACE files once bazelbuild/bazel#1943 has been closed.
We are developing a new external dependency system for Bazel (codename Bzlmod), which will tackle the fundamental problem this issue tries to solve. Please read more at https://bazel.build/docs/bzlmod |
Design doc: https://bazel-review.googlesource.com/c/6131
The text was updated successfully, but these errors were encountered: