Make GENERATE_BAZEL_FILES=true correct.

This is achieved by writing soong.environment.used in Main() instead of
as a side effect of a singleton. This makes a difference because build
actions are not generated when GENERATE_BAZEL_FILES=true is set,
therefore the side effect did not happen.

Arguably, Main() is made worse by this change, but I don't want to
tackle the problem of readably determining which mode soong_build is
running in in this change.

Test: Presubmits + the additional test.
Change-Id: I66af2429aedf008762173eaaa55b828b4cf4328b
This commit is contained in:
Lukacs T. Berki
2021-03-23 11:46:47 +01:00
parent c29088b727
commit f0b3b94bb3
5 changed files with 143 additions and 50 deletions

View File

@@ -206,7 +206,6 @@ func collateGloballyRegisteredSingletons() sortableComponents {
// Register env and ninjadeps last so that they can track all used environment variables and
// Ninja file dependencies stored in the config.
singleton{false, "env", EnvSingleton},
singleton{false, "ninjadeps", ninjaDepsSingletonFactory},
)