Cannot build bazel from source with bazel 0.3.1 due to 'forcibly_disable_header_compilation' @ ee61191 HEAD
Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.
I cloned latest commit ee61191 and tried to build from src by doing bazel build //src:bazel. I have bazel 0.3.1 on my mac and bazel 0.3.1 on my linux machine. Both of them throw this error:
Linux behavior:
~/bazel$ bazel build //src:bazel Extracting Bazel installation... . ERROR: /mnt/jenkins/bazel/tools/jdk/BUILD:111:1: //tools/jdk:toolchain: no such attribute 'forcibly_disable_header_compilation' in 'java_toolchain' rule. ERROR: /mnt/jenkins/bazel/src/BUILD:129:1: Target '//tools/jdk:jdk7' contains an error and its package is in error and referenced by '//src:embedded_tools'. ERROR: Analysis of target '//src:bazel' failed; build aborted. INFO: Elapsed time: 12.988s
MacOS behavior: Xins-MacBook-Pro:bazel xinlu$ cd bazel Xins-MacBook-Pro:bazel xinlu$ bazel build //src:bazel ERROR: /Users/xinlu/work/bazel/bazel/tools/jdk/BUILD:111:1: //tools/jdk:toolchain: no such attribute 'forcibly_disable_header_compilation' in 'java_toolchain' rule. ERROR: /Users/xinlu/work/bazel/bazel/src/BUILD:129:1: Target '//tools/jdk:jdk7' contains an error and its package is in error and referenced by '//src:embedded_tools'. ERROR: Analysis of target '//src:bazel' failed; build aborted. INFO: Elapsed time: 0.765s
If possible, provide a minimal example to reproduce the problem:
Environment info
These are the ones I tried:
ubuntu 16.04 + bazel 0.3.1 macos 10.10.5 + bazel 0.3.1
Have you found anything relevant by searching the web? (e.g. GitHub issues, email threads in the [email protected] archive)
No, this is not anywhere but there was a change to this buildfile a week ago here: https://github.com/bazelbuild/bazel/commit/7a1ea78dad4d0562d5383ab44d53a3cace3c26e6 which rolls back https://github.com/bazelbuild/bazel/commit/3da16e3b4e8be4d4c4a6eae80365a85851e3253d
It looks like the rules_closure ci is still broken: http://ci.bazel.io/job/rules_closure/
It seems that I was running 0.3.1 on my mac machine from the wrong path so I updated the issue. I have upgraded to 0.4.4 on both machines now and they both compile. I think this might just be a documentation issue. https://bazel.build/versions/master/docs/install.html#compiling-from-source needs to be updated to say that you should get the latest distribution of bazel, or at least a compatible one, and then run bazel build //src:bazel . It looks like bazel 0.3.1 cannot compile the current HEAD due to multiple issues..
Right now the instruction to run bazel build //src:bazel is just an error note and isn't even on the documentation.
Well, Bazel is growing fast and we don't promise that early version build the late version. But I will update the doc. Thanks.