Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mpatou-openai opened this issue Nov 5, 2024 · 1 comment
Open
Labels

Comments

@mpatou-openai
Copy link

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.

srcs = [
       "third-party/uint256_t/uint128_t/endianness.h",
       "third-party/uint256_t/uint128_t/uint128_t.h",
       "third-party/uint256_t/uint256_t.h",
       "third-party/uint256_t/uint128_t/uint128_t.include",
       "third-party/uint256_t/uint128_t/uint128_t_config.include",
       "third-party/uint256_t/uint256_t.include",
       "third-party/uint256_t/uint256_t_config.include",
       "foo.cc"
 ],
  • run bazel build

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

@satyanandak satyanandak added team-Rules-CPP Issues for C++ rules team-Rules-Python Native rules for Python team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob and removed team-Rules-Python Native rules for Python team-Loading-API BUILD file and macro processing: labels, package(), visibility, glob labels Nov 6, 2024
@jwnimmer-tri
Copy link
Contributor

I believe this is a duplicate of #10552.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants
@jwnimmer-tri @sgowroji @iancha1992 @satyanandak @mpatou-openai and others