[llvm] [bzl] Remove obsolete `output_to_genfiles = True` (PR #83944)

Jordan Rupprecht via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 18:04:33 PST 2024


https://github.com/rupprecht created https://github.com/llvm/llvm-project/pull/83944

The [bazel docs](https://bazel.build/rules/lib/globals/bzl#rule) discourage setting this. The comments about being necessary for headers or genrules seem to be obsolete, at least for the LLVM tree itself.

The effect of this is that generated files will go to `bazel-bin` instead of `bazel-genfiles`.

One external use was fixed here: https://github.com/google/jax/commit/32bb3b06132b4256cd8674fb98bce057dc968610.

>From bb6762c7df1d309c3a80025ce59fc84f1511f7f9 Mon Sep 17 00:00:00 2001
From: Jordan Rupprecht <rupprecht at google.com>
Date: Mon, 4 Mar 2024 17:52:56 -0800
Subject: [PATCH] [bzl] Remove obsolete `output_to_genfiles = True`

The [bazel docs](https://bazel.build/rules/lib/globals/bzl#rule) discourage setting this. The comments about being necessary for headers or genrules seem to be obsolete, at least for the LLVM tree itself.

The effect of this is that generated files will go to `bazel-bin` instead of `bazel-genfiles`.

One external use was fixed here: https://github.com/google/jax/commit/32bb3b06132b4256cd8674fb98bce057dc968610.
---
 utils/bazel/llvm-project-overlay/llvm/enum_targets_gen.bzl | 2 --
 utils/bazel/llvm-project-overlay/mlir/tblgen.bzl           | 2 --
 2 files changed, 4 deletions(-)

diff --git a/utils/bazel/llvm-project-overlay/llvm/enum_targets_gen.bzl b/utils/bazel/llvm-project-overlay/llvm/enum_targets_gen.bzl
index 998b706dbbbbe5..79617490bf7a4c 100644
--- a/utils/bazel/llvm-project-overlay/llvm/enum_targets_gen.bzl
+++ b/utils/bazel/llvm-project-overlay/llvm/enum_targets_gen.bzl
@@ -64,7 +64,5 @@ enum_targets_gen = rule(
                   " `@LLVM_ENUM_{macro_name}S@`",
         ),
     },
-    # output_to_genfiles is required for header files.
-    output_to_genfiles = True,
     implementation = enum_targets_gen_impl,
 )
diff --git a/utils/bazel/llvm-project-overlay/mlir/tblgen.bzl b/utils/bazel/llvm-project-overlay/mlir/tblgen.bzl
index 9d26822ac1638a..fdf6a57107ac34 100644
--- a/utils/bazel/llvm-project-overlay/mlir/tblgen.bzl
+++ b/utils/bazel/llvm-project-overlay/mlir/tblgen.bzl
@@ -181,8 +181,6 @@ def _gentbl_rule_impl(ctx):
 gentbl_rule = rule(
     _gentbl_rule_impl,
     doc = "Generates tabular code from a table definition file.",
-    # Match genrule behavior
-    output_to_genfiles = True,
     attrs = {
         "tblgen": attr.label(
             doc = "The TableGen executable with which to generate `out`.",



More information about the llvm-commits mailing list