From 19b5b67bc5e2e01b0201bdfbd213a179448e8f6b Mon Sep 17 00:00:00 2001 From: mikey dagitses Date: Tue, 21 Mar 2023 21:34:58 +0000 Subject: [PATCH] exclude all generated files from torch_headers (#96956) exclude all generated files from torch_headers Summary: This allows Bazel to build without having to wipe the standard CMake build. The standard CMake build produces generated files in the source tree, this causes a problem because Bazel has its own way of generating them, and then both sets of generated files conflict with each other. Test Plan: Rely on CI. Reviewers: Subscribers: Tasks: Tags: --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/pytorch/pytorch/pull/96956). * #96957 * __->__ #96956 * #96955 Pull Request resolved: https://github.com/pytorch/pytorch/pull/96956 Approved by: https://github.com/PaliC --- BUILD.bazel | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 843b27a8f83..a9baeee8585 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1587,10 +1587,7 @@ cc_library( "torch/lib/libshm/*.h", ], exclude = [ - "torch/csrc/autograd/generated/VariableType.h", - "torch/csrc/autograd/generated/RegistrationDeclarations.h", - "torch/csrc/autograd/generated/variable_factories.h", - "torch/csrc/autograd/generated/Functions.h", + "torch/csrc/*/generated/*.h", ] + torch_cuda_headers, ) + GENERATED_AUTOGRAD_CPP + [":version_h"], includes = [