For mixed build bazel actions, remove old outputs
This should fix incrementality issues in cases where actions don't wipe the old output. (Looking at you, llvm-ar) Test: mixed_libc.sh Change-Id: I4b6639e74c72921a5a703d73fd36f766f121c6ad
This commit is contained in:
parent
a06db33ebd
commit
e37a4de773
1 changed files with 10 additions and 1 deletions
|
@ -809,7 +809,16 @@ func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) {
|
|||
cmd := rule.Command()
|
||||
|
||||
// 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 {
|
||||
// Set per-action env variables, if any.
|
||||
|
|
Loading…
Reference in a new issue