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 error arm 32bit linux ubuntu #850

Closed
rajserc opened this issue Feb 5, 2016 · 44 comments
Closed

Build error arm 32bit linux ubuntu #850

rajserc opened this issue Feb 5, 2016 · 44 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other type: feature request
Milestone

Comments

@rajserc
Copy link

rajserc commented Feb 5, 2016

I am trying to compile bazel on linux arm 32 bit.

I get this error, any idea what could be wrong, any suggestion is much appreciated.

ERROR: /media/ubuntu/SD/bazel/src/java_tools/buildjar/BUILD:191: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
(cd /tmp/bazel.BPDndMaJ/out/bazel &&
exec env -
PATH=/usr/local/cuda-6.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/ubuntu/bin:/home/ubuntu/JDK/jdk1.8.0_33/bin:/home/ubuntu/bin:/home/ubuntu/JDK/jdk1.8.0_33/jre/bin:/media/ubuntu/SD/maven/apache-maven-3.3.9/bin
/bin/bash -c '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/buildjar/libskylark-deps.jar.build_java_list
mkdir 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
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/javac -source 1.8 -target 1.8 -classpath '''third_party/checker_framework_dataflow/dataflow-1.8.10.jar:third_party/error_prone/error_prone_annotation-2.0.9-20160129.jar:third_party/error_prone/error_prone_annotations-2.0.9-20160129.jar:third_party/error_prone/error_prone_core-2.0.9-20160129.jar:third_party/guava/guava-19.0.jar:third_party/jcip_annotations/jcip-annotations-1.0-1.jar:third_party/jformatstring/jFormatString-3.0.0.jar:third_party/jsr305/jsr-305.jar:third_party/pcollections/pcollections-2.1.2.jar:third_party/protobuf/protobuf-java-3.0.0-beta-1.jar:external/bazel_tools/third_party/java/jdk/langtools/javac.jar''' -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output @bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar-2.params @bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
external/local_jdk/bin/jar cf bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar -C bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output .
touch bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output
'): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1: bash failed: error executing command
(cd /tmp/bazel.BPDndMaJ/out/bazel && \

@rajserc
Copy link
Author

rajserc commented Feb 5, 2016

#382 there is a suggestion to try building with --verbose_failures so we can more easily help, any help on where to give this...
i am just running ./compile.sh from bazel root...and it doesnt take any argument like verbose.

@bsilver8192
Copy link
Contributor

Try EXTRA_BAZEL_ARGS=--verbose_failures ./compile.sh. Also, if you could surround the output (and edit your initial one) with ``` (on its own line before and after the actual output) the formatting will be much easier to read.

Shot in the dark about the cause: do you have the unzip package installed?

@rajserc
Copy link
Author

rajserc commented Feb 5, 2016

I do have unzip installed, but i did see some error due to some extra byte issue. But i didnt get that error during this run.
I enabled export EXTRA_BAZEL_ARGS=--verbose_failures and ran ./compile.sh

Got below output.

"INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: ./compile.sh compile /path/to/bazel
🍃 Building Bazel from scratch......
🍃 Building Bazel with Bazel.
ERROR: /media/ubuntu/SD/bazel/src/java_tools/buildjar/BUILD:191: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
(cd /tmp/bazel.Ppd83OK6/out/bazel &&
exec env -
PATH=/usr/local/cuda-6.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/ubuntu/bin:/home/ubuntu/JDK/jdk1.8.0_33/bin:/home/ubuntu/bin:/home/ubuntu/JDK/jdk1.8.0_33/jre/bin
/bin/bash -c '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/buildjar/libskylark-deps.jar.build_java_list
mkdir 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
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/javac -source 1.8 -target 1.8 -classpath '''third_party/checker_framework_dataflow/dataflow-1.8.10.jar:third_party/error_prone/error_prone_annotation-2.0.9-20160129.jar:third_party/error_prone/error_prone_annotations-2.0.9-20160129.jar:third_party/error_prone/error_prone_core-2.0.9-20160129.jar:third_party/guava/guava-19.0.jar:third_party/jcip_annotations/jcip-annotations-1.0-1.jar:third_party/jformatstring/jFormatString-3.0.0.jar:third_party/jsr305/jsr-305.jar:third_party/pcollections/pcollections-2.1.2.jar:third_party/protobuf/protobuf-java-3.0.0-beta-1.jar:external/bazel_tools/third_party/java/jdk/langtools/javac.jar''' -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output @bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar-2.params @bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
external/local_jdk/bin/jar cf bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar -C bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output .
touch bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output
'): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1: bash failed: error executing command
(cd /tmp/bazel.Ppd83OK6/out/bazel &&
exec env -
PATH=/usr/local/cuda-6.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/ubuntu/bin:/home/ubuntu/JDK/jdk1.8.0_33/bin:/home/ubuntu/bin:/home/ubuntu/JDK/jdk1.8.0_33/jre/bin
/bin/bash -c '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/buildjar/libskylark-deps.jar.build_java_list
mkdir 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
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/javac -source 1.8 -target 1.8 -classpath '''third_party/checker_framework_dataflow/dataflow-1.8.10.jar:third_party/error_prone/error_prone_annotation-2.0.9-20160129.jar:third_party/error_prone/error_prone_annotations-2.0.9-20160129.jar:third_party/error_prone/error_prone_core-2.0.9-20160129.jar:third_party/guava/guava-19.0.jar:third_party/jcip_annotations/jcip-annotations-1.0-1.jar:third_party/jformatstring/jFormatString-3.0.0.jar:third_party/jsr305/jsr-305.jar:third_party/pcollections/pcollections-2.1.2.jar:third_party/protobuf/protobuf-java-3.0.0-beta-1.jar:external/bazel_tools/third_party/java/jdk/langtools/javac.jar''' -d bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output @bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar-2.params @bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_java_list
external/local_jdk/bin/jar cf bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar -C bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output .
touch bazel-out/host/bin/src/java_tools/buildjar/libskylark-deps.jar.build_output
'): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //src:bazel failed to build
INFO: Elapsed time: 67.038s, Critical Path: 53.00s

Building output/bazel
"

@rajserc
Copy link
Author

rajserc commented Feb 6, 2016

I think, im making some more progress, i commented scripts/bootstrap/buildenv.sh line 49
# atexit "rm -fr ${DIR}"
Now i have the tmp file intact, so i can i verified the directories.
Also set
EXTRA_BAZEL_ARGS=--verbose_failures -s
unzip seems to be working as there is previous call for unzip that worked.

The temp file has commond.log which is attached.

I am veryfing the file, last commands that failed etc., if any one has some ideas to try, let me know.

command.log.txt

@dslomov dslomov self-assigned this Feb 8, 2016
@dslomov
Copy link
Contributor

dslomov commented Feb 12, 2016

Unfortunately nothing comes to mind without further information...
Looks like all the attempts at invoking 'jar' failed: could you investigate why? (which of those commands failed)

@rajserc
Copy link
Author

rajserc commented Feb 12, 2016

Thanks for responding.

I tried to create a shell script for the last failing comnand and it eorked
without throwing an error.

I will check jar file creation again.
On Feb 12, 2016 1:39 AM, "dslomov" notifications@github.com wrote:

Unfortunately nothing comes to mind without further information...
Looks like all the attempts at invoking 'jar' failed: could you
investigate why? (which of those commands failed)


Reply to this email directly or view it on GitHub
#850 (comment).

@bsilver8192
Copy link
Contributor

Where is your JDK? Try running with --sandbox_debug and make sure nothing necessary is missing. In particular, /home/ubuntu/JDK/jdk1.8.0_33/bin is not going to be included in the sandbox. If you need to use a JDK not installed to the normal system directories, you'll have to disable the sandbox with --spawn_strategy=standalone --genrule_strategy=standalone.

@rajserc
Copy link
Author

rajserc commented Feb 15, 2016

I had multiple java (7,8 and Open/oracle), i think i fixed it to Oracle 8 and set the path,java_home,jre_home to appropriate path.

i set
EXTRA_BAZEL_ARGS=--verbose_failures -s --sandbox_debug --spawn_strategy=standalone --genrule_strategy=standalone JRE_HOME=/usr/lib/jvm/java-8-oracle/jre JAVA_HOME=/usr/lib/jvm/java-8-oracle/
I also pulled the latest code, just in case.

ERROR: /media/ubuntu/SD/bazel/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/BUILD:91:1: error executing shell command: 'set -e;rm -rf bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools...' failed: bash failed: error executing command

command.log.txt

@damienmg
Copy link
Contributor

Can you comment https://github.com/bazelbuild/bazel/blob/master/scripts/bootstrap/buildenv.sh#L49

And then rerun the compile.sh script (you probably don't need -s) and then try out the following command (with the correct path as the temp dir will be different):

(cd /tmp/bazel.x6Ov1FG6/out/bazel && \
  exec env - \
    PATH=/usr/local/cuda-6.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-8-oracle \
  /bin/bash -c 'set -e;rm -rf bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java_list
mkdir bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar | grep '\''\.java$'\'' | sed '\''s|^|bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java/|'\'' >> bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar | grep '\''\.java$'\'' | sed '\''s|^|bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java/|'\'' >> bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar | grep '\''\.java$'\'' | sed '\''s|^|bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java/|'\'' >> bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/javac -source 1.8 -target 1.8 -classpath '\''third_party/checker_framework_dataflow/dataflow-1.8.10.jar:third_party/error_prone/error_prone_annotation-2.0.9-20160129.jar:third_party/error_prone/error_prone_annotations-2.0.9-20160129.jar:third_party/error_prone/error_prone_core-2.0.9-20160129.jar:third_party/guava/guava-19.0.jar:third_party/jcip_annotations/jcip-annotations-1.0-1.jar:third_party/jformatstring/jFormatString-3.0.0.jar:third_party/jsr305/jsr-305.jar:third_party/pcollections/pcollections-2.1.2.jar:third_party/protobuf/protobuf-java-3.0.0-beta-1.jar:external/bazel_tools/third_party/java/jdk/langtools/javac.jar'\'' -d bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output @bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar-2.params @bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java_list
external/local_jdk/bin/jar cf bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar -C bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output .
touch bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output
')

@rajserc
Copy link
Author

rajserc commented Feb 16, 2016

I ran it, it was looking for few jar file, should i set some classpath that
has all the jar file required.

I will try to trouble shoot on my own, but if anyone knows it...it wood be
great.

Will add the error message shortly...as im out.
On Feb 15, 2016 12:12 PM, "Damien Martin-Guillerez" <
notifications@github.com> wrote:

Can you comment
https://github.com/bazelbuild/bazel/blob/master/scripts/bootstrap/buildenv.sh#L49

And then rerun the compile.sh script (you probably don't need -s) and then
try out the following command (with the correct path as the temp dir will
be different):

(cd /tmp/bazel.x6Ov1FG6/out/bazel &&
exec env -
PATH=/usr/local/cuda-6.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-8-oracle
/bin/bash -c 'set -e;rm -rf bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java_list
mkdir bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libdeps_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libworker_protocol_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/jar tf bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar | grep '''.java$''' | sed '''s|^|bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java/|''' >> bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java_list
unzip bazel-out/host/bin/src/main/protobuf/libjava_compilation_proto_srcjar.srcjar -d bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_java >/dev/null
external/local_jdk/bin/javac -source 1.8 -target 1.8 -classpath '''third_party/checker_framework_dataflow/dataflow-1.8.10.jar:third_party/error_prone/error_prone_annotation-2.0.9-20160129.jar:third_party/error_prone/error_prone_annotations-2.0.9-20160129.jar:third_party/error_prone/error_prone_core-2.0.9-20160129.jar:third_party/guava/guava-19.0.jar:third_party/jcip_annotations/jcip-annotations-1.0-1.jar:third_party/jformatstring/jFormatString-3.0.0.jar:third_party/jsr305/jsr-305.jar:third_party/pcollections/pcollections-2.1.2.jar:third_party/protobuf/protobuf-java-3.0.0-beta-1.jar:external/bazel_tools/third_party/java/jdk/langtools/javac.jar''' -d bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output @bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar-2.params @bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_
java_list
external/local_jdk/bin/jar cf bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar -C bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output .
touch bazel-out/host/bin/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/libskylark-deps.jar.build_output
')


Reply to this email directly or view it on GitHub
#850 (comment).

@rajserc
Copy link
Author

rajserc commented Feb 16, 2016

Interesting, when i ran compile.sh again and the got error and ran the command, it did not fail.

Its because i ran previously in a terminal where all settings were gone.

@rajserc
Copy link
Author

rajserc commented Feb 16, 2016

This is what i got.

'ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel$ (cd /tmp/bazel.B7fGNqbU/out/bazel && \

exec env -
PATH=/usr/local/cuda-6.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-8-oracle/bin
/bin/bash -c 'set -e;rm -rf bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar.build_output bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar.build_java bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar.build_java_list
mkdir bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar.build_output bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar.build_java
external/local_jdk/bin/javac -source 1.8 -target 1.8 -classpath '''third_party/jsr305/jsr-305.jar:bazel-out/host/bin/src/java_tools/singlejar/libskylark-deps.jar:third_party/guava/guava-19.0.jar:bazel-out/host/bin/src/main/java/com/google/devtools/build/lib/libshell-skylark.jar''' -d bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar.build_output @bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar-2.params
external/local_jdk/bin/jar cf bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar -C bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar.build_output .
touch bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar.build_output
')
ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel$ external/local_jdk/bin/jar cf bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar -C bazel-out/host/bin/src/java_tools/singlejar/libbootstrap.jar.build_output .
bash: external/local_jdk/bin/jar: No such file or directory
ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel$
'

@damienmg
Copy link
Contributor

What does ls $(dirname $(readlink bazel-out))/external/local_jdk/bin gives you?

@rajserc
Copy link
Author

rajserc commented Feb 16, 2016

i got this...
`
ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel$ ls $(dirname $(readlink bazel-out))/external/local_jdk/bin
appletviewer jarsigner javah jconsole jinfo jrunscript jstatd pack200 rmiregistry tnameserv xjc
extcheck java javap jdb jjs jsadebugd keytool policytool schemagen unpack200
idlj javac java-rmi.cgi jdeps jmap jstack native2ascii rmic serialver wsgen
jar javadoc jcmd jhat jps jstat orbd rmid servertool wsimport
ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel$

ubuntu@tegra-ubuntu:/tmp/bazel.B7fGNqbU/out/bazel/external/local_jdk/bin$ java -version
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) Client VM (build 25.71-b15, mixed mode)
ubuntu@tegra-ubuntu:/tmp/bazel.B7fGNqbU/out/bazel/external/local_jdk/bin$ java -version
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) Client VM (build 25.71-b15, mixed mode)
ubuntu@tegra-ubuntu:/tmp/bazel.B7fGNqbU/out/bazel/external/local_jdk/bin$ ./java -version
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) Client VM (build 25.71-b15, mixed mode)
ubuntu@tegra-ubuntu:/tmp/bazel.B7fGNqbU/out/bazel/external/local_jdk/bin$ ./javac -version
javac 1.8.0_71
ubuntu@tegra-ubuntu:/tmp/bazel.B7fGNqbU/out/bazel/external/local_jdk/bin$
`

@bsilver8192
Copy link
Contributor

What do file external/local_jdk/bin/jar and ldd external/local_jdk/bin/jar say?

@rajserc
Copy link
Author

rajserc commented Feb 17, 2016

`
ubuntu@tegra-ubuntu:/tmp/bazel.B7fGNqbU/out/bazel/external/local_jdk/bin$ ldd jar
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6ec6000)
libjli.so => /usr/lib/jvm/java-8-oracle/bin/./../lib/arm/jli/libjli.so (0xb6ea9000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6e9e000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6db7000)
/lib/ld-linux-armhf.so.3 (0xb6f03000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6d96000)

ubuntu@tegra-ubuntu:/tmp/bazel.B7fGNqbU/out/bazel/external/local_jdk/bin$ file jar
jar: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=fb9bbe89629ae4c7804eb31ab5b72eef599a74c5, not stripped
ubuntu@tegra-ubuntu:/tmp/bazel.B7fGNqbU/out/bazel/external/local_jdk/bin$
`

@rajserc
Copy link
Author

rajserc commented Feb 17, 2016

http://askubuntu.com/questions/336795/ubuntu-fix-dependency-problems

I am just trying to upgrade to see if any dependancy issue gets fixed...(i know...this is called shooting in the dark :-))

@damienmg
Copy link
Contributor

Tries with
export EXTRA_BAZEL_ARGS='--spawn_strategy=standalone --genrule_strategy=standalone'

@damienmg
Copy link
Contributor

Disregard my last comment you already have them.

@damienmg
Copy link
Contributor

And just executing $(dirname $(readlink bazel-out))/external/local_jdk/bin/jar gives you what?

@rajserc
Copy link
Author

rajserc commented Feb 17, 2016

it looks find...this is what i got

`
ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel$ $(dirname $(readlink bazel-out))/external/local_jdk/bin/jar
Usage: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
Options:
-c create new archive
-t list table of contents for archive
-x extract named (or all) files from archive
-u update existing archive
-v generate verbose output on standard output
-f specify archive file name
-m include manifest information from specified manifest file
-n perform Pack200 normalization after creating a new archive
-e specify application entry point for stand-alone application
bundled into an executable jar file
-0 store only; use no ZIP compression
-P preserve leading '/' (absolute path) and ".." (parent directory) components from file names
-M do not create a manifest file for the entries
-i generate index information for the specified jar files
-C change to the specified directory and include the following file
If any file is a directory then it is processed recursively.
The manifest file name, the archive file name and the entry point name are
specified in the same order as the 'm', 'f' and 'e' flags.

Example 1: to archive two class files into an archive called classes.jar:
jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all the
files in the foo/ directory into 'classes.jar':
jar cvfm classes.jar mymanifest -C foo/ .

ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel$

`

@damienmg
Copy link
Contributor

Let's retry:

EXTRA_BAZEL_ARGS='--verbose_failures --sandbox_debug --spawn_strategy=standalone --genrule_strategy=standalone'
JAVA_HOME=/usr/lib/jvm/java-8-oracle/
./compile.sh

Give back the full log and also ls -l bazel-out

@rajserc
Copy link
Author

rajserc commented Feb 17, 2016

command.log.txt

Looks like same issue...

@damienmg
Copy link
Contributor

What about the output of the ls?

On Wed, Feb 17, 2016, 5:43 PM rajserc notifications@github.com wrote:

command.log.txt
https://github.com/bazelbuild/bazel/files/134742/command.log.txt

Looks like same issue...


Reply to this email directly or view it on GitHub
#850 (comment).

@rajserc
Copy link
Author

rajserc commented Feb 17, 2016

sorry i started to compile protobuf and wanted to build from scratch bazel. So i moved the dir.

I wanted to rule out protobuf jar having issue due to the multiple java availability issue. Do you think it makes sense ? Next my plan is to completely reflash linux and restart. Because per https://devtalk.nvidia.com/default/topic/894997/?comment=4731774 , it is proven to work and i think i my installation got messy

ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel-1$ ls -l bazel-out lrwxrwxrwx 1 ubuntu ubuntu 39 Feb 17 08:35 bazel-out -> /tmp/bazel.JAttaxtV/out/bazel/bazel-out ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel-1$

@damienmg
Copy link
Contributor

I am at lost on what is happening there. Jar seems to simply fail with "not
found". Same retry: run the command given by verbose outside of bazel to
see the output.

On Wed, Feb 17, 2016 at 6:17 PM rajserc notifications@github.com wrote:

sorry i started to compile protobuf and wanted to build from scratch
bazel. So i moved the dir.

I wanted to rule out protobuf jar having issue due to the multiple java
issue. Do you think it makes sense ? Next my plan is to completely reflash
linux and restart. Because per
https://devtalk.nvidia.com/default/topic/894997/?comment=4731774 , it is
proven to work and i think i my installation got messy

ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel-1$ ls -l bazel-out
lrwxrwxrwx 1 ubuntu ubuntu 39 Feb 17 08:35 bazel-out ->
/tmp/bazel.JAttaxtV/out/bazel/bazel-out
ubuntu@tegra-ubuntu:/media/ubuntu/SD/bazel-1$


Reply to this email directly or view it on GitHub
#850 (comment).

@rajserc
Copy link
Author

rajserc commented Feb 17, 2016

could this be because of space issue by any chance ?

@damienmg
Copy link
Contributor

Spaces where?

On Wed, Feb 17, 2016, 6:59 PM rajserc notifications@github.com wrote:

could this be because of space issue by any chance ?


Reply to this email directly or view it on GitHub
#850 (comment).

@rajserc
Copy link
Author

rajserc commented Feb 17, 2016

in /tmp

But shouldnt it error out properly...anyways highlevel what is the problem (in ur guess), is it java/jar issue ? or something else..

@damienmg
Copy link
Contributor

oh disk spaces? I don't think so.

Wait I am looking back at the logs and I still don't see the error when you run the command from outside bazel, can you repro the issue outside bazel? (echo $? to get the error code). Also adding x right after "set -e" might help.

@rajserc
Copy link
Author

rajserc commented Feb 18, 2016

I recompiled protoc, protoc java and bazel with
JAVA_HOME=/usr/lib/jvm/java-8-oracle/ EXTRA_BAZEL_ARGS=--verbose_failures --sandbox_debug --spawn_strategy=standalone --genrule_strategy=standalone

The output file has compilation error that i got while running the same command that fails during compile.sh in command prompt.

To me it looks like its looking for proto library.

output.txt

command.log.txt

@rajserc
Copy link
Author

rajserc commented Feb 18, 2016

ok, finally, i figured out and was able to successfully compile.

Here is what happened.

since protobuf for arm 32 was not there, i compiled it (which is latest verison).
cp /usr/bin/protoc $BAZEL/third_party/protobuf/protoc-linux-arm32.exe (this is libprotoc 3.0.0)

for proto java, i copied third_party/protobuf/protobuf-java-3.0.0-beta-2.jar, but originaly file third_party/protobuf/protobuf-java-3.0.0-beta-1.jar was being used.

I rename third_party/protobuf/protobuf-java-3.0.0-beta-2.jar to third_party/protobuf/protobuf-java-3.0.0-beta-1.jar [not sure how to make the compile script to take the latest/or user defined jar file, just renaming third_party/protobuf/protobuf-java-3.0.0-beta-1.jar didnt fix ]

And that solved the issue.

Thanks a lot everyone for wonderful support, without your help i wouldnt have figured this out.

I would consider this issue resolved.

@GiuseppeDiGuglielmo
Copy link

rajserc, which version of protobuf and bazel are you using? if it is fromt the repo can you give me the commit ids? I need bazel for tensorflow on Ubuntu running on ARM 32bit, but so far I was not able to compile it.

@damienmg
Copy link
Contributor

I will reclassify this one as FR to actually integrate that support to Bazel

@damienmg damienmg added type: feature request P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other and removed under investigation labels Feb 19, 2016
@rajserc
Copy link
Author

rajserc commented Feb 19, 2016

Hi Cuinnyc,

I am also trying to build tensorflow...the following link is useful..are you aware of this ?

http://cudamusing.blogspot.com/2015/11/building-tensorflow-for-jetson-tk1.html

This is what i got
`ubuntu@tegra-ubuntu:~$ bazel --host_jvm_args=-Xmx256m --host_jvm_args=-Xms128m version
Build label: head (@1bab6b1)
Build target: bazel-out/local_linux-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Feb 18 05:31:13 2016 (1455773473)
Build timestamp: 1455773473
Build timestamp as int: 1455773473

ubuntu@tegra-ubuntu:~$ protoc --version
libprotoc 3.0.0

`
Damienmg,

Let me know if i can be of any help

Regards,
Raj

@rajserc
Copy link
Author

rajserc commented Feb 21, 2016

Do you have the tmp folder intact, other wise you can comment

https://github.com/bazelbuild/bazel/blob/master/scripts/bootstrap/buildenv.sh#L49

Also, try to run the command separately and check what permission you have
for that directory. I did not event run with root, so not sure what is
causing this issue.

On Sat, Feb 20, 2016 at 11:32 AM, CU@NYC notifications@github.com wrote:

An additional note. I am compiling in Ubuntu 14.04 on a ARM v7 32 bit.


Reply to this email directly or view it on GitHub
#850 (comment).

@GiuseppeDiGuglielmo
Copy link

Yep. I did it. There were some permission/space problems on the /tmp folder.

Thank you

@rajserc
Copy link
Author

rajserc commented Feb 23, 2016

so, i guess you are good.

On Mon, Feb 22, 2016 at 4:42 PM, CU@NYC notifications@github.com wrote:

Yep. I did it. There were some permission/space problems on the /tmp
folder.

Thank you,
Giuseppe


Reply to this email directly or view it on GitHub
#850 (comment).

@samjabrahams
Copy link

It looks like those in this thread had their issues resolved, but I figured I'd share some info since it's been a few months. A few headaches came up while trying to compile the latest versions of Bazel for TensorFlow on Raspberry Pi, but we've overcome them!

When trying to compile Bazel, after creating the Protobuf binaries, we were running into OutOfMemoryError: Java heap space bugs. The fix, luckily, is pretty simple and intuitive- you just have to set a -J-Xmx flag on the javac command in scripts/bootstrap/compile.sh. This sets a limit to the heap space Java uses when compiling. For example, to specify a max heap space of 500MB, you add the flag -J-Xmx500M

Step-by-step instructions here.

@samjabrahams
Copy link

samjabrahams commented Jan 16, 2017

It looks like the process of bootstrapping bazel for Raspberry Pi has gotten much simpler in more recent, as we no longer have to provide our own protobuf JARs or gRPC plugins. I've successfully got 0.4.3 running on my Raspberry Pi 3, and am planning on having updated instructions by the end of the weekend in my repo.

Thanks for making my life a little easier, Bazel team! Here's hoping cross-compilation discussed in #1053 works out.

@damienmg
Copy link
Contributor

:) @samjabrahams, you should thanks @aehlig

@samjabrahams
Copy link

@aehlig consider yourself thanked!

@samjabrahams
Copy link

For reference, everything is this guide leading up to TensorFlow installation also serves as a Bazel-on-Raspberry-Pi guide for Bazel version 0.4.3.

@hlopko
Copy link
Member

hlopko commented Mar 21, 2018

Closing since this is quite obsolete now. Please open a new issue in case you think this still need investigation.

@hlopko hlopko closed this as completed Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other type: feature request
Projects
None yet
Development

No branches or pull requests

7 participants