question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bazel Build technical debt

See original GitHub issue

What 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 or bazel 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.


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:open
  • Created a year ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AutomatedTestercommented, Mar 22, 2022

thanks for the issue. This is a major blind spot for the team and could definitely do better.

0reactions
titusfortnercommented, Aug 12, 2022

@shs96c fyi looks like we have this ticket for tracking some of the .NET Bazel issues we’ve discussed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Searching for Build Debt: Experiences Managing Technical ...
We describe several related efforts to measure and pay down technical debt found in. Google's BUILD files and associated dead code. We address...
Read more >
Problem: There are N confusing build systems with arcane ...
I've dealt with some really painful in-house build systems, and migrated some of them to Bazel. That was paying off technical debt.
Read more >
Technical Debt as a Product-Engineering Issue
Technical debt is the unfitness of code written in the past to meet today's needs. The reasons that the code doesn't fit anymore...
Read more >
The Engineer's Guide to Creating a Technical Debt Proposal
One of their limitations is that they won't help you identify medium to large pieces of debt that span multiple parts of your...
Read more >
Technical Health over Technical Debt - Graham Brooks
For a software application or system technical debt refers to the internal code quality. We have accrued Technical Debt when the implementation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found