bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.24k stars 4.08k forks source link

cc_binary rule don't allow files to have an extension like ".include" #24216

Open mpatou-openai opened 1 week ago

mpatou-openai commented 1 week ago

Description of the bug:

I'm trying to bazelify some code that relies on https://github.com/calccrypto/uint256_t and cc_binary are failing when I try to includes the .include files:

src/cpp/BUILD.bazel:1577:10: in cc_binary rule //cpp:backend_test:
Traceback (most recent call last):
        File "/virtual_builtins_bzl/common/cc/cc_binary.bzl", line 905, column 44, in _impl
        File "/virtual_builtins_bzl/common/cc/cc_binary.bzl", line 570, column 36, in cc_binary_impl
        File "/virtual_builtins_bzl/common/cc/cc_helper.bzl", line 104, column 27, in _check_srcs_extensions
        File "/virtual_builtins_bzl/common/cc/cc_helper.bzl", line 88, column 25, in _check_file_extensions
Error in fail: in srcs attribute of cc_binary rule @@//cpp:backend_test: source file '@@//cpp:third-party/uint256_t/uint128_t/uint128_t.include' is misplaced here
ERROR: src/cpp/BUILD.bazel:1577:10: Analysis of target '//cpp:backend_test' failed

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Which operating system are you running Bazel on?

linux

What is the output of bazel info release?

release 7.3.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

Yes haven't found something. Asked AI chat bot too.

Any other information, logs, or outputs that you want to share?

No response

jwnimmer-tri commented 3 days ago

I believe this is a duplicate of #10552.