4 ms·
Isn’t Bazel based off another tool they use internally?
by dickeytk 7y ago
Isn’t Bazel based off another tool they use internally?
- Spinfusor 7y agoYes: the internal tool is Blaze
- klodolph 7y agoYes. My guess is that over a long enough period of time, the internal build system will migrate to Bazel. But I don’t think it will happen soon. Large migrations are always a pain, but Bazel does make it easier (since you can isolate dependencies very well and migrate bottom-up). I don’t work there, but I have talked to Googlers working on build systems.
- ses1984 7y agoI want to try this with a monorepo codebase now but every time I try to get started I feel overwhelmed. I'm trying to sell my team on it, but none of us has experience with bazel. I'm trying to figure out how to do a small poc where we migrate one intermediate thing in the monorepo to bazel and try to prove out how it can take over everything.
- klodolph 7y agoI have personally done this. - You are going to screw things up a couple times. The documentation for Bazel is not always clear, but you can usually find examples or explanations of complicated stuff on forums somewhere. - Start with a leaf dependency, something in your codebase that doesn’t depend on anything else. Then work your way up. Just write a WORKSPACE + BUILD.bazel in your root, and then put a BUILD.bazel in the directory for the dependency you are going to work on. - Look at examples like Tensor Flow, especially for how to handle third-party dependencies (although Tensor Flow is going to do it in a more complicated way). - Migrate your tests as you go. - Just run "bazel build //...:all" or "bazel test //...:all" from your project root as you go to make sure things don’t break. - Undoubtedly it will take a while to develop a good mental model of how Bazel works. For fun, try looking around in the output directories, or look at the sandboxes it creates.
- ses1984 7y agoI appreciate your help and was curious if you could field one more specific question: What if I wanted to fork tensorflow and integrate my project into it, would I need the tensorflow fork as something like a git submodule in my main repo, or is there a way to tell bazel there's another repo somewhere else and where it fits into the graph?
- evmar 7y agoBazel is just the open source name of the internal Google build system, it is the same codebase.
- klodolph 7y agoFrom what I understand, the two tools have some very significant differences at this point. They may be the same codebase in a broad sense, and may share a lot of code, but I bet they are using something like Copybara to synchronize them. https://github.com/google/copybara https://github.com/google/copybara