[llvm] afdfdc4 - [gn build] assert that goma_dir and sysroot are set for goma builds

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 15:31:05 PST 2021


Author: Nico Weber
Date: 2021-02-18T18:30:26-05:00
New Revision: afdfdc4bcf1e3d9d8596b701da69f2309e7bf697

URL: https://github.com/llvm/llvm-project/commit/afdfdc4bcf1e3d9d8596b701da69f2309e7bf697
DIFF: https://github.com/llvm/llvm-project/commit/afdfdc4bcf1e3d9d8596b701da69f2309e7bf697.diff

LOG: [gn build] assert that goma_dir and sysroot are set for goma builds

Added: 
    

Modified: 
    llvm/utils/gn/build/BUILD.gn
    llvm/utils/gn/build/toolchain/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn
index 907520b16d33..df30890c93bf 100644
--- a/llvm/utils/gn/build/BUILD.gn
+++ b/llvm/utils/gn/build/BUILD.gn
@@ -293,6 +293,9 @@ config("compiler_defaults") {
   if (sysroot != "" && current_os != "win" && is_clang) {
     cflags += [ "-Wpoison-system-directories" ]
   }
+  assert(
+      !use_goma || sysroot != "",
+      "goma needs a sysroot: run `llvm/utils/sysroot.py make-fake --out-dir=sysroot` and add `sysroot = \"//sysroot\"` to your args.gn")
 
   if (use_ubsan) {
     assert(is_clang && current_os == "linux",

diff  --git a/llvm/utils/gn/build/toolchain/BUILD.gn b/llvm/utils/gn/build/toolchain/BUILD.gn
index bf37776a9faa..0042df8578f7 100644
--- a/llvm/utils/gn/build/toolchain/BUILD.gn
+++ b/llvm/utils/gn/build/toolchain/BUILD.gn
@@ -10,6 +10,9 @@ declare_args() {
   }
 }
 
+assert(!use_goma || goma_dir != "",
+       "set goma_dir to the output of `goma_ctl goma_dir` in your args.gn")
+
 template("unix_toolchain") {
   toolchain(target_name) {
     # https://groups.google.com/a/chromium.org/d/msg/gn-dev/F_lv5T-tNDM


        


More information about the llvm-commits mailing list