bazelbuild/bazel

Creating a git branch that ends in "BUILD" confuses Bazel

Open

#23 431 ouverte le 26 août 2024

Voir sur GitHub
 (3 commentaires) (1 réaction) (0 assignés)Java (4 465 forks)batch import
P3help wantedteam-Coreteam-OSStype: bug

Métriques du dépôt

Stars
 (25 384 stars)
Métriques de merge PR
 (Merge moyen 22j 20h) (77 PRs mergées en 30 j)

Description

Description of the bug:

If you create a git branch like ob/BUILD or ob/build (on macOS where the file system is case insensitive) bazel thinks it's a build file and chokes on it.

Which category does this issue belong to?

Core

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

$ git init demo
$ cd demo
$ touch MODULE.bazel WORKSPACE
$ git add -A
$ git commit -am "init bazel repo"
[main (root-commit) f45e299] init bazel repo
 2 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 MODULE.bazel
 create mode 100644 WORKSPACE
$ git checkout -b ob/build
Switched to a new branch 'ob/build'
$ bazel build //...
ERROR: /Users/obonilla/tmp/demo/.git/logs/refs/heads/ob/BUILD:1:1: invalid octal literal: 0000000000000000000000000000000000000000 (use '0o000000000000000000000000000000000000000')
ERROR: /Users/obonilla/tmp/demo/.git/logs/refs/heads/ob/BUILD:1:42: syntax error at 'f45e29939884f14e45e1dac396a2534ce168ee1c': expected newline
ERROR: /Users/obonilla/tmp/demo/.git/logs/refs/heads/ob/BUILD:1:104: invalid character: '@'
ERROR: /Users/obonilla/tmp/demo/.git/logs/refs/heads/ob/BUILD:1:128: invalid octal literal: 0700 (use '0o700')
ERROR: /Users/obonilla/tmp/demo/.git/logs/refs/heads/ob/BUILD:1:149: keyword 'from' not supported
ERROR: /Users/obonilla/tmp/demo/.git/refs/heads/ob/BUILD:1:1: name 'f45e29939884f14e45e1dac396a2534ce168ee1c' is not defined
ERROR: package contains errors: .git/logs/refs/heads/ob
ERROR: package contains errors: .git/refs/heads/ob
WARNING: Target pattern parsing failed.
ERROR: Skipping '//...': Error evaluating '//...': error loading package '.git/logs/refs/heads/ob': Package '.git/logs/refs/heads/ob' contains errors
ERROR: Error evaluating '//...': error loading package '.git/logs/refs/heads/ob': Package '.git/logs/refs/heads/ob' contains errors
INFO: Elapsed time: 2.027s
INFO: 0 processes.
ERROR: Build did NOT complete successfully

Which operating system are you running Bazel on?

macOS

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?

No response

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

No response

Guide contributeur