[bazel] fix layering check to run bazel with 16.x
authorMikhail Goncharov <goncharov.mikhail@gmail.com>
Tue, 18 Jul 2023 20:05:14 +0000 (22:05 +0200)
committerMikhail Goncharov <goncharov.mikhail@gmail.com>
Tue, 18 Jul 2023 20:05:14 +0000 (22:05 +0200)
Preparation to update bazel builder to use LLVM 16 release
where layering check was enabled https://reviews.llvm.org/D132779

Current setup missed some backsliding in layering check as it has
only on for projects with the check enforced.

Disabled it completely for libc and fixed for DWARFLinkerParallel.
It would be great to re-enable it for libc later.

utils/bazel/llvm-project-overlay/libc/BUILD.bazel
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

index 9dfc1d4..3aba99e 100644 (file)
@@ -15,7 +15,10 @@ load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
 
 package(
     default_visibility = ["//visibility:public"],
-    features = ["-use_header_modules"],
+    features = [
+        "-use_header_modules",
+        "-layering_check",
+    ],
 )
 
 licenses(["notice"])
index 9654818..a7e9398 100644 (file)
@@ -395,8 +395,8 @@ cc_library(
 cc_library(
     name = "DebugInfo",
     hdrs = glob(["include/llvm/DebugInfo/**/*.h"]),
-    textual_hdrs = glob(["include/llvm/DebugInfo/**/*.def"]),
     copts = llvm_copts,
+    textual_hdrs = glob(["include/llvm/DebugInfo/**/*.def"]),
     deps = [
         ":Object",
         ":Support",
@@ -420,8 +420,9 @@ cc_library(
         "lib/DebugInfo/BTF/*.cpp",
         "lib/DebugInfo/BTF/*.h",
     ]),
-    hdrs = glob(["include/llvm/DebugInfo/BTF/*.h"]) +
-           ["include/llvm/DebugInfo/BTF/BTF.def"],
+    hdrs = glob(["include/llvm/DebugInfo/BTF/*.h"]) + [
+        "include/llvm/DebugInfo/BTF/BTF.def",
+    ],
     copts = llvm_copts,
     deps = [
         ":DebugInfo",
@@ -489,9 +490,9 @@ cc_library(
     deps = [
         ":BinaryFormat",
         ":DebugInfo",
+        ":DebugInfoBTF",
         ":DebugInfoCodeView",
         ":DebugInfoMSF",
-        ":DebugInfoBTF",
         ":Object",
         ":Support",
         ":config",
@@ -2796,6 +2797,7 @@ cc_library(
         ":DebugInfoDWARF",
         ":MC",
         ":Support",
+        ":Target",
         ":TargetParser",
     ],
 )
@@ -3735,8 +3737,8 @@ cc_binary(
         ":AllTargetsAsmParsers",
         ":AllTargetsCodeGens",
         ":BinaryFormat",
-        ":LibtoolDarwinOptionsTableGen",
         ":Core",
+        ":LibtoolDarwinOptionsTableGen",
         ":Object",
         ":Option",
         ":Support",
@@ -4237,9 +4239,9 @@ cc_binary(
     stamp = 0,
     deps = [
         ":BinaryFormat",
+        ":DebugInfoBTF",
         ":DebugInfoCodeView",
         ":DebugInfoMSF",
-        ":DebugInfoBTF",
         ":DebugInfoPDB",
         ":Object",
         ":ObjectYAML",