3 ms·
This sounds like a nice setup. I've been using Bazel for some years, but it's always been a struggle to make other people use it :) For some quite understandabl
by burdiyan 5y ago
This sounds like a nice setup. I've been using Bazel for some years, but it's always been a struggle to make other people use it :) For some quite understandable reasons. I also really would like to use one tool, either Nix or Bazel I don't care, but unfortunately, even though Nix is positioning itself as a build system, it really doesn't work very well to offer fast feedback loop and incrementality necessary in development.
How do you make your IDE happy about Bazel managing your external dependencies? I mean, autocomplete and stuff like that.
- jvolkman 5y agoIdeally your IDE supports Bazel. There's a Bazel plugin for Intellij that works reasonable well for Java. We use python primarily, and while this plugin does support Python a bit, it's got some issues. So we wrote a bazel rule that builds a python virtualenv using Bazel dependencies and that bridges the gap to allow use of "legacy" tooling.
- burdiyan 5y agoNice! I was thinking about something like that too. E.g. building symlinks for all the deps into a local directory and use it as PYTHONPATH. I tried it with your example on GitHub and it worked. And then if all the developers are using something like direnv[1] this PYTHONPATH variable could easily be set for everyone. How do you manage dependencies for the fine-grained Bazel targets (like py_library)? Do you write them manually or using some language-specific tools like Gazelle? If you do use the tool, do you have anything in place to automate it? Couple years ago I had a pretty bad experience with people complaining about having to execute Gazelle manually. In my ideal world view I'd want to add an import statement in code and just run `bazel build`. So I ended having a wrapper that would run Gazelle before running Bazel all the time, but it slowed thing down quite a bit, because it was doing a lot of unnecessary work. [1]: https://direnv.net https://direnv.net
- jvolkman 5y agoWe currently manage the dependencies manually, although I'm pretty sure work is being done to bring gazelle to rules_python (maybe it's already landed). For what it's worth, our venv stuff is at https://github.com/cedarai/rules_pyvenv https://github.com/cedarai/rules_pyvenv
- burdiyan 5y agoThanks! Will look take a look.