Bazel Build technical debt
See original GitHub issueWhat happened?
Bazel build documentation outdated and unable to build dotnet sources using Bazel on Windows.
Steps like correctly setting up VCTools and MSBuild environment variables are unclear and there are either missing requirements or unclear specifications for portions of the Bazel build instructions. From what I understood after looking around for support on this topic it looks like this has been a long standing issue, as mention by @jimevans, due to a combination of factors:
If you try building using
bazel build //dotnet/…
, you’re going to have a Bad Time™. The rule set used to build the .NET bindings is not the “official” Bazel .NET rules, because those rules make some assumptions that run counter to how .NET environments like to build. This is particularly so with multiple framework versions encompassing .NET Framewotk, .NET Core, and the subsequent unification of those with .NET 5 and beyond…The ones we do use, are much better in that regard, but they’re also wildly incomplete, mostly in the execution of stuff using
bazel test
orbazel run
. We attempt to use some custom rules in those cases, but they’re, frankly speaking, poorly written.The custom rules’ author (me) doesn’t know what he’s doing when constructing Bazel rules, and no one with any real expertise in writing Bazel rules seems to have any interest in donating effort to make them actually work. Those same people with the proper Bazel skill set also usually have no understanding of the peculiarities of .NET projects, or the know how to make them to work seamlessly on Windows.
- _Originally posted by @jimevans in https://github.com/SeleniumHQ/selenium/issues/9915#issuecomment-944896131_
I recently went through all of the steps in the documentation for a fresh setup, using the linked blog article for WIndows as a reference as well, and after spending a few hours trying to resolve it I was still ultimately unsuccessful in building even the dotnet project via VS command line.
Note: Building just the WebDriver, WebDriver.Support, and WebDriverBackedSelenium dotnet projects from within Visual Studio 2019 works and successfully builds the DLLs for each .NET standard and framework. Building the tests is a different story…
We should potentially consider moving away from the Bazel implementation for complete building via command line.
How can we reproduce the issue?
- On latest Windows 10 with latest Visual Studio 2019 and Visual Studio Command Line Tools installed, follow all of the documented steps for setting up the Bazel build environment
- You may need to use the linked blog article for assistance with some of the steps
- Run command to build dotnet using Bazel:
bazel build //dotnet/
Operating System
Windows 10 v19044.1586
Selenium version
Fresh checkout of Selenium 4 trunk
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
thanks for the issue. This is a major blind spot for the team and could definitely do better.
@shs96c fyi looks like we have this ticket for tracking some of the .NET Bazel issues we’ve discussed.