don't touch bp2build_workspace_marker
file if it exists
- the generating rule has `restat=true`, so its output need not have a newer timestamp to prevent it from rerunning on subsequent ninja invocations - its dependents (so far only bootstrap.ninja's "build build.ninja") already have proper dependencies in the depfile, namely 1. Android.bp.list, 2. entries in Android.bp.list, 3. bazel.list and 4. entries in bazel.list This change prevents symlink related changes from spuriously retriggering build.ninja Change-Id: I93f1fea7054dfbfc7c13ece34d2d1f07a81bbe07 Test: manually verifying bazel analysis is triggered only under the right set of CUJs using build/bazel/ci/incremental_build.py Bug: b/239044236
This commit is contained in:
@@ -519,6 +519,12 @@ func touch(path string) {
|
||||
}
|
||||
}
|
||||
|
||||
func touchIfDoesNotExist(path string) {
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
touch(path)
|
||||
}
|
||||
}
|
||||
|
||||
// Find BUILD files in the srcDir which are not in the allowlist
|
||||
// (android.Bp2BuildConversionAllowlist#ShouldKeepExistingBuildFileForDir)
|
||||
// and return their paths so they can be left out of the Bazel workspace dir (i.e. ignored)
|
||||
@@ -684,8 +690,9 @@ func runBp2Build(configuration android.Config, extraNinjaDeps []string) {
|
||||
|
||||
writeDepFile(bp2buildMarker, eventHandler, ninjaDeps)
|
||||
|
||||
// Create an empty bp2build marker file.
|
||||
touch(shared.JoinPath(topDir, bp2buildMarker))
|
||||
// Create an empty bp2build marker file, if it does not already exist.
|
||||
// Note the relevant rule has `restat = true`
|
||||
touchIfDoesNotExist(shared.JoinPath(topDir, bp2buildMarker))
|
||||
})
|
||||
|
||||
// Only report metrics when in bp2build mode. The metrics aren't relevant
|
||||
|
Reference in New Issue
Block a user