Merge "For mixed build bazel actions, remove old outputs" am: e1bb74e724
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834860 Change-Id: I32be5f8098a6161aad6d2bdabfb848fd374eeed1
This commit is contained in:
@@ -809,7 +809,16 @@ func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) {
|
|||||||
cmd := rule.Command()
|
cmd := rule.Command()
|
||||||
|
|
||||||
// cd into Bazel's execution root, which is the action cwd.
|
// cd into Bazel's execution root, which is the action cwd.
|
||||||
cmd.Text(fmt.Sprintf("cd %s/execroot/__main__ && ", ctx.Config().BazelContext.OutputBase()))
|
cmd.Text(fmt.Sprintf("cd %s/execroot/__main__ &&", ctx.Config().BazelContext.OutputBase()))
|
||||||
|
|
||||||
|
// Remove old outputs, as some actions might not rerun if the outputs are detected.
|
||||||
|
if len(buildStatement.OutputPaths) > 0 {
|
||||||
|
cmd.Text("rm -f")
|
||||||
|
for _, outputPath := range buildStatement.OutputPaths {
|
||||||
|
cmd.Text(PathForBazelOut(ctx, outputPath).String())
|
||||||
|
}
|
||||||
|
cmd.Text("&&")
|
||||||
|
}
|
||||||
|
|
||||||
for _, pair := range buildStatement.Env {
|
for _, pair := range buildStatement.Env {
|
||||||
// Set per-action env variables, if any.
|
// Set per-action env variables, if any.
|
||||||
|
Reference in New Issue
Block a user