bazelbuild / rules_cc

C++ Rules for Bazel
https://bazel.build
Apache License 2.0
176 stars 88 forks source link

Bazel query failing for Mac M3 chip for bazel query @rules_cc//... #228

Closed uajith closed 1 month ago

uajith commented 1 month ago

ATTENTION! Please read and follow:

  • if this is a question about how to build / test / query / deploy using Bazel, ask it on StackOverflow instead: https://stackoverflow.com/questions/tagged/bazel
  • if this is a discussion starter, send it to bazel-discuss@googlegroups.com or cc-bazel-discuss@googlegroups.com
  • if this is a bug or feature request, fill the form below as best as you can.

Description of the problem / feature request:

Bazel query command fails on Mac M3 chipset with git init error.

bazel query  @rules_cc//...

This command works fine on non M3 chipsets and on M3 chipsets, we are getting this error

ERROR: An error occurred during the fetch of repository 'rules_cc':
   Traceback (most recent call last):
    File "/private/var/tmp/_bazel_ktvs/58b3024c9bf635de3b5e2a175cb13598/external/bazel_tools/tools/build_defs/repo/git.bzl", line 181, column 30, in _git_repository_implementation
        update = _clone_or_update(ctx)
    File "/private/var/tmp/_bazel_ktvs/58b3024c9bf635de3b5e2a175cb13598/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, column 20, in _clone_or_update
        git_ = git_repo(ctx, directory)
    File "/private/var/tmp/_bazel_ktvs/58b3024c9bf635de3b5e2a175cb13598/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 91, column 12, in git_repo
        _update(ctx, git_repo)
    File "/private/var/tmp/_bazel_ktvs/58b3024c9bf635de3b5e2a175cb13598/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 101, column 9, in _update
        init(ctx, git_repo)
    File "/private/var/tmp/_bazel_ktvs/58b3024c9bf635de3b5e2a175cb13598/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 118, column 15, in init
        _error(ctx.name, cl, st.stderr)
    File "/private/var/tmp/_bazel_ktvs/58b3024c9bf635de3b5e2a175cb13598/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 190, column 9, in _error
        fail("error running '%s' while working with @%s:\n%s" % (command_text, name, stderr))
Error in fail: error running 'git init /private/var/tmp/_bazel_ktvs/58b3024c9bf635de3b5e2a175cb13598/external/rules_cc' while working with @rules_cc:
ERROR: no such package '@rules_cc//cc': error running 'git init /private/var/tmp/_bazel_ktvs/58b3024c9bf635de3b5e2a175cb13598/external/rules_cc' while working with @rules_cc:
INFO: Elapsed time: 108.304s

Feature requests: what underlying problem are you trying to solve with this feature?

This issue is happening only on Mac M3 chipsets. For other chips it is working as expected.

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

  • Run the command on Mac M3 chipset M3 Max,
    bazel query  @rules_cc//...

What operating system are you running Bazel on?

Apple M3 Max , Sonoma 14.1

What's the output of bazel info release?

3.7.1

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

Replace this line with your answer.

What version of rules_cc do you use? Can you paste the workspace rule used to fetch rules_cc? What other relevant dependencies does your project have?

Latest

What Bazel options do you use to trigger the issue? What C++ toolchain do you use?

No options

Have you found anything relevant by searching the web?

NO

Replace these lines with your answer.

Places to look:

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

Replace these lines with your answer.

If the files are large, upload as attachment or provide link.

uajith commented 1 month ago

this seems to be not related to Mac M3. There could be some other reasons for the failure. Able to run this successfully on another mac M3