bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.21k stars 4.06k forks source link

"./compile compile $(which bazel)" at HEAD is broken with Bazel 0.4.5 #2981

Closed philwo closed 5 years ago

philwo commented 7 years ago

The commit https://github.com/bazelbuild/bazel/commit/2879971666e0cc3f1f24ae91b88c4400af77e7f3 broke the command ./compile.sh compile $(which bazel) (where which bazel resolve to the latest released Bazel at this time, version 0.4.5).

The error message is:

running ./compile.sh compile /usr/bin/bazel
🍃  Building Bazel with Bazel.
INFO: Found 1 target...
ERROR: /usr/local/google/home/philwo/src/bazel/src/main/java/com/google/devtools/build/lib/BUILD:254:1: Java compilation in rule '//src/main/java/com/google/devtools/build/lib:os_util' failed: Worker process sent response with exit code: 1.
Fatal Error: Unable to find package java.lang in classpath or bootclasspath
Target //src:bazel failed to build
INFO: Elapsed time: 5.579s, Critical Path: 4.87s

Interestingly, a simple bazel build //src:bazel works, so Bazel 0.4.5 can still successfully build the latest Bazel HEAD. This only fails when using the ./compile.sh compile $(which bazel) workflow.

It also works fine when which bazel resolves to Bazel 0.5rc4.

@cushon Any idea how we can fix this? Maybe it's easy to fix? @damienmg Added you to judge how important this is for Bazel 0.5.0 release - is it a blocker? Or do we not care about this if bazel build //src:bazel still works fine?

cushon commented 7 years ago

Previously #2869. Is using ./compile.sh with the previous release supported?

philwo commented 7 years ago

I'm not sure. @aehlig or @damienmg might know.

If it's not supported, maybe we should remove the flow where you can pass an existing bazel to compile.sh.

aehlig commented 7 years ago

On Wed, May 10, 2017 at 06:40:20AM -0700, Philipp Wollermann wrote:

I'm not sure. @aehlig or @damienmg might know.

Support is a policy question and I'm not the person deciding on policies.

However, I don't think it is a release blocker. When a new release is announced, the recommended way of building bazel[1] is to download the distribution artifact and call bash ./compile.sh.

Also the use case for compile.sh $(which bazel) is quite limited (I've always considered it as a short cut for certain tests). For developers we recommend[2] to call bazel build //src:bazel with the latest released bazel.

[1] https://bazel.build/versions/master/docs/install-compile-source.html [2] https://bazel.build/contributing.html#compiling-bazel

-- Klaus Aehlig Google Germany GmbH, Erika-Mann-Str. 33, 80636 Muenchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschaeftsfuehrer: Matthew Scott Sucherman, Paul Terence Manicle

philwo commented 7 years ago

@aehlig I agree with that - downgrading to P2 and no breakage for now until Damien can have a look.

damienmg commented 7 years ago

That's curious that we get that breakage but I don't think it is important enough to care. The correct way to build bazel that way would be bazel build //src:bazel but that does not add stamping information.

Anyway we probably want to clean-up a bit compile.sh and make that work again but definitely not a big issue.