Fix queryview.

This got broken by aosp/1610785 which changed the assumptions
soong_build makes about its environment.

At that time, I didn't know that queryview also invokes soong_build
through another pathway.

Test: Manual: "m queryview && m nothing"
Change-Id: I06ed42aee0d97e18f634eeeaca37108009b29d78
This commit is contained in:
Lukacs T. Berki
2021-03-08 13:02:10 +01:00
parent 921a89e376
commit 89071b08c7

View File

@@ -67,10 +67,14 @@ func generateBuildActionsForBazelConversion(ctx SingletonContext, converterMode
blueprint.RuleParams{
Command: fmt.Sprintf(
"rm -rf ${outDir}/* && "+
"%s --bazel_queryview_dir ${outDir} %s && "+
"BUILDER=\"%s\" && "+
"cd $$(dirname \"$$BUILDER\") && "+
"ABSBUILDER=\"$$PWD/$$(basename \"$$BUILDER\")\" && "+
"cd / && "+
"env -i \"$$ABSBUILDER\" --bazel_queryview_dir ${outDir} \"%s\" && "+
"echo WORKSPACE: `cat %s` > ${outDir}/.queryview-depfile.d",
primaryBuilder.String(),
strings.Join(os.Args[1:], " "),
strings.Join(os.Args[1:], "\" \""),
moduleListFilePath.String(), // Use the contents of Android.bp.list as the depfile.
),
CommandDeps: []string{primaryBuilder.String()},