Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.
Bazel explodes if you have a git branch named "build", even if you're not on the branch at the time:
bazel build ...
ERROR: /Users/geoffreyi/deepmath/.git/logs/refs/heads/BUILD:1:81: invalid base-10 integer constant: 5e074e001f956f5d5c7abd3d137c13be1bc8fe82.
ERROR: /Users/geoffreyi/deepmath/.git/logs/refs/heads/BUILD:1:109: invalid character: '@'.
ERROR: /Users/geoffreyi/deepmath/.git/logs/refs/heads/BUILD:1:137: invalid base-8 integer constant: 0800.
ERROR: /Users/geoffreyi/deepmath/.git/logs/refs/heads/BUILD:1:42: syntax error at '0': expected newline.
ERROR: package contains errors: .git/logs/refs/heads.
ERROR: /Users/geoffreyi/deepmath/.git/refs/heads/BUILD:1:40: invalid base-10 integer constant: 5e074e001f956f5d5c7abd3d137c13be1bc8fe82.
ERROR: package contains errors: .git/refs/heads.
ERROR: package contains errors: tensorflow/tensorflow/core/distributed_runtime/rpc.
ERROR: error loading package 'tensorflow/tensorflow/core/distributed_runtime/rpc': Extension file not found. Unable to load file '//tensorflow:tensorflow.bzl': file doesn't exist or isn't a file.
git checkout -b buildbazel build ...Darwin.
bazel info release):release-0.4.0-homebrew
Hard to search for bazel problems involving the keyword "build". :)
Hi Geoffrey,
I have tried to create a small project and build it in a branch named build and found no problem. I also had no problem to build various bazel sub-packages the way you described. Can you please provide more context and maybe a small example/project where the build fails with a build branch but not without it? I would also like to know what differences you are seeing between building with and without a build branch. Thanks.
Cheers,
Irina
You have to name the branch "BUILD" on Linux, OS X is case-insensitive. It creates a BUILD file in .git for the branch, which of course isn't a Bazel-format BUILD file.
@iirina Yep, I should have clarified: "build" == "BUILD" on Mac. I just confirmed that on linux a "BUILD" branch gives the same error. Here's tensorflow on Linux:
(master) beltrami:tensorflow% git checkout -b BUILD
Switched to a new branch 'BUILD'
(BUILD) beltrami:tensorflow% bazel build ...
ERROR: /usr/local/google/home/geoffreyi/tensorflow/.git/refs/heads/BUILD:1:1: name 'dfc5cd48a095b133ece9caff663e3cc512e8a268' is not defined.
ERROR: package contains errors: .git/refs/heads.
ERROR: /usr/local/google/home/geoffreyi/tensorflow/.git/logs/refs/heads/BUILD:1:109: invalid character: '@'.
ERROR: /usr/local/google/home/geoffreyi/tensorflow/.git/logs/refs/heads/BUILD:1:137: invalid base-8 integer constant: 0800.
ERROR: /usr/local/google/home/geoffreyi/tensorflow/.git/logs/refs/heads/BUILD:1:42: syntax error at 'dfc5cd48a095b133ece9caff663e3cc512e8a268': expected newline.
ERROR: /usr/local/google/home/geoffreyi/tensorflow/.git/logs/refs/heads/BUILD:1:155: keyword 'from' not supported.
ERROR: package contains errors: .git/logs/refs/heads.
ERROR: error loading package '.git/logs/refs/heads': Package '.git/logs/refs/heads' contains errors.
INFO: Elapsed time: 0.418s
Ok this is not a Bazel issue per se. The correct way to support that is to do the following:
cat <<EOF >.bazelrc
build --deleted_packages .git
EOF
to ignore the .git package.
We cannot fix all corner case for all version system so using custom .bazelrc file is the way to go.
Most helpful comment
Ok this is not a Bazel issue per se. The correct way to support that is to do the following:
to ignore the .git package.
We cannot fix all corner case for all version system so using custom .bazelrc file is the way to go.