Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdb3e34d authored by usta's avatar usta
Browse files

volatile-status.txt to be translated to an order-only dep in build.ninja

Bug: b/260092986
Test: 1. `out/soong/build.ninja` has `bazel-out/volatile-status.txt` as order-only dep 2. `touch Android.bp && m --bazel-mode-staging aapt2` updates bazel-out/volatile-status.txt but aapt2 is not rebuilt

Change-Id: I1fa23437fea14e0d25b68d75010e964dff34766d
parent 663e060c
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1050,18 +1050,26 @@ func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) {

	for _, depset := range ctx.Config().BazelContext.AqueryDepsets() {
		var outputs []Path
		var orderOnlies []Path
		for _, depsetDepHash := range depset.TransitiveDepSetHashes {
			otherDepsetName := bazelDepsetName(depsetDepHash)
			outputs = append(outputs, PathForPhony(ctx, otherDepsetName))
		}
		for _, artifactPath := range depset.DirectArtifacts {
			outputs = append(outputs, PathForBazelOut(ctx, artifactPath))
			pathInBazelOut := PathForBazelOut(ctx, artifactPath)
			if artifactPath == "bazel-out/volatile-status.txt" {
				// See https://bazel.build/docs/user-manual#workspace-status
				orderOnlies = append(orderOnlies, pathInBazelOut)
			} else {
				outputs = append(outputs, pathInBazelOut)
			}
		}
		thisDepsetName := bazelDepsetName(depset.ContentHash)
		ctx.Build(pctx, BuildParams{
			Rule:      blueprint.Phony,
			Outputs:   []WritablePath{PathForPhony(ctx, thisDepsetName)},
			Implicits: outputs,
			OrderOnly: orderOnlies,
		})
	}