bazelbuild/bazel

Clarify --compilation_mode usage

Open

#10.242 geöffnet am 15. Nov. 2019

Auf GitHub ansehen
 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Java (4.465 Forks)batch import
P3help wantedteam-Configurabilityteam-Documentationtype: documentation (cleanup)

Repository-Metriken

Stars
 (25.384 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 22T 20h) (77 gemergte PRs in 30 T)

Beschreibung

Description of the problem / feature request:

compilation_mode is great, but few people know, understand and use it.

For rule developers, it's common to have a rule that produces different outputs based on debugging/optimization settings. So we ended with having attributes like debug, compress etc on the rules, which is annoying and also less optimal to use for various reasons.

Throughout the entire rule design totorial, configuration_mode is not mentioned. Without knowing such a configuration exists, people find their own way to solve an already solved problem.

Also per the user manual:

This option takes an argument of fastbuild, dbg or opt, and affects various C/C++ code-generation options, such as the level of optimization and the completeness of debug tables. Bazel uses a different output directory for each different compilation mode, so you can switch between modes without needing to do a full rebuild every time.

It gives the impression that compilation_mode only works for C/C++ builds, but it's something that affects all rules that support it. Having those misleading statements are not promoting the usage of this feature.

Contributor Guide