Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build break? #245

Closed
huahang opened this issue Jun 15, 2015 · 9 comments
Closed

Build break? #245

huahang opened this issue Jun 15, 2015 · 9 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug

Comments

@huahang
Copy link

huahang commented Jun 15, 2015

I get the following error when I am trying to build bazel from the latest code.

$ ./compile.sh 
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh build /path/to/bazel
🍃  Building Bazel from scratch...........
🍃  Building Bazel with Bazel.
.Extracting Bazel installation...
Sending SIGTERM to previous Bazel server (pid=1890)... done.
......
INFO: Found 1 target...
INFO: From Javac src/java_tools/buildjar/libskylark-deps.jar [for host]:
/bin/bash: line 2: jar: command not found
/bin/bash: line 4: jar: command not found
javac: no source files
Usage: javac <options> <source files>
use -help for a list of possible options
ERROR: /data/users/huahang/src/bazel/src/java_tools/buildjar/BUILD:171:1: error executing shell command: 'set -e;rm -rf bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java bazel-out/host/bin/src/java_tools...' failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 2.
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3.470s, Critical Path: 1.10s

Building output/bazel
@damienmg damienmg self-assigned this Jun 15, 2015
@damienmg damienmg added type: bug P2 We'll consider working on this in future. (Assignee optional) labels Jun 15, 2015
@damienmg
Copy link
Contributor

It means that it does not found the jar command. I will fix that today.

@damienmg
Copy link
Contributor

reproduced: remove jar from PATH and clean compile.sh

@huahang
Copy link
Author

huahang commented Jun 15, 2015

Just curious, I think the jar command is in my PATH?

$ which jar
/data/users/huahang/opt/jdk/linux-x64/jdk1.8/bin/jar

@damienmg
Copy link
Contributor

Huh but it is probably not in the path that Bazel is using.

Do you have jar in /usr/bin or /usr/local/bin?

@huahang
Copy link
Author

huahang commented Jun 15, 2015

No, I don't. And it builds if I copy a jar binary in /usr/bin. Yet still, I think I would be nicer if the jar command could be loaded from $JAVA_HOME.

Thank you! :-)

@damienmg
Copy link
Contributor

The fix to use the jar from JAVA_HOME is in our internal source repository and should be in a few hours :)

@lisendong
Copy link

@damienmg why you only add "/usr/bin or /usr/local/bin" to "$PATH" when running compile.sh ???

I think you should use system's PATH variable .

or how cound I modify the PATH variable ???

@jin
Copy link
Member

jin commented Jan 23, 2018

@lisendong This issue is closed, do you mind creating a new issue with the details of your problem?

@lisendong
Copy link

lisendong commented Jan 24, 2018

when I install bazel-0.9.0-dist by compile.sh, I met:

ERROR: /tmp/bazel_Bcmpd1a6/out/external/googleapis/BUILD.bazel:127:1: error executing shell command: 'cp 'bazel-out/k8-opt/bin/external/googleapis/google_watch_v1_java_grpc_srcs.jar' 'bazel-out/k8-opt/bin/external/googleapis/google_watch_v1_java_grpc_srcs.srcjar'' failed (Exit 127): bash failed: error executing command
  (cd /tmp/bazel_Bcmpd1a6/out/execroot/io_bazel && \
  exec env - \
  /bin/bash -c 'cp '\''bazel-out/k8-opt/bin/external/googleapis/google_watch_v1_java_grpc_srcs.jar'\'' '\''bazel-out/k8-opt/bin/external/googleapis/google_watch_v1_java_grpc_srcs.srcjar'\''')
/bin/bash: cp: command not found
Target //src:bazel failed to build

I have tried
--action_env=PATH
but it doesn't work.

"exec env - /bash/bash -c" is a really strange design. I don't want to discuss the reason of the design. But I think you should give a easy way, we could modify only several script to propagate $PATH env var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug
Projects
None yet
Development

No branches or pull requests

4 participants