0

Reland "Assert that output dirs have depth=2 when use_remoteexec=true"

This reverts commit 73ecb57623.

Reason for revert: 
https://crrev.com/c/6395935 landed

Original change's description:
> Revert "Assert that output dirs have depth=2 when use_remoteexec=true"
>
> This reverts commit 02d9fe6f03.
>
> Reason for revert:
> LUCI Bisection has identified this change as the culprit of a build failure. See the analysis: https://ci.chromium.org/ui/p/chromium/bisection/compile-analysis/b/8719381548977400529
>
> Sample failed build: https://ci.chromium.org/b/8719381548977400529
>
> If this is a false positive, please report it at http://b.corp.google.com/createIssue?component=1199205&description=Analysis%3A+https%3A%2F%2Fchromium-review.googlesource.com%2Fc%2Fchromium%2Fsrc%2F%2B%2F6393255&format=PLAIN&priority=P3&title=Wrongly+blamed+https%3A%2F%2Fci.chromium.org%2Fui%2Fp%2Fchromium%2Fbisection%2Fcompile-analysis%2Fb%2F8719381548977400529&type=BUG
>
> Original change's description:
> > Assert that output dirs have depth=2 when use_remoteexec=true
> >
> > Bug: 406270633
> > Change-Id: I6c12dafb7f1a519ba5a464332308f8811541ec22
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6393255
> > Commit-Queue: Fumitoshi Ukai <ukai@google.com>
> > Auto-Submit: Andrew Grieve <agrieve@chromium.org>
> > Reviewed-by: Fumitoshi Ukai <ukai@google.com>
> > Cr-Commit-Position: refs/heads/main@{#1437837}
> >
>
> Bug: 406270633
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Change-Id: I05c8bb8ecedfe001b6b0cc34f7b90b6660d4700e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6394219
> Owners-Override: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
> Bot-Commit: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
> Commit-Queue: luci-bisection@appspot.gserviceaccount.com <luci-bisection@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#1437847}

Bug: 406270633
Change-Id: Iecd2d5b45627c7525b8ca11c9c31e2c2df0c8015
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6395680
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1438238}
This commit is contained in:
Fumitoshi Ukai
2025-03-26 10:33:50 -07:00
committed by Chromium LUCI CQ
parent 4fcd21bc90
commit 04f615932d

@ -17,6 +17,7 @@ import("//build/config/rust.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//build/gn_logs.gni")
import("//build/toolchain/rbe.gni")
import("//build/util/generate_wrapper.gni")
import("//chrome/enterprise_companion/buildflags.gni")
import("//components/enterprise/buildflags/buildflags.gni")
@ -1854,14 +1855,21 @@ if (is_chromeos && enable_js_type_check) {
}
}
if (use_remoteexec) {
# Different nesting levels technically work, but cache hits are basically zero.
assert(
rebase_path("//", root_build_dir) == "../../",
"In order for remote builds (use_remoteexec=true) to have cache hits, output directories should be nested two directories deep within src (e.g. \"out/Debug\", or \"foo/bar\"). Found: $root_build_dir")
}
# GN evaluates each .gn file once per toolchain, so restricting to default
# toolchain will ensure write_file() is called only once.
assert(current_toolchain == default_toolchain)
# Write debug logs to gn_logs.txt.
_lines = [
"Generated during 'gn gen' by //BUILD.gn.",
"",
] + build_gn_logs
# GN evaluates each .gn file once per toolchain, so restricting to default
# toolchain will ensure write_file() is called only once.
assert(current_toolchain == default_toolchain)
write_file("$root_build_dir/gn_logs.txt", _lines)