I built bazel-0.4.0 successfully.
Then I tried upgrading it to the latest version bazel-0.5.1 using
$ ./compile.sh compile ../bazel-0.4.0/output/bazel.exe
It's giving me an error, bazel-0.5.0, bazel-0.4.5 gave me same error
ERROR LOG:
$ ./compile.sh compile ../bazel-0.4.0/output/bazel.exe