Culling probably-unused Bazel flags

103 views
Skip to first unread message

Lukács T. Berki

unread,
Sep 5, 2023, 9:16:40 AM9/5/23
to bazel-discuss
Hey there,

As discussed on GitHub, we are planning to remove flags from Bazel that are unused.

Given that we don't have a view of what flags are actually used by the community, we decided on the following approach:
  1. Compute a list of unused flags in the Google monorepo
  2. Eyeball the list and remove flags that we consider useful
  3. Distribute the list of flags that are candidates for removal
  4. Have a commenting period of reasonable length
  5. Proceed with the removal.
We have completed (1) and (2), and this e-mail is (3). These are the flags we consider removing:


Please chime in if you need a flag! We don't guarantee that any flag is kept, but we'll be considerate; we don't want to break anyone, but we do want to clean up our code base a little bit.

The commenting period will be two weeks long; if a flag doesn't get an objection or the objection is overruled, we'll proceed with the removal.


--
Lukács T. Berki | Software Engineer | lbe...@google.com | 

Google Germany GmbH | Erika-Mann-Str. 33  | 80636 München | Germany | Geschäftsführer: Paul Manicle, Halimah DeLaine Prado | Registergericht und -nummer: Hamburg, HRB 86891

Fabian Meumertzheim

unread,
Sep 5, 2023, 9:41:05 AM9/5/23
to Lukács T. Berki, bazel-discuss
I found these three flags that I would propose to keep:

incompatible_avoid_conflict_dlls: This is important on Windows (and only applies there, which is probably why it's unused at Google).
legacy_external_runfiles: The default is important for compatibility, the flipped state is an interesting performance optimization for sandboxed actions. Instead of removing this, could we revive the effort to flip it?
experimental_lazy_template_expansion: Gates https://bazel.build/rules/lib/builtins/actions#template_dict, which is used in built-in rules and should be stabilized, after which it can be removed.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAOu%2B0LUpQ9hgKZY-nbqJU1eMFP260c_Q3NKASbecVzH5CPDKNA%40mail.gmail.com.

Austin Schuh

unread,
Sep 5, 2023, 1:50:57 PM9/5/23
to Fabian Meumertzheim, Lukács T. Berki, bazel-discuss
We use --experimental_multi_threaded_digest. It saves a ton of time
on our builds since computing the digest is mostly CPU bound for us
locally.

I filed a ticket years ago asking to make that not experimental.
https://github.com/bazelbuild/bazel/issues/6345

Austin
> To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CALR1tuMZ799yXu3y%3DnYgp3bSCi%3DOymdnvxU0%3DtVTyudJqVDH5w%40mail.gmail.com.

Alex Eagle

unread,
Sep 5, 2023, 3:03:50 PM9/5/23
to bazel-discuss
I think `--[no]legacy_external_runfiles` needs to be kept. Even though no one is working on enabling that flag by default, it's needed to enable a performance optimization where the runfiles tree requires about half as many filesystem operations. In a project with tons of third-party dependency files like nodejs, that can make a substantial difference in test times.

Tobias Werth

unread,
Sep 6, 2023, 2:43:03 AM9/6/23
to Alex Eagle, bazel-discuss
Austin, experimental_multi_threaded_digest is a no-op since Bazel 5, see https://github.com/bazelbuild/bazel/issues/14034





--

Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Liana Sebastian

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls Sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde. 

     

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.


Austin Schuh

unread,
Sep 6, 2023, 11:00:17 PM9/6/23
to Tobias Werth, Alex Eagle, bazel-discuss
Oh, excellent!  I'll start removing it from our systems.

Reply all
Reply to author
Forward
0 new messages