bazelbuild / bazel

a fast, scalable, multi-language and extensible build system

Home Page:https://bazel.build

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling bazel natively on armv7l

vmayoral opened this issue · comments

Trying to compile bazel on a Raspberry Pi 2. To do so, i replaced third_party/protobuf/protoc-linux-arm32.exe with the corresponding protoc compiled from its sources (to get the 3.0.0 version). With this in mind i launch compile.sh:
https://gist.github.com/vmayoral/d2447888c5f5051a06db

I've reproduced it in a bootstrap image with qemu-debootstrap in my dev. machine obtaining exactly the same result.
Can anyone advice what I'm missing?

You can't use protoc and libprotobuf with different versions, and you may
have to also update the Java source to work with the generated code if you
update to a newer version. 3.0.0 is not backwards compatible with 2.X, and
even the different 2.X may not be compatible with each other.

On Sun, Nov 15, 2015 at 9:31 PM, Víctor Mayoral Vilches <
notifications@github.com> wrote:

Trying to compile bazel on a Raspberry Pi 2. To do so, i replaced
third_party/protobuf/protoc-linux-arm32.exe with the corresponding protoc
compiled from its sources (to get the 3.0.0 version). With this in mind i
launch compile.sh:

root@ubuntu:/bazel# ./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..
Compiling Bazel Java code...
/usr/lib/jvm/java-8-openjdk-armhf/bin/javac -classpath third_party/plexus_interpolation/plexus-interpolation-1.22.jar:third_party/joda-time/joda-time-2.3.jar:third_party/apache_httpclient/httpclient-4.2.5.jar:third_party/gson/gson-2.2.4.jar:third_party/bytebuddy/byte-buddy-dep-0.7-rc6.jar:third_party/java/jdk/langtools/javac.jar:third_party/java/jarjar/jarjar-1.4.jar:third_party/plexus_utils/plexus-utils-3.0.21.jar:third_party/ijar/test/libwrongcentraldir.jar:third_party/tomcat_annotations_api/tomcat-annotations-api-8.0.5.jar:third_party/auto/auto-common-0.3.jar:third_party/auto/auto-value-1.0.jar:third_party/auto/auto-service-1.0-rc2.jar:third_party/apache_commons_pool2/commons-pool2-2.3.jar:third_party/truth/truth-0.27.jar:third_party/aether/aether-util-1.0.0.v20140518.jar:third_party/aether/aether-transport-file-1.0.0.v20140518.jar:third_party/aether/aether-transport-wagon-1.0.0.v20140518.jar:third_party/aether/aether-api-1.0.0.v20140518.jar:third_party/aether/aether-transport-http-1.0.0.v20140518.jar:third_party/aether/aether-connector-basic-1.0.0.v20140518.jar:third_party/aether/aether-transport-classpath-1.0.0.v20140518.jar:third_party/aether/aether-spi-1.0.0.v20140518.jar:third_party/aether/aether-impl-1.0.0.v20140518.jar:third_party/protobuf/protobuf-java-3.0.0-alpha-3.jar:third_party/apache_velocity/velocity-1.7.jar:third_party/jsr305/jsr-305.jar:third_party/jsr330_inject/javax.inject.jar:third_party/plexus_component_annotations/plexus-component-annotations-1.6.jar:third_party/android_common/com.android.tools.build_manifest-merger_23.1.3.jar:third_party/android_common/com.android.tools.build_builder-model_0.13.3.jar:third_party/android_common/com.android.tools_common_23.1.3.jar:third_party/android_common/com.android.tools_sdklib_23.1.3.jar:third_party/android_common/com.android.tools_sdk-common_23.1.3.jar:third_party/android_common/com.android.tools.build_builder_0.13.3.jar:third_party/android_common/com.android.tools.layoutlib_layoutlib_23.1.3.jar:third_party/maven/maven-settings-builder-3.3.3.jar:third_party/maven/maven-settings-3.3.3.jar:third_party/maven/maven-builder-support-3.3.3.jar:third_party/jgit/org.eclipse.jgit-4.0.1.201506240215-r.jar:third_party/error_prone/error_prone_core-2.0.6-20151001-884eec772c13541a7b1af249a68373cd9f30e488.jar:third_party/error_prone/error_prone_annotations-2.0.6-20151001-884eec772c13541a7b1af249a68373cd9f30e488.jar:third_party/guava/guava-testlib.jar:third_party/guava/guava-18.0.jar:third_party/jformatstring/jFormatString-3.0.0.jar:third_party/checker_framework_dataflow/dataflow-1.8.10.jar:third_party/slf4j/slf4j-api-1.7.7.jar:third_party/slf4j/slf4j-jdk14-1.7.7.jar:third_party/maven_model/maven-repository-metadata-3.2.3.jar:third_party/maven_model/maven-model-3.2.3.jar:third_party/maven_model/maven-aether-provider-3.2.3.jar:third_party/maven_model/maven-model-builder-3.2.3.jar:third_party/apache_commons_collections/commons-collections-3.2.1.jar:third_party/apache_commons_logging/commons-logging-1.1.1.jar:third_party/mockito/mockito-all-1.10.19.jar:third_party/apache_httpcore/httpcore-4.2.4.jar:third_party/joda_time/joda-time-2.3.jar:third_party/jsch/jsch-0.1.51.jar:third_party/apache_commons_compress/apache-commons-compress-1.9.jar:third_party/apache_commons_codec/commons-codec-1.9.jar:third_party/junit/junit-4.11.jar:third_party/asm/asm-5.0.4.jar:third_party/asm/asm-commons-5.0.4.jar:third_party/asm/asm-5.0.3.jar:third_party/asm/asm-util-5.0.4.jar:third_party/hamcrest/hamcrest-core-1.3.jar:: -sourcepath src/java_tools/singlejar/java/com/google/devtools/build/zip:src/main/java:src/tools/xcode-common/java/com/google/devtools/build/xcode/common:src/tools/xcode-common/java/com/google/devtools/build/xcode/util:/tmp/bazel.wKvBKfJl/src -d /tmp/bazel.wKvBKfJl/classes -source 1.8 -target 1.8 -encoding UTF-8 @/tmp/bazel.jtzJRJZu/param
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
^
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:212: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, rootPath_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:215: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, relativePath_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:228: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, rootPath_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:231: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, relativePath_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:3700: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 7, javaPackage_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:3732: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(7, javaPackage_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:5246: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, androidSdkPath_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:5256: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, androidSdkPath_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:6284: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, label_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:6290: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 3, buildFile_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:6293: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 4, dependencies_.getRaw(i));
^
symbol: method getRaw(int)
location: variable dependencies_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:6305: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 9, tags_.getRaw(i));
^
symbol: method getRaw(int)
location: variable tags_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:6315: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, label_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:6322: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(3, buildFile_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:6327: error: cannot find symbol
dataSize += computeStringSizeNoTag(dependencies_.getRaw(i));
^
symbol: method getRaw(int)
location: variable dependencies_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/ideinfo/androidstudio/AndroidStudioIdeInfo.java:6347: error: cannot find symbol
dataSize += computeStringSizeNoTag(tags_.getRaw(i));
^
symbol: method getRaw(int)
location: variable tags_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/ExtraActionInfo.java:285: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, owner_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/ExtraActionInfo.java:288: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, id_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/ExtraActionInfo.java:291: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 5, mnemonic_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/ExtraActionInfo.java:303: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, owner_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/ExtraActionInfo.java:306: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, id_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/ExtraActionInfo.java:309: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(5, mnemonic_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/SpawnInfo.java:269: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, argument_.getRaw(i));
^
symbol: method getRaw(int)
location: variable argument_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/SpawnInfo.java:275: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 4, inputFile_.getRaw(i));
^
symbol: method getRaw(int)
location: variable inputFile_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/SpawnInfo.java:278: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 5, outputFile_.getRaw(i));
^
symbol: method getRaw(int)
location: variable outputFile_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/SpawnInfo.java:291: error: cannot find symbol
dataSize += computeStringSizeNoTag(argument_.getRaw(i));
^
symbol: method getRaw(int)
location: variable argument_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/SpawnInfo.java:303: error: cannot find symbol
dataSize += computeStringSizeNoTag(inputFile_.getRaw(i));
^
symbol: method getRaw(int)
location: variable inputFile_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/SpawnInfo.java:311: error: cannot find symbol
dataSize += computeStringSizeNoTag(outputFile_.getRaw(i));
^
symbol: method getRaw(int)
location: variable outputFile_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/EnvironmentVariable.java:192: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/EnvironmentVariable.java:195: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, value_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/EnvironmentVariable.java:206: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/actions/extra/EnvironmentVariable.java:209: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:32: warning: Signal is internal proprietary API and may be removed in a future release
private static final Signal SIGINT = new Signal("INT");
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:32: warning: Signal is internal proprietary API and may be removed in a future release
private static final Signal SIGINT = new Signal("INT");
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:34: warning: SignalHandler is internal proprietary API and may be removed in a future release
private SignalHandler oldHandler;
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:42: warning: SignalHandler is internal proprietary API and may be removed in a future release
this.oldHandler = Signal.handle(SIGINT, new SignalHandler() {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:44: warning: Signal is internal proprietary API and may be removed in a future release
public void handle(Signal signal) {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:42: warning: Signal is internal proprietary API and may be removed in a future release
this.oldHandler = Signal.handle(SIGINT, new SignalHandler() {
^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:55: warning: Signal is internal proprietary API and may be removed in a future release
Signal.handle(SIGINT, oldHandler);
^
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:982: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, name_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:985: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 3, className_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:991: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 5, result_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:1015: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:1018: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(3, className_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:1025: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(5, result_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:2876: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 4, failedLogs_.getRaw(i));
^
symbol: method getRaw(int)
location: variable failedLogs_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:2879: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 5, warning_.getRaw(i));
^
symbol: method getRaw(int)
location: variable warning_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:2894: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 10, passedLog_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:2931: error: cannot find symbol
dataSize += computeStringSizeNoTag(failedLogs_.getRaw(i));
^
symbol: method getRaw(int)
location: variable failedLogs_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:2939: error: cannot find symbol
dataSize += computeStringSizeNoTag(warning_.getRaw(i));
^
symbol: method getRaw(int)
location: variable warning_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/view/test/TestStatus.java:2966: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(10, passedLog_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:216: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, licenseType_.getRaw(i));
^
symbol: method getRaw(int)
location: variable licenseType_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:219: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, exception_.getRaw(i));
^
symbol: method getRaw(int)
location: variable exception_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:232: error: cannot find symbol
dataSize += computeStringSizeNoTag(licenseType_.getRaw(i));
^
symbol: method getRaw(int)
location: variable licenseType_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:240: error: cannot find symbol
dataSize += computeStringSizeNoTag(exception_.getRaw(i));
^
symbol: method getRaw(int)
location: variable exception_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:947: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, key_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:950: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, value_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:961: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:964: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:1636: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, key_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:1639: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, value_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:1650: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:1653: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:2325: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, key_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:2328: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, value_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:2339: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:2342: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:3008: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, key_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:3011: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, value_.getRaw(i));
^
symbol: method getRaw(int)
location: variable value_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:3022: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:3027: error: cannot find symbol
dataSize += computeStringSizeNoTag(value_.getRaw(i));
^
symbol: method getRaw(int)
location: variable value_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:3713: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, key_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:3716: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, value_.getRaw(i));
^
symbol: method getRaw(int)
location: variable value_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:3727: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:3732: error: cannot find symbol
dataSize += computeStringSizeNoTag(value_.getRaw(i));
^
symbol: method getRaw(int)
location: variable value_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:4978: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, source_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:4981: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, destinationDirectory_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:4984: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 3, file_.getRaw(i));
^
symbol: method getRaw(int)
location: variable file_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:4987: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 4, exclude_.getRaw(i));
^
symbol: method getRaw(int)
location: variable exclude_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:4993: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 6, stripPrefix_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:5007: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, source_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:5010: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, destinationDirectory_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:5015: error: cannot find symbol
dataSize += computeStringSizeNoTag(file_.getRaw(i));
^
symbol: method getRaw(int)
location: variable file_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:5023: error: cannot find symbol
dataSize += computeStringSizeNoTag(exclude_.getRaw(i));
^
symbol: method getRaw(int)
location: variable exclude_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:5033: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(6, stripPrefix_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:8431: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:8440: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 5, stringValue_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:8443: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 6, stringListValue_.getRaw(i));
^
symbol: method getRaw(int)
location: variable stringListValue_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:8496: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:8507: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(5, stringValue_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:8512: error: cannot find symbol
dataSize += computeStringSizeNoTag(stringListValue_.getRaw(i));
^
symbol: method getRaw(int)
location: variable stringListValue_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13764: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13767: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, ruleClass_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13770: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 3, location_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13776: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 5, ruleInput_.getRaw(i));
^
symbol: method getRaw(int)
location: variable ruleInput_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13779: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 6, ruleOutput_.getRaw(i));
^
symbol: method getRaw(int)
location: variable ruleOutput_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13782: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 7, defaultSetting_.getRaw(i));
^
symbol: method getRaw(int)
location: variable defaultSetting_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13802: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13805: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, ruleClass_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13808: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(3, location_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13817: error: cannot find symbol
dataSize += computeStringSizeNoTag(ruleInput_.getRaw(i));
^
symbol: method getRaw(int)
location: variable ruleInput_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13825: error: cannot find symbol
dataSize += computeStringSizeNoTag(ruleOutput_.getRaw(i));
^
symbol: method getRaw(int)
location: variable ruleOutput_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:13833: error: cannot find symbol
dataSize += computeStringSizeNoTag(defaultSetting_.getRaw(i));
^
symbol: method getRaw(int)
location: variable defaultSetting_ of type LazyStringList
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:15958: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 3, location_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:15977: error: cannot find symbol
size += com.google.protobuf.GeneratedMessage.computeStringSize(3, location_);
^
symbol: method computeStringSize(int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:17233: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
^
symbol: method writeString(CodedOutputStream,int,Object)
location: class GeneratedMessage
/tmp/bazel.wKvBKfJl/src/com/google/devtools/build/lib/query2/proto/proto2api/Build.java:17236: error: cannot find symbol
com.google.protobuf.GeneratedMessage.writeString(output, 2, containedPackage_.getRaw(i));
^
symbol: method getRaw(int)
location: variable containedPackage_ of type LazyStringList
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
100 errors
15 warnings

I've reproduced it in a bootstrap image with qemu-debootstrap in my dev.
machine obtaining exactly the same result.
Can anyone advice what I'm missing?


Reply to this email directly or view it on GitHub
#606.

Thanks @ulfjack.

I've removed libprotobuf, compiled it from its sources (3.0.0), installed both (the compiled libraries and protoc) and reproduced the build getting a similar output:

https://gist.github.com/vmayoral/ae066b7c87614273a7d8

I'm either missing something or I've just bumped into a new use case.

@damienmg, i've seen you tagged this issue with P3 so i went ahead and tried using libprotobuf 2.X (from the debian repositories), however:

root@ubuntu:/bazel# ./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.
Compiling Java stubs for protocol buffers...
third_party/protobuf/protoc-linux-arm32.exe -Isrc/main/protobuf/ --java_out=/tmp/bazel.1DaRyAwd/src src/main/protobuf/android_studio_ide_info.proto
android_studio_ide_info.proto:15:10: Unrecognized syntax identifier "proto3".  This parser only recognizes "proto2".

I've hacked ./src/main/protobuf/worker_protocol.proto and
./src/main/protobuf/android_studio_ide_info.proto but i'm unable to move forward:

root@ubuntu:/bazel# ./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.
Compiling Java stubs for protocol buffers...
third_party/protobuf/protoc-linux-arm32.exe -Isrc/main/protobuf/ --java_out=/tmp/bazel.MQnKfqPa/src src/main/protobuf/android_studio_ide_info.proto
android_studio_ide_info.proto:26:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:27:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:28:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:32:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:33:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:34:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:40:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:46:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:48:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:49:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:50:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:51:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:55:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:72:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:73:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:74:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:78:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:81:3: Expected "required", "optional", or "repeated".
android_studio_ide_info.proto:82:3: Expected "required", "optional", or "repeated".

I'd appreciate some help here. Either the 2.x or the 3.0.0 way.
Thanks.

I've gone ahead and reproduced it in a clean armhf chroot

# remove all dependencies related to protobuf
sudo apt-get remove libprotobuf* protobuf-compiler
git clone https://github.com/google/protobuf # 3.0.0
cd protobuf; make; make install
export LD_LIBRARY_PATH="/usr/local/lib"
cd ..; git clone https://github.com/bazelbuild/bazel/
cd bazel
cp /usr/local/bin/protoc third_party/protobuf/protoc-linux-arm32.exe
./compile.sh

Still getting the result described above.

So, I checked the code after I posted and we're at a pre-release version of 3.0.0, if I understand correctly. It's possible that there were further changes to protobuf that are incompatible with the version we have checked in.

I don't see anything in the protobuf release notes that looks related though. You could try: https://github.com/google/protobuf/releases/tag/v3.0.0-alpha-3

I think that's the version we're using.

There is a beta release of Protobuf 3 out: https://github.com/google/protobuf/releases/tag/v3.0.0-beta-1

Would it be worthwhile for us to upgrade to 3.0.0-beta-1 or should we wait?

@ulfjack, @davidzchen thanks.

I've just reproduced it once again in a Ubuntu 14.04 ARM machine in the cloud (Scaleway) and just got a similar result https://gist.github.com/vmayoral/4e382cfcfa10e0a579bc so I'll just conclude that "as it is", protobuf master is incompatible.

I'll probably put some time tonight and retry with the pointers you provide.

Confirmed on arm64 platform on https://www.runabove.com/armcloud.xml

Thanks @shaygalon,
I've renamed the issue to reflect that this is happening in armv7l. Retrying now with protobuf at https://github.com/google/protobuf/releases/tag/v3.0.0-beta-1.

The thing is that while on x86 executing ./compile takes only a few seconds to reach:

root@ubuntu:/bazel# ./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.

On my armv7l machine it takes hours to fail and remains for this time at:

root@ubuntu:/bazel# ./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............

Not sure if this is useful. But I've been observing it from the beginning.
It'll be really useful if someone could try arm32 as well.

Failed while using v3.0.0-beta-1 with a similar output. Still blocked.

Something interesting to note is that while on x86 i can compile bazel with protobuf from the debian repositories (version 2.5.0), I can't do the same on arm32:

root@erle-ubuntu-arm:~/bazel# ./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.
Compiling Java stubs for protocol buffers...
third_party/protobuf/protoc-linux-arm32.exe -Isrc/main/protobuf/ --java_out=/tmp/bazel.8E2UOgaq/src src/main/protobuf/android_studio_ide_info.proto
android_studio_ide_info.proto:15:10: Unrecognized syntax identifier "proto3".  This parser only recognizes "proto2".

Above I mentioned that hacking these *.proto files didn't do any good but before I didn't realized the difference when compared to x86.

Got that part working with protobuf 3.0.0-beta1 on arm64. Rebuilt protobuf and modified scripts to use arm64 binary, as well as use the new jar file from protobuf. However, it then complains about no toolchain for cpu 'unknown'. Guess arm support still needs some work.

Any chance i can get a few pointers? I'm happy putting dev. time into it but since I'm not familiar with the code I'd appreciate some help.

If you got through the protobuf issue, then the next step is to update the CROSSTOOL file to add an arm cpu + associated toolchain.

If you got through the protobuf issue

Nah, still stucked there. protobuf 3.0.0-beta1 not working for me.

Sorry to hear that. We're using checked-in protobuf binaries and runtimes,
so it should build whether you have protobuf installed on your machine or
not. Except on arm, for which we don't have a protobuf compiler checked in.
If you have a protobuf binary for arm compiled from the 3.0.0-beta1
sources, then you should be able to get it to work by patching the
bootstrap script. If that still doesn't work, what's the error message you
get? You might also have to hack the boostrap script to give you more
debugging output.

On Sat, Nov 28, 2015 at 4:27 PM, Víctor Mayoral Vilches <
notifications@github.com> wrote:

If you got through the protobuf issue

Nah, still stucked there. protobuf 3.0.0-beta1 not working for me.


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

@ulfjack thanks for your answer. I'm working on arm. With this in mind and selecting 3.0.0-beta1 protobuf binary compiled from its sources I get: https://gist.github.com/vmayoral/d2447888c5f5051a06db.

That said, I'm not doing any patching in the bootstrap script so that might be it. Could you provide a patch for arm?

What kind of changes are you making to the source tree? Presumably you need
to put in at least the custom protobuf binary into third_party/protobuf,
right?

On Mon, Nov 30, 2015 at 10:16 AM, Víctor Mayoral Vilches <
notifications@github.com> wrote:

@ulfjack https://github.com/ulfjack thanks for your answer. I'm working
on arm. With this in mind and selecting 3.0.0-beta1 protobuf binary
compiled from its sources I get:
https://gist.github.com/vmayoral/d2447888c5f5051a06db.

That said, I'm not doing any patching in the bootstrap script so that
might be it. Could you provide a patch for arm?


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

Note that we're using alpha-3 not beta-1;
the third_party/protobuf/protobuf-java-3.0.0-alpha-3.jar file needs to
match the third_party/protobuf/protoc-*.exe binary.

On Mon, Nov 30, 2015 at 10:31 AM, Ulf Adams ulfjack@google.com wrote:

What kind of changes are you making to the source tree? Presumably you
need to put in at least the custom protobuf binary into
third_party/protobuf, right?

On Mon, Nov 30, 2015 at 10:16 AM, Víctor Mayoral Vilches <
notifications@github.com> wrote:

@ulfjack https://github.com/ulfjack thanks for your answer. I'm
working on arm. With this in mind and selecting 3.0.0-beta1 protobuf
binary compiled from its sources I get:
https://gist.github.com/vmayoral/d2447888c5f5051a06db.

That said, I'm not doing any patching in the bootstrap script so that
might be it. Could you provide a patch for arm?


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

@ulfjack,

To make sure we're on the same page, here's a walkthrough on my process:

Just learned that there's support only for 64 bit systems. Guess that explains it.

What? Who or what only supports 64-bit systems? Java protobufs should work on any system that has a compliant JVM installed.

Let me see if I can run this in an emulator...

Ok, I have an ARM env in qemu now, using the instructions from here:
http://hblok.net/blog/posts/2014/02/06/chroot-to-arm/

That's great, thanks for setting that up @ulfjack.

Java protobufs should work on any system that has a compliant JVM installed.

Great to hear.

Well, it's hang-crashing when it's trying to run javac in qemu, but it otherwise seems to work. I was able to manually compile the Java code with my host javac (rather than the emulated one).

If you're using v3.0.0-alpha-3 protoc, then there's no need to replace the jar file in third_party/protobuf.

I did these steps:

I have a bazel binary now, but it - unsurprisingly - hangs when it starts Java. I think qemu and Java just don't play together.

Well, I got a help message from Bazel now, but I had to disable the jit compiler to get it to work.

Reproducing your steps in a scaleway ARM32 machine.

root@erle-ubuntu-arm:~/bazel-0.1.1# ./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...
.................................
INFO: Found 1 target...
INFO: From Compiling third_party/ijar/classfile.cc [for host]:
third_party/ijar/classfile.cc: In member function 'virtual void devtools_ijar::InnerClassesAttribute::Write(devtools_ijar::u1*&)':
third_party/ijar/classfile.cc:491:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (int i_entry = 0; i_entry < entries_.size(); ++i_entry) {
                                                     ^
third_party/ijar/classfile.cc:512:47: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     } while (entry_count != kept_entries.size());
                                               ^
third_party/ijar/classfile.cc: In member function 'virtual void devtools_ijar::ArrayTypeElementValue::ExtractClassNames()':
third_party/ijar/classfile.cc:635:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < values_.size(); i++) {
                                      ^
third_party/ijar/classfile.cc: In member function 'virtual void devtools_ijar::AnnotationsAttribute::ExtractClassNames()':
third_party/ijar/classfile.cc:1044:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < annotations_.size(); i++) {
                                           ^
third_party/ijar/classfile.cc: In member function 'virtual void devtools_ijar::TypeAnnotationsAttribute::ExtractClassNames()':
third_party/ijar/classfile.cc:1127:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < type_annotations_.size(); i++) {
                                                ^
third_party/ijar/classfile.cc: In member function 'void devtools_ijar::HasAttrs::ExtractClassNames()':
third_party/ijar/classfile.cc:1184:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < attributes.size(); i++) {
                                         ^
third_party/ijar/classfile.cc: In member function 'void devtools_ijar::ClassFile::WriteClass(devtools_ijar::u1*&)':
third_party/ijar/classfile.cc:1742:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < members.size(); i++) {
                                    ^
INFO: From Executing genrule //src/main/native:copy_link_jni_md_header:
unshare failed with EINVAL even after 101 tries, giving up.
ERROR: /root/bazel-0.1.1/src/main/native/BUILD:1:1: Executing genrule //src/main/native:copy_link_jni_md_header failed: bash failed: error executing command /bin/bash -c 'source tools/genrule/genrule-setup.sh; cp -f external/local-jdk/include/linux/jni_md.h bazel-out/local_linux-fastbuild/genfiles/src/main/native/jni_md.h'.
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 58.023s, Critical Path: 26.81s

Building output/bazel

Thanks @ulfjack seems promising. There's a bazel binary that seems to work good. Will keep reviewing.

To follow up with tensorflow/tensorflow#254.

I've tried compiling TensorFlow with bazel but have failed:

root@erle-ubuntu-arm:~/tensorflow# ../bazel-0.1.1/output/bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
ERROR: Loading of target '//tools/cpp:toolchain' failed; build aborted: no such package 'tools/cpp': BUILD file not found on package path.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.095s

There seems to be something wrong (probably related to the error above) with bazel:

root@erle-ubuntu-arm:~/tensorflow# ../bazel-0.1.1/output/bazel version
ERROR: Version information not available.

@ulfjack could you try reproducing?

The non bootstrapped version of the binary is incomplete. C++ CROSSTOOL
file (in tools/cpp/CROSSTOOL) probably needs to be adapted.

On Tue, Dec 1, 2015 at 3:29 PM Víctor Mayoral Vilches <
notifications@github.com> wrote:

To follow up with tensorflow/tensorflow#254
tensorflow/tensorflow#254.

I've tried compiling TensorFlow with bazel but have failed:

root@erle-ubuntu-arm:~/tensorflow# ../bazel-0.1.1/output/bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
ERROR: Loading of target '//tools/cpp:toolchain' failed; build aborted: no such package 'tools/cpp': BUILD file not found on package path.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.095s

There seems to be something wrong (probably related to the error above)
with bazel:

root@erle-ubuntu-arm:~/tensorflow# ../bazel-0.1.1/output/bazel version
ERROR: Version information not available.

@ulfjack https://github.com/ulfjack could you try reproducing?


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

Well, the bootstrap posted above failed because it couldn't unshare (that's
the sandboxing code). The next step is to take the output/bazel binary and
use it to build the proper bazel binary:
bazel build //src:bazel

Do you get the same failure as before if you try that?

On Tue, Dec 1, 2015 at 3:33 PM, Damien Martin-Guillerez <
notifications@github.com> wrote:

The non bootstrapped version of the binary is incomplete. C++ CROSSTOOL
file (in tools/cpp/CROSSTOOL) probably needs to be adapted.

On Tue, Dec 1, 2015 at 3:29 PM Víctor Mayoral Vilches <
notifications@github.com> wrote:

To follow up with tensorflow/tensorflow#254
tensorflow/tensorflow#254.

I've tried compiling TensorFlow with bazel but have failed:

root@erle-ubuntu-arm:~/tensorflow# ../bazel-0.1.1/output/bazel build -c
opt //tensorflow/tools/pip_package:build_pip_package
ERROR: Loading of target '//tools/cpp:toolchain' failed; build aborted:
no such package 'tools/cpp': BUILD file not found on package path.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.095s

There seems to be something wrong (probably related to the error above)
with bazel:

root@erle-ubuntu-arm:~/tensorflow# ../bazel-0.1.1/output/bazel version
ERROR: Version information not available.

@ulfjack https://github.com/ulfjack could you try reproducing?


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


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

from the bazel directory:

root@erle-ubuntu-arm:~/bazel-0.1.1# ../bazel-0.1.1/output/bazel build //src:bazel
...............................
INFO: Found 1 target...
ERROR: missing input file '//tools/jdk:SingleJar_deploy.jar'.
ERROR: /root/bazel-0.1.1/src/main/native/BUILD:12:1: Executing genrule //src/main/native:copy_link_jni_header failed: bash failed: error executing command /bin/bash -c 'source tools/genrule/genrule-setup.sh; cp -f external/local-jdk/include/jni.h bazel-out/local_linux-fastbuild/genfiles/src/main/native/jni.h'.
ERROR: /root/bazel-0.1.1/src/main/java/BUILD:664:1: //src/main/java:bazel-main: missing input file '//tools/jdk:SingleJar_deploy.jar'.
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /root/bazel-0.1.1/src/main/java/BUILD:664:1 1 input file(s) do not exist.
INFO: Elapsed time: 30.722s, Critical Path: 2.12s

It actually needs the bootstrap code. The correct way to call it is

bazel build --singlejar_top=//src/java_tools/singlejar:bootstrap_deploy.jar \
      --javabuilder_top=//src/java_tools/buildjar:bootstrap_deploy.jar \
      --genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar \
      --ijar_top=//third_party/ijar \
      //src:bazel

Thanks @damienmg, unfortunately it keeps failing. I initially thought that It was running out of memory but after using the --local_resources it seems it's because of a different cause:

root@erle-ubuntu-arm:~/bazel-0.1.1# ../bazel-0.1.1/output/bazel build --singlejar_top=//src/java_tools/singlejar:bootstrap_deploy.jar \
>       --javabuilder_top=//src/java_tools/buildjar:bootstrap_deploy.jar \
>       --genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar \
>       --ijar_top=//third_party/ijar \
>       //src:bazel
INFO: Found 1 target...
INFO: From Executing genrule //src/main/native:copy_link_jni_header:
unshare failed with EINVAL even after 101 tries, giving up.
ERROR: /root/bazel-0.1.1/src/main/native/BUILD:12:1: Executing genrule //src/main/native:copy_link_jni_header failed: bash failed: error executing command /bin/bash -c 'source tools/genrule/genrule-setup.sh; cp -f external/local-jdk/include/jni.h bazel-out/local_linux-fastbuild/genfiles/src/main/native/jni.h'.
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 27.623s, Critical Path: 22.77s
root@erle-ubuntu-arm:~/bazel-0.1.1# 
root@erle-ubuntu-arm:~/bazel-0.1.1# 
root@erle-ubuntu-arm:~/bazel-0.1.1# 
root@erle-ubuntu-arm:~/bazel-0.1.1# 
root@erle-ubuntu-arm:~/bazel-0.1.1# ../bazel-0.1.1/output/bazel build --singlejar_top=//src/java_tools/singlejar:bootstrap_deploy.jar       --javabuilder_top=//src/java_tools/buildjar:bootstrap_de
ploy.jar       --genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar       --ijar_top=//third_party/ijar       //src:bazel
INFO: Found 1 target...
INFO: From Executing genrule //src:java-version:
unshare failed with EINVAL even after 101 tries, giving up.
ERROR: /root/bazel-0.1.1/src/BUILD:47:1: Executing genrule //src:java-version failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped).
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 23.930s, Critical Path: 22.98s
root@erle-ubuntu-arm:~/bazel-0.1.1# ../bazel-0.1.1/output/bazel build --singlejar_top=//src/java_tools/singlejar:bootstrap_deploy.jar       --javabuilder_top=//src/java_tools/buildjar:bootstrap_de
ploy.jar       --genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar       --ijar_top=//third_party/ijar       //src:bazel --local_resources 2048,.5,1.0
INFO: Found 1 target...
INFO: From Executing genrule //src:java-version:
unshare failed with EINVAL even after 101 tries, giving up.
ERROR: /root/bazel-0.1.1/src/BUILD:47:1: Executing genrule //src:java-version failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped).
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 24.169s, Critical Path: 23.52s
root@erle-ubuntu-arm:~/bazel-0.1.1# 
root@erle-ubuntu-arm:~/bazel-0.1.1# 
root@erle-ubuntu-arm:~/bazel-0.1.1# 
root@erle-ubuntu-arm:~/bazel-0.1.1# 
root@erle-ubuntu-arm:~/bazel-0.1.1# ../bazel-0.1.1/output/bazel build --singlejar_top=//src/java_tools/singlejar:bootstrap_deploy.jar       --javabuilder_top=//src/java_tools/buildjar:bootstrap_de
ploy.jar       --genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar       --ijar_top=//third_party/ijar       //src:bazel --local_resources 2048,.5,1.0
INFO: Found 1 target...
INFO: From Executing genrule //src:java-version:
unshare failed with EINVAL even after 101 tries, giving up.
ERROR: /root/bazel-0.1.1/src/BUILD:47:1: Executing genrule //src:java-version failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped).
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 24.044s, Critical Path: 23.27s

Can you add the -s option?

Sure,

root@erle-ubuntu-arm:~/bazel-0.1.1# ../bazel-0.1.1/output/bazel build --singlejar_top=//src/java_tools/singlejar:bootstrap_deploy.jar       --javabuilder_top=//src/java_tools/buildjar:bootstrap_de
ploy.jar       --genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar       --ijar_top=//third_party/ijar       //src:bazel --local_resources 2048,.5,1.0 -s
INFO: Found 1 target...
>>>>> # //src/main/tools:process-tools [action 'Linking src/main/tools/libprocess-tools.a']
(cd /root/.cache/bazel/_bazel_root/1483fe5997360ec69738e4763aa71847/bazel-0.1.1 && \
  exec env - \
  /usr/bin/ar rcsD bazel-out/local_linux-fastbuild/bin/src/main/tools/libprocess-tools.a bazel-out/local_linux-fastbuild/bin/src/main/tools/_objs/process-tools/src/main/tools/process-tools.pic.o)
>>>>> # //src/main/native:copy_link_jni_header [action 'Executing genrule //src/main/native:copy_link_jni_header']
(cd /root/.cache/bazel/_bazel_root/1483fe5997360ec69738e4763aa71847/bazel-0.1.1 && \
  exec env - \
    PATH=/root/bazel-0.1.1/tools/cpp/:/root/bazel-0.1.1:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games \
  /bin/bash -c 'source tools/genrule/genrule-setup.sh; cp -f external/local-jdk/include/jni.h bazel-out/local_linux-fastbuild/genfiles/src/main/native/jni.h')
INFO: From Executing genrule //src/main/native:copy_link_jni_header:
unshare failed with EINVAL even after 101 tries, giving up.
ERROR: /root/bazel-0.1.1/src/main/native/BUILD:12:1: Executing genrule //src/main/native:copy_link_jni_header failed: bash failed: error executing command /bin/bash -c 'source tools/genrule/genrule-setup.sh; cp -f external/local-jdk/include/jni.h bazel-out/local_linux-fastbuild/genfiles/src/main/native/jni.h'.
>>>>> # //src/main/native:copy_link_jni_md_header [action 'Executing genrule //src/main/native:copy_link_jni_md_header']
(cd /root/.cache/bazel/_bazel_root/1483fe5997360ec69738e4763aa71847/bazel-0.1.1 && \
  exec env - \
    PATH=/root/bazel-0.1.1/tools/cpp/:/root/bazel-0.1.1:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games \
  /bin/bash -c 'source tools/genrule/genrule-setup.sh; cp -f external/local-jdk/include/linux/jni_md.h bazel-out/local_linux-fastbuild/genfiles/src/main/native/jni_md.h')
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 23.206s, Critical Path: 22.72s

@damienmg, @ulfjack I'm actually happy providing access to the cloud ARM server that I'm using for testing. If interested, e-mail me (victor at erlerobot.com) your ssh-keys and i'll add you.

Can you add --spawn_strategy=standalone?

root@erle-ubuntu-arm:~/bazel-0.1.1# ../bazel-0.1.1/output/bazel build --singlejar_top=//src/java_tools/singlejar:bootstrap_deploy.jar       --javabuilder_top=//src/java_tools/buildjar:bootstrap_de
ploy.jar       --genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar       --ijar_top=//third_party/ijar       //src:bazel --local_resources 2048,.5,1.0 -s --spawn_strategy=standa
lone
INFO: Found 1 target...
>>>>> # //src/main/tools:process-wrapper [action 'Linking src/main/tools/process-wrapper']
(cd /root/.cache/bazel/_bazel_root/1483fe5997360ec69738e4763aa71847/bazel-0.1.1 && \
  exec env - \
  /usr/bin/gcc -o bazel-out/local_linux-fastbuild/bin/src/main/tools/process-wrapper bazel-out/local_linux-fastbuild/bin/src/main/tools/_objs/process-wrapper/src/main/tools/process-wrapper.pic.o bazel-out/local_linux-fastbuild/bin/src/main/tools/libprocess-tools.a -lm -lstdc++ -B/usr/bin/ -pie -Wl,-z,relro,-z,now -no-canonical-prefixes -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S)
>>>>> # //src/main/tools:namespace-sandbox [action 'Linking src/main/tools/namespace-sandbox']
(cd /root/.cache/bazel/_bazel_root/1483fe5997360ec69738e4763aa71847/bazel-0.1.1 && \
  exec env - \
  /usr/bin/gcc -o bazel-out/local_linux-fastbuild/bin/src/main/tools/namespace-sandbox bazel-out/local_linux-fastbuild/bin/src/main/tools/_objs/namespace-sandbox/src/main/tools/namespace-sandbox.pic.o bazel-out/local_linux-fastbuild/bin/src/main/tools/libprocess-tools.a -lm -lstdc++ -B/usr/bin/ -pie -Wl,-z,relro,-z,now -no-canonical-prefixes -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S)
>>>>> # //src:java-version [action 'Executing genrule //src:java-version']
(cd /root/.cache/bazel/_bazel_root/1483fe5997360ec69738e4763aa71847/bazel-0.1.1 && \
  exec env - \
    PATH=/root/bazel-0.1.1/tools/cpp/:/root/bazel-0.1.1:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games \
  /bin/bash -c 'source tools/genrule/genrule-setup.sh; 
          VERSION_LINE=$(cat bazel-out/local_linux-fastbuild/bin/src/java_toolchain_content | grep target_version);
          JAVA_VERSION=$(echo ${VERSION_LINE} | sed -E '\''s/.*value="([^"])".*/\1/'\'');
          if [ -z "${JAVA_VERSION}" ]; then
            echo "1.8" >bazel-out/local_linux-fastbuild/genfiles/src/java.version  # Java 8 is the default
          elif [[ "${JAVA_VERSION}" =~ ^[0-9]+$ ]]; then
            echo "1.${JAVA_VERSION}" >bazel-out/local_linux-fastbuild/genfiles/src/java.version  # Add 1. before 7 or 8
          else
            echo "${JAVA_VERSION}" >bazel-out/local_linux-fastbuild/genfiles/src/java.version
          fi
          ')
INFO: From Executing genrule //src:java-version:
unshare failed with EINVAL even after 101 tries, giving up.
ERROR: /root/bazel-0.1.1/src/BUILD:47:1: Executing genrule //src:java-version failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped).
>>>>> # //src/main/native:copy_link_jni_header [action 'Executing genrule //src/main/native:copy_link_jni_header']
(cd /root/.cache/bazel/_bazel_root/1483fe5997360ec69738e4763aa71847/bazel-0.1.1 && \
  exec env - \
    PATH=/root/bazel-0.1.1/tools/cpp/:/root/bazel-0.1.1:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games \
  /bin/bash -c 'source tools/genrule/genrule-setup.sh; cp -f external/local-jdk/include/jni.h bazel-out/local_linux-fastbuild/genfiles/src/main/native/jni.h')
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 23.455s, Critical Path: 22.95s

Oh sorry yet another flag to add: --genrule_strategy=standalone

That seemed to succeed https://gist.github.com/vmayoral/a8984a016f489bac8ecf.

For completeness, I'm leaving here the whole command:

../bazel-0.1.1/output/bazel build --singlejar_top=//src/java_tools/singlejar:bootstrap_deploy.jar --javabuilder_top=//src/java_tools/buildjar:bootstrap_de ploy.jar --genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar --ijar_top=//third_party/ijar //src:bazel --local_resources 2048,.5,1.0 -s --spawn_strategy=standa lone --genrule_strategy=standalone

Tried again with TensorFlow and failed one more time:

root@erle-ubuntu-arm:~/tensorflow# ../bazel-0.1.1/output/bazel version
ERROR: Version information not available.
root@erle-ubuntu-arm:~/tensorflow# ../bazel-0.1.1/output/bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
ERROR: Loading of target '//tools/cpp:toolchain' failed; build aborted: no such package 'tools/cpp': BUILD file not found on package path.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.092s

ok Good now let's do the full bootstrap correctly.

cat <<EOF >/tmp/bazelrc
build --spawn_strategy=standalone
build --genrule_strategy=standalone
EOF

export BAZELRC=/tmp/bazelrc
./compile.sh

Ok so seems like we have a bug in sandboxing on ARM

You need to make sure that you use the bootstrapped binary, not the initial binary. Do we actually copy both of them to the same location? We should maybe more clearly indicate that the 'first' output/bazel binary isn't the right one. Maybe add a .preliminary suffix or something like that?

We overwrite the initial one that is just here to bootstrap maybe we should
name them differently indeed.

On Tue, Dec 1, 2015, 7:27 PM Ulf Adams notifications@github.com wrote:

You need to make sure that you use the bootstrapped binary, not the
initial binary. Do we actually copy both of them to the same location? We
should maybe more clearly indicate that the 'first' output/bazel binary
isn't the right one. Maybe add a .preliminary suffix or something like that?


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

Trying to use what was generated before to get TensorFlow compiled with bazel but the process fails over and over:

root@erle-ubuntu-arm:~/tensorflow# ../bazel-0.1.1/output/bazel build -c opt //tensorflow/tools/pip_package:build_pip_package --local_resources 2048,.5,1.0 -s
INFO: Found 1 target...
>>>>> # @re2//:re2 [action 'Compiling external/re2/re2/unicode_groups.cc [for host]']
(cd /root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/tensorflow && \
  exec env - \
    INTERCEPT_LOCALLY_EXECUTABLE=1 \
    PATH=/root/bazel-0.1.1/tools/cpp/:/root/bazel-0.1.1:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -g0 '-std=c++0x' -iquote . -iquote bazel-out/host/genfiles -isystem external/re2 -isystem bazel-out/host/genfiles/external/re2 -isystem tools/cpp/gcc3 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/host/bin/external/re2/_objs/re2/external/re2/re2/unicode_groups.o' -MD -MF bazel-out/host/bin/external/re2/_objs/re2/external/re2/re2/unicode_groups.d -c external/re2/re2/unicode_groups.cc -o bazel-out/host/bin/external/re2/_objs/re2/external/re2/re2/unicode_groups.o)
>>>>> # @png_archive//:configure [action 'Executing genrule @png_archive//:configure [for host]']
(cd /root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/tensorflow && \
  exec env - \
    PATH=/root/bazel-0.1.1/tools/cpp/:/root/bazel-0.1.1:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games \
  /bin/bash -c 'source tools/genrule/genrule-setup.sh; pushd external/png_archive/libpng-1.2.53; workdir=$(mktemp -d -t tmp.XXXXXXXXXX); cp -a * $workdir; pushd $workdir; ./configure --enable-shared=no --with-pic=no; popd; popd; cp $workdir/config.h bazel-out/host/genfiles/external/png_archive/libpng-1.2.53; rm -rf $workdir;')
INFO: From Executing genrule @png_archive//:configure [for host]:
unshare failed with EINVAL even after 101 tries, giving up.
ERROR: /root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/external/png_archive/BUILD:23:1: Executing genrule @png_archive//:configure failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped).
>>>>> # @re2//:re2 [action 'Compiling external/re2/re2/simplify.cc [for host]']
(cd /root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/tensorflow && \
  exec env - \
    INTERCEPT_LOCALLY_EXECUTABLE=1 \
    PATH=/root/bazel-0.1.1/tools/cpp/:/root/bazel-0.1.1:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -g0 '-std=c++0x' -iquote . -iquote bazel-out/host/genfiles -isystem external/re2 -isystem bazel-out/host/genfiles/external/re2 -isystem tools/cpp/gcc3 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/host/bin/external/re2/_objs/re2/external/re2/re2/simplify.o' -MD -MF bazel-out/host/bin/external/re2/_objs/re2/external/re2/re2/simplify.d -c external/re2/re2/simplify.cc -o bazel-out/host/bin/external/re2/_objs/re2/external/re2/re2/simplify.o)
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 36.253s, Critical Path: 33.88s

There seems to be small improvements every time I launch it.

You need to make sure that you use the bootstrapped binary, not the initial binary.

This seems related. @ulfjack, I'm using the bazel/output/bazel tensorflow binary. Should i be using a different one?

The --spawn_strategy=standalone and --genrule_strategy=standalone flags seems to help.

Yeah, this error message means that sandboxing doesn't work:
unshare failed with EINVAL even after 101 tries, giving up.

And the flags are disabling sandboxing:
--spawn_strategy=standalone --genrule_strategy=standalone

Can you make progress now? We should probably have a separate bug that sandboxing doesn't work on linux arm32.

@ulfjack,
I've been successful. Trying now to move from the cloud machine to an embedded board (Raspberry Pi 2) and when trying to compile bazel, get stucked at:

erle@erle-brain-2 ~/bazel-0.1.1 $ ./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..
Compiling Bazel Java code...
/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/bin/javac -classpath third_party/joda_time/joda-time-2.3.jar:third_party/truth/truth-0.27.jar:third_party/java/jdk/langtools/javac.jar:third_party/java/jarjar/jarjar-1.4.jar:third_party/joda-time/joda-time-2.3.jar:third_party/aether/aether-impl-1.0.0.v20140518.jar:third_party/aether/aether-transport-classpath-1.0.0.v20140518.jar:third_party/aether/aether-spi-1.0.0.v20140518.jar:third_party/aether/aether-transport-file-1.0.0.v20140518.jar:third_party/aether/aether-transport-wagon-1.0.0.v20140518.jar:third_party/aether/aether-transport-http-1.0.0.v20140518.jar:third_party/aether/aether-connector-basic-1.0.0.v20140518.jar:third_party/aether/aether-util-1.0.0.v20140518.jar:third_party/aether/aether-api-1.0.0.v20140518.jar:third_party/apache_httpcore/httpcore-4.2.4.jar:third_party/junit/junit-4.11.jar:third_party/hamcrest/hamcrest-core-1.3.jar:third_party/jgit/org.eclipse.jgit-4.0.1.201506240215-r.jar:third_party/guava/guava-testlib.jar:third_party/guava/guava-18.0.jar:third_party/auto/auto-service-1.0-rc2.jar:third_party/auto/auto-value-1.0.jar:third_party/auto/auto-common-0.3.jar:third_party/maven_model/maven-aether-provider-3.2.3.jar:third_party/maven_model/maven-model-3.2.3.jar:third_party/maven_model/maven-repository-metadata-3.2.3.jar:third_party/maven_model/maven-model-builder-3.2.3.jar:third_party/apache_commons_collections/commons-collections-3.2.1.jar:third_party/android_common/com.android.tools.build_builder-model_0.13.3.jar:third_party/android_common/com.android.tools_sdk-common_23.1.3.jar:third_party/android_common/com.android.tools_common_23.1.3.jar:third_party/android_common/com.android.tools.build_manifest-merger_23.1.3.jar:third_party/android_common/com.android.tools.layoutlib_layoutlib_23.1.3.jar:third_party/android_common/com.android.tools.build_builder_0.13.3.jar:third_party/android_common/com.android.tools_sdklib_23.1.3.jar:third_party/apache_commons_logging/commons-logging-1.1.1.jar:third_party/slf4j/slf4j-api-1.7.7.jar:third_party/slf4j/slf4j-jdk14-1.7.7.jar:third_party/maven/maven-settings-builder-3.3.3.jar:third_party/maven/maven-settings-3.3.3.jar:third_party/maven/maven-builder-support-3.3.3.jar:third_party/error_prone/error_prone_core-2.0.5-20150630-51ec2fd.jar:third_party/error_prone/error_prone_annotations-2.0.5-20150630-51ec2fd.jar:third_party/mockito/mockito-all-1.10.19.jar:third_party/apache_commons_compress/apache-commons-compress-1.9.jar:third_party/checker_framework_dataflow/dataflow-1.8.10.jar:third_party/jsr305/jsr-305.jar:third_party/tomcat_annotations_api/tomcat-annotations-api-8.0.5.jar:third_party/jsr330_inject/javax.inject.jar:third_party/plexus_component_annotations/plexus-component-annotations-1.6.jar:third_party/apache_commons_codec/commons-codec-1.9.jar:third_party/gson/gson-2.2.4.jar:third_party/apache_httpclient/httpclient-4.2.5.jar:third_party/plexus_utils/plexus-utils-3.0.21.jar:third_party/plexus_interpolation/plexus-interpolation-1.22.jar:third_party/apache_velocity/velocity-1.7.jar:third_party/asm/asm-5.0.3.jar:third_party/jformatstring/jFormatString-3.0.0.jar:third_party/ijar/test/libwrongcentraldir.jar:third_party/protobuf/protobuf-java-3.0.0-alpha-3.jar:third_party/apache_commons_pool2/commons-pool2-2.3.jar:: -sourcepath src/java_tools/singlejar/java/com/google/devtools/build/zip:src/main/java:src/tools/xcode-common/java/com/google/devtools/build/xcode/common:src/tools/xcode-common/java/com/google/devtools/build/xcode/util:/tmp/bazel.611yCyEo/src -d /tmp/bazel.611yCyEo/classes -source 1.8 -target 1.8 -encoding UTF-8 @/tmp/bazel.djwyM5Lh/param
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
               ^


The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space
    at java.util.HashMap.resize(HashMap.java:703)
    at java.util.HashMap.putVal(HashMap.java:628)
    at java.util.HashMap.put(HashMap.java:611)
    at com.sun.tools.javac.code.Types$ImplementationCache.get(Types.java:2649)
    at com.sun.tools.javac.code.Types.implementation(Types.java:2677)
    at com.sun.tools.javac.code.Symbol$MethodSymbol.implementation(Symbol.java:1516)
    at com.sun.tools.javac.code.Symbol$MethodSymbol.implementation(Symbol.java:1505)
    at com.sun.tools.javac.comp.Resolve.notOverriddenIn(Resolve.java:418)
    at com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:404)
    at com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:364)
    at com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1435)
    at com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1597)
    at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1668)
    at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1641)
    at com.sun.tools.javac.comp.Resolve$9.doLookup(Resolve.java:2397)
    at com.sun.tools.javac.comp.Resolve$BasicLookupHelper.lookup(Resolve.java:3056)
    at com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3307)
    at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2394)
    at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2388)
    at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2383)
    at com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:301)
    at com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:236)
    at com.sun.tools.javac.comp.MemberEnter.actualEnterAnnotations(MemberEnter.java:925)
    at com.sun.tools.javac.comp.MemberEnter.access$600(MemberEnter.java:64)
    at com.sun.tools.javac.comp.MemberEnter$5.run(MemberEnter.java:878)
    at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:143)
    at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:516)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:475)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:985)
    at com.sun.tools.javac.main.JavaCompiler.enterTreesIfNeeded(JavaCompiler.java:968)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1242)

I repeated the process several times and got the same result. Any chance you can advice on which flags/modifications can be made to make it compile?

The system is out of resources.
...
Java heap space

This seems to be the cause. Trying different options, JAVA_ARGS="-Xmx2048m".

Cool! How much memory do you have on the device? You probably want to reduce the number of jobs (--jobs=4 or maybe even fewer), and you can explicitly set how much memory should be available to the Java VM used by Bazel.

@ulfjack

I'm in a pi2:

             total       used       free     shared    buffers     cached
Mem:          862M       101M       761M       6.1M        16M        44M
-/+ buffers/cache:        40M       822M
Swap:          99M         0B        99M

You probably want to reduce the number of jobs (--jobs=4 or maybe even fewer), and you can explicitly set how much memory should be available to the Java VM used by Bazel.

This would be great. Could you point out how and where I can set the available memory to the Java virtual machine?

This is what I'm getting so far:

erle@erle-brain-2 ~/bazel-0.1.1 $ ./compile.sh  build --jobs=4
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..
Compiling Bazel Java code...
/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/bin/javac -classpath third_party/joda_time/joda-time-2.3.jar:third_party/truth/truth-0.27.jar:third_party/java/jdk/langtools/javac.jar:third_party/java/jarjar/jarjar-1.4.jar:third_party/joda-time/joda-time-2.3.jar:third_party/aether/aether-impl-1.0.0.v20140518.jar:third_party/aether/aether-transport-classpath-1.0.0.v20140518.jar:third_party/aether/aether-spi-1.0.0.v20140518.jar:third_party/aether/aether-transport-file-1.0.0.v20140518.jar:third_party/aether/aether-transport-wagon-1.0.0.v20140518.jar:third_party/aether/aether-transport-http-1.0.0.v20140518.jar:third_party/aether/aether-connector-basic-1.0.0.v20140518.jar:third_party/aether/aether-util-1.0.0.v20140518.jar:third_party/aether/aether-api-1.0.0.v20140518.jar:third_party/apache_httpcore/httpcore-4.2.4.jar:third_party/junit/junit-4.11.jar:third_party/hamcrest/hamcrest-core-1.3.jar:third_party/jgit/org.eclipse.jgit-4.0.1.201506240215-r.jar:third_party/guava/guava-testlib.jar:third_party/guava/guava-18.0.jar:third_party/auto/auto-service-1.0-rc2.jar:third_party/auto/auto-value-1.0.jar:third_party/auto/auto-common-0.3.jar:third_party/maven_model/maven-aether-provider-3.2.3.jar:third_party/maven_model/maven-model-3.2.3.jar:third_party/maven_model/maven-repository-metadata-3.2.3.jar:third_party/maven_model/maven-model-builder-3.2.3.jar:third_party/apache_commons_collections/commons-collections-3.2.1.jar:third_party/android_common/com.android.tools.build_builder-model_0.13.3.jar:third_party/android_common/com.android.tools_sdk-common_23.1.3.jar:third_party/android_common/com.android.tools_common_23.1.3.jar:third_party/android_common/com.android.tools.build_manifest-merger_23.1.3.jar:third_party/android_common/com.android.tools.layoutlib_layoutlib_23.1.3.jar:third_party/android_common/com.android.tools.build_builder_0.13.3.jar:third_party/android_common/com.android.tools_sdklib_23.1.3.jar:third_party/apache_commons_logging/commons-logging-1.1.1.jar:third_party/slf4j/slf4j-api-1.7.7.jar:third_party/slf4j/slf4j-jdk14-1.7.7.jar:third_party/maven/maven-settings-builder-3.3.3.jar:third_party/maven/maven-settings-3.3.3.jar:third_party/maven/maven-builder-support-3.3.3.jar:third_party/error_prone/error_prone_core-2.0.5-20150630-51ec2fd.jar:third_party/error_prone/error_prone_annotations-2.0.5-20150630-51ec2fd.jar:third_party/mockito/mockito-all-1.10.19.jar:third_party/apache_commons_compress/apache-commons-compress-1.9.jar:third_party/checker_framework_dataflow/dataflow-1.8.10.jar:third_party/jsr305/jsr-305.jar:third_party/tomcat_annotations_api/tomcat-annotations-api-8.0.5.jar:third_party/jsr330_inject/javax.inject.jar:third_party/plexus_component_annotations/plexus-component-annotations-1.6.jar:third_party/apache_commons_codec/commons-codec-1.9.jar:third_party/gson/gson-2.2.4.jar:third_party/apache_httpclient/httpclient-4.2.5.jar:third_party/plexus_utils/plexus-utils-3.0.21.jar:third_party/plexus_interpolation/plexus-interpolation-1.22.jar:third_party/apache_velocity/velocity-1.7.jar:third_party/asm/asm-5.0.3.jar:third_party/jformatstring/jFormatString-3.0.0.jar:third_party/ijar/test/libwrongcentraldir.jar:third_party/protobuf/protobuf-java-3.0.0-alpha-3.jar:third_party/apache_commons_pool2/commons-pool2-2.3.jar:: -sourcepath src/java_tools/singlejar/java/com/google/devtools/build/zip:src/main/java:src/tools/xcode-common/java/com/google/devtools/build/xcode/common:src/tools/xcode-common/java/com/google/devtools/build/xcode/util:/tmp/bazel.YjylIZUu/src -d /tmp/bazel.YjylIZUu/classes -source 1.8 -target 1.8 -encoding UTF-8 @/tmp/bazel.Q1B5I1ZY/param
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:19: warning: Signal is internal proprietary API and may be removed in a future release
import sun.misc.Signal;
               ^
src/main/java/com/google/devtools/build/lib/server/signal/InterruptSignalHandler.java:20: warning: SignalHandler is internal proprietary API and may be removed in a future release
import sun.misc.SignalHandler;
               ^


The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space
    at java.util.LinkedHashMap$LinkedValues.iterator(LinkedHashMap.java:588)
    at com.sun.tools.javac.code.SymbolMetadata.getAttributesForCompletion(SymbolMetadata.java:175)
    at com.sun.tools.javac.code.SymbolMetadata.setDeclarationAttributesWithCompletion(SymbolMetadata.java:162)
    at com.sun.tools.javac.code.Symbol.setDeclarationAttributesWithCompletion(Symbol.java:215)
    at com.sun.tools.javac.comp.MemberEnter.actualEnterAnnotations(MemberEnter.java:954)
    at com.sun.tools.javac.comp.MemberEnter.access$600(MemberEnter.java:64)
    at com.sun.tools.javac.comp.MemberEnter$5.run(MemberEnter.java:878)
    at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:143)
    at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:516)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:475)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:985)
    at com.sun.tools.javac.main.JavaCompiler.enterTreesIfNeeded(JavaCompiler.java:968)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1242)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1173)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:859)
    at com.sun.tools.javac.main.Main.compile(Main.java:523)
    at com.sun.tools.javac.main.Main.compile(Main.java:381)
    at com.sun.tools.javac.main.Main.compile(Main.java:370)
    at com.sun.tools.javac.main.Main.compile(Main.java:361)
    at com.sun.tools.javac.Main.compile(Main.java:56)
    at com.sun.tools.javac.Main.main(Main.java:42)
cat <<EOF >/tmp/bazelrc
build --jobs=4
EOF

export BAZELRC=/tmp/bazelrc
./compile.sh

Oh, darn. That's the Javac invocation from the bootstrap, not bazel. The bootstrap compile bundles everything into a single javac run, and that might be pretty big.

You should take a look at the files in scripts/bootstrap/, specifically compile.sh:212.

The bootstrap compile bundles everything into a single javac run, and that might be pretty big.

You mean that The system is out of resources.could be related to disk space and not RAM?

No, it's most definitely RAM. I'm just saying that small tweaks may not be
sufficient. The Java compiler may literally need more RAM than you have
available for a compile that size. If so, we have to split up the compile
(meh), because I don't think we can fix Javac. Well, you could do a
cross-compile instead, if that's an option.

On Thu, Dec 3, 2015 at 4:16 PM, Víctor Mayoral Vilches <
notifications@github.com> wrote:

The bootstrap compile bundles everything into a single javac run, and that
might be pretty big.

You mean that The system is out of resources.could be related to disk
space and not RAM?


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

Here's a summary of my failures so far (target platform: Raspberry Pi 2):

Bazel/TensorFlow native compilation in the Raspberry Pi 2

Thanks @danbri but still not enough resources. Tried with different swap sizes.

Bazel cross-compiled, copied and used to build TensorFlow

@ulfjack, tried cross-compilation also. Then scped the files. Bazel seems good to me (but I by no means am able to introspect it properly). When trying it:

erle@erle-brain-2 ~/tensorflow $ ../bazel-0.1.1/output/bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
..............................................................................
INFO: Waiting for response from Bazel server (pid 13953)...
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.io/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
ERROR: Loading of target '//tools/cpp:toolchain' failed; build aborted: no such package 'tools/cpp': BUILD file not found on package path.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 6.268s

Which seemed similar to what was described above. Tried to solve it as I did previously but failed.

TensorFlow armv7l cross-compiled

As follows from the discussion above, I've got an armv7l wheel file (generated with Python 2.7.6) . Tried copying into the target platform (Raspberry Pi 2 with Python 2.7.9).

erle@erle-brain-2 ~/tensorflow_pkg $ sudo pip install tensorflow-0.5.0-py2-none-any.whl 
Processing ./tensorflow-0.5.0-py2-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from tensorflow==0.5.0)
Collecting protobuf==3.0.0a3 (from tensorflow==0.5.0)
  Downloading protobuf-3.0.0a3.tar.gz (88kB)
    100% |████████████████████████████████| 90kB 374kB/s 
Requirement already satisfied (use --upgrade to upgrade): wheel in /usr/lib/python2.7/dist-packages (from tensorflow==0.5.0)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.8.2 in /usr/lib/python2.7/dist-packages (from tensorflow==0.5.0)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python2.7/dist-packages (from protobuf==3.0.0a3->tensorflow==0.5.0)
Building wheels for collected packages: protobuf
  Running setup.py bdist_wheel for protobuf
  Stored in directory: /root/.cache/pip/wheels/eb/03/a7/4957f6b33d38cbf9c5ee52e8956cbfd2ec2c300b7243478b09
Successfully built protobuf
Installing collected packages: protobuf, tensorflow
Successfully installed protobuf-3.0.0a3 tensorflow-0.5.0

Installation doesn't look bad. But then when trying simple examples i get a segmentation fault so something break along the way. E.g. https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/1 - Introduction/helloworld.py produces:

erle@erle-brain-2 ~/TensorFlow-Examples/examples/1 - Introduction $ python helloworld.py 
I tensorflow/core/common_runtime/local_device.cc:40] Local device intra op parallelism threads: 4
Segmentation fault

Not much information so tried gdb:

erle@erle-brain-2 ~/TensorFlow-Examples/examples/1 - Introduction $ gdb -ex r --args python helloworld.py
GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...(no debugging symbols found)...done.
Starting program: /usr/bin/python helloworld.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x73fb1d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
(gdb) bt
#0  0x73fb1d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#1  0x73fae3f4 in OPENSSL_cpuid_setup () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#2  0x76fdf058 in call_init (l=<optimized out>, argc=2, argv=0x7efff184, env=0x7efff190) at dl-init.c:78
#3  0x76fdf134 in _dl_init (main_map=main_map@entry=0x8f0f08, argc=2, argv=0x7efff184, env=0x7efff190) at dl-init.c:126
#4  0x76fe36b4 in dl_open_worker (a=<optimized out>) at dl-open.c:577
#5  0x76fdeef0 in _dl_catch_error (objname=0x76fdeef0 <_dl_catch_error+112>, objname@entry=0x7effcc04, errstring=0x76ff6510, errstring@entry=0x7effcc08, mallocedp=0x7effcc04, 
    mallocedp@entry=0x7effcc03, operate=0x7effcc03, args=args@entry=0x7effcc0c) at dl-error.c:187
#6  0x76fe2da4 in _dl_open (file=0x8f1a68 "/usr/lib/python2.7/lib-dynload/_hashlib.arm-linux-gnueabihf.so", mode=-2147483646, caller_dlopen=0x10aa94 <_PyImport_GetDynLoadFunc+272>, nsid=-2, 
    argc=2, argv=0x7efff184, env=0x7efff190) at dl-open.c:661
#7  0x76f66ba8 in dlopen_doit (a=0x7effce58) at dlopen.c:66
#8  0x76fdeef0 in _dl_catch_error (objname=0x76fdeef0 <_dl_catch_error+112>, errstring=0x76ff6510, mallocedp=0x3832b4, operate=0x3832b0, args=0x7effce58) at dl-error.c:187
#9  0x76f672a8 in _dlerror_run (operate=0x76f66b28 <dlopen_doit>, args=args@entry=0x7effce58) at dlerror.c:163
#10 0x76f66c74 in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87
#11 0x0010aa94 in _PyImport_GetDynLoadFunc ()
#12 0x0010a338 in _PyImport_LoadDynamicModule ()
#13 0x00067844 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Differences between the machined used to cross-compile and the target one:

  • Python version: Python 2.7.9 vs Python 2.7.6. Don't think this is the main cause.
  • libgcrypt11 vs libgcrypt20. This seem to be a major issue so I may put some time into cross-compiling everything again in another system with libgcrypt20 by default.

It's not enough to copy over the bazel binary, you also need to copy over
the tools/ directory and either add it to the client or set up
--package_path to point to the parent directory of the tools/ directory
(wherever you copy it).

On Fri, Dec 4, 2015 at 4:24 PM, Víctor Mayoral Vilches <
notifications@github.com> wrote:

Here's a summary of my failures so far (target platform: Raspberry Pi 2):
Bazel/TensorFlow native compilation in the Raspberry Pi 2

Thanks @danbri https://github.com/danbri but still not enough
resources. Tried with different swap sizes.
Bazel cross-compiled, copied and used to build TensorFlow

@ulfjack https://github.com/ulfjack, tried cross-compilation also. Then
scped the files. Bazel seems good to me (but I by no means am able to
introspect it properly). When trying it:

erle@erle-brain-2 ~/tensorflow $ ../bazel-0.1.1/output/bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
..............................................................................
INFO: Waiting for response from Bazel server (pid 13953)...
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.io/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
ERROR: Loading of target '//tools/cpp:toolchain' failed; build aborted: no such package 'tools/cpp': BUILD file not found on package path.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 6.268s

Which seemed similar to what was described above. Tried to solve it as I
did previously but failed
https://gist.github.com/vmayoral/36c45b9602c2dba14180.
TensorFlow armv7l cross-compiled

As follows from the discussion above, I've got an armv7l wheel file
(generated with Python 2.7.6) . Tried copying into the target platform
(Raspberry Pi 2 with Python 2.7.9).

erle@erle-brain-2 ~/tensorflow_pkg $ sudo pip install tensorflow-0.5.0-py2-none-any.whl
Processing ./tensorflow-0.5.0-py2-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from tensorflow==0.5.0)
Collecting protobuf==3.0.0a3 (from tensorflow==0.5.0)
Downloading protobuf-3.0.0a3.tar.gz (88kB)
100% |████████████████████████████████| 90kB 374kB/s
Requirement already satisfied (use --upgrade to upgrade): wheel in /usr/lib/python2.7/dist-packages (from tensorflow==0.5.0)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.8.2 in /usr/lib/python2.7/dist-packages (from tensorflow==0.5.0)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python2.7/dist-packages (from protobuf==3.0.0a3->tensorflow==0.5.0)
Building wheels for collected packages: protobuf
Running setup.py bdist_wheel for protobuf
Stored in directory: /root/.cache/pip/wheels/eb/03/a7/4957f6b33d38cbf9c5ee52e8956cbfd2ec2c300b7243478b09
Successfully built protobuf
Installing collected packages: protobuf, tensorflow
Successfully installed protobuf-3.0.0a3 tensorflow-0.5.0

Installation doesn't look bad. But then when trying simple examples i get
a segmentation fault so something break along the way. E.g.
https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/1

  • Introduction/helloworld.py produces:

erle@erle-brain-2 ~/TensorFlow-Examples/examples/1 - Introduction $ python helloworld.py
I tensorflow/core/common_runtime/local_device.cc:40] Local device intra op parallelism threads: 4
Segmentation fault

Not much information so tried gdb:

erle@erle-brain-2 ~/TensorFlow-Examples/examples/1 - Introduction $ gdb -ex r --args python helloworld.py
GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...(no debugging symbols found)...done.
Starting program: /usr/bin/python helloworld.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x73fb1d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
(gdb) bt
#0 0x73fb1d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#1 0x73fae3f4 in OPENSSL_cpuid_setup () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#2 0x76fdf058 in call_init (l=, argc=2, argv=0x7efff184, env=0x7efff190) at dl-init.c:78
#3 0x76fdf134 in _dl_init (main_map=main_map@entry=0x8f0f08, argc=2, argv=0x7efff184, env=0x7efff190) at dl-init.c:126
#4 0x76fe36b4 in dl_open_worker (a=) at dl-open.c:577
#5 0x76fdeef0 in _dl_catch_error (objname=0x76fdeef0 <_dl_catch_error+112>, objname@entry=0x7effcc04, errstring=0x76ff6510, errstring@entry=0x7effcc08, mallocedp=0x7effcc04,
mallocedp@entry=0x7effcc03, operate=0x7effcc03, args=args@entry=0x7effcc0c) at dl-error.c:187
#6 0x76fe2da4 in _dl_open (file=0x8f1a68 "/usr/lib/python2.7/lib-dynload/_hashlib.arm-linux-gnueabihf.so", mode=-2147483646, caller_dlopen=0x10aa94 <_PyImport_GetDynLoadFunc+272>, nsid=-2,
argc=2, argv=0x7efff184, env=0x7efff190) at dl-open.c:661
#7 0x76f66ba8 in dlopen_doit (a=0x7effce58) at dlopen.c:66
#8 0x76fdeef0 in _dl_catch_error (objname=0x76fdeef0 <_dl_catch_error+112>, errstring=0x76ff6510, mallocedp=0x3832b4, operate=0x3832b0, args=0x7effce58) at dl-error.c:187
#9 0x76f672a8 in _dlerror_run (operate=0x76f66b28 <dlopen_doit>, args=args@entry=0x7effce58) at dlerror.c:163
#10 0x76f66c74 in __dlopen (file=, mode=) at dlopen.c:87
#11 0x0010aa94 in _PyImport_GetDynLoadFunc ()
#12 0x0010a338 in _PyImport_LoadDynamicModule ()
#13 0x00067844 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Differences between the machined used to cross-compile and the target one:

  • Python version: Python 2.7.9 vs Python 2.7.6. Don't think this is
    the main cause.
  • libgcrypt11 vs libgcrypt20. This seem to be a major issue so I may
    put some time into cross-compiling everything again in another system with
    libgcrypt20 by default.


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

@ulfjack thanks for the quick answer. Copied the whole bazel-0.1.1 directory (about 3 GB with the symbolic links all together). Still not working, seems a library issue.

@vmayoral perhaps you could post the error messages?

Since this latest step is more a TensorFlow issue than a bazel one, i've opened a new issue at tensorflow/tensorflow#445.

I'd say this issue has been addressed so we can close it.

Hi @vmayoral, how about use Qemu + Docker to bring up the development environment ? I use it, but still have out of memory fail event.
http://www.slideshare.net/philipzh/docker-qemu-on-x86-for-raspberry-pi

@philipz How did you get Java to work with QEMU? I tried running a build with a RPI image in QEMU, but Java consistently crashed on me.

@ulfjack , Java and Golang both work, check out this great article.
https://resin.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/

From a quick look, I did all that, but Java didn't work. Maybe I did something wrong somewhere?

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie
Kernel version: Linux version 4.9.28-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #998 SMP Mon May 15 16:55:39 BST 2017

Bazel build release version: https://github.com/bazelbuild/bazel/releases/tag/0.5.2

I tried recently, getting error:
ERROR: /home/pi/bazel052/src/tools/singlejar/BUILD:289:1: C++ compilation of rule '//src/tools/singlejar:output_jar' failed: gcc failed: error executing command
(cd /tmp/bazel_r7D59c2q/out/execroot/io_bazel &&
exec env -
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
PWD=/proc/self/cwd
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction
-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/local-opt/bin/src/tools/singlejar/objs/output_jar/src/tools/singlejar/output_jar.d '-frandom-seed=bazel-out/local-opt/bin/src/tools/singlejar/obj
s/output_jar/src/tools/singlejar/output_jar.o' -DBLAZE_OPENSOURCE -iquote . -iquote bazel-out/local-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local-opt/genfiles/external/bazel_tools -isy
stem third_party/zlib -isystem bazel-out/local-opt/genfiles/third_party/zlib -isystem external/bazel_tools/tools/cpp/gcc3 -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE
="redacted"'
'-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/tools/singlejar/output_jar.cc -o bazel-out/local-opt/bin/src/tools/singlejar/objs/output_jar/src/tools/singlejar/output_jar.o): com.google.dev
tools.build.lib.shell.BadExitStatusException: Process exited with status 1.
In file included from ./src/tools/singlejar/input_jar.h:26:0,
from src/tools/singlejar/output_jar.cc:30:
./src/tools/singlejar/mapped_file.h:39:2: error: #error This code for 64 bit Unix.
#error This code for 64 bit Unix.
^
In file included from ./src/tools/singlejar/transient_bytes.h:23:0,
from ./src/tools/singlejar/combiners.h:21,
from ./src/tools/singlejar/output_jar.h:25,
from src/tools/singlejar/output_jar.cc:18:
./src/tools/singlejar/transient_bytes.h: In member function 'uint8_t* TransientBytes::advance(size_t)':
./src/tools/singlejar/diag.h:25:40: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=]
#define diag_errx(...) errx(VA_ARGS)
^
./src/tools/singlejar/transient_bytes.h:280:7: note: in expansion of macro 'diag_errx'
diag_errx(2, "%s: %d: Cannot advance %ld bytes, only %" PRIu64
^
src/tools/singlejar/output_jar.cc: In member function 'int OutputJar::Doit(Options*)':
src/tools/singlejar/output_jar.cc:102:70: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'std::vector<std::basic_string >::size_type {aka unsigned int}' [-Wformat
=]
fprintf(stderr, "%ld source files\n", options
->input_jars.size());
^
src/tools/singlejar/output_jar.cc:103:76: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'std::vector<std::basic_string >::size_type {aka unsigned int}' [-Wformat
=]
fprintf(stderr, "%ld manifest lines\n", options_->manifest_lines.size());
^
In file included from ./src/tools/singlejar/transient_bytes.h:23:0,
from ./src/tools/singlejar/combiners.h:21,
from ./src/tools/singlejar/output_jar.h:25,
from src/tools/singlejar/output_jar.cc:18:
./src/tools/singlejar/diag.h:24:38: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'ssize_t {aka int}' [-Wformat=]
#define diag_err(...) err(VA_ARGS)
^
src/tools/singlejar/output_jar.cc:126:7: note: in expansion of macro 'diag_err'
diag_err(1, "%s:%d: Copied only %ld bytes out of %" PRIu64 " from %s",
^
./src/tools/singlejar/diag.h:24:38: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type '__off_t {aka long int}' [-Wformat=]
#define diag_err(...) err(VA_ARGS)
^
src/tools/singlejar/output_jar.cc:126:7: note: in expansion of macro 'diag_err'
diag_err(1, "%s:%d: Copied only %ld bytes out of %" PRIu64 " from %s",
^
src/tools/singlejar/output_jar.cc:132:30: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'off_t {aka long int}' [-Wformat=]
statbuf.st_size);
^
src/tools/singlejar/output_jar.cc:238:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int ix = 0; ix < options
->input_jars.size(); ++ix) {
^
In file included from ./src/tools/singlejar/transient_bytes.h:23:0,
from ./src/tools/singlejar/combiners.h:21,
from ./src/tools/singlejar/output_jar.h:25,
from src/tools/singlejar/output_jar.cc:18:
src/tools/singlejar/output_jar.cc: In member function 'bool OutputJar::AddJar(int)':
./src/tools/singlejar/diag.h:24:38: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=]
#define diag_err(...) err(VA_ARGS)
^
src/tools/singlejar/output_jar.cc:477:7: note: in expansion of macro 'diag_err'
diag_err(1, "%s:%d: Cannot write %ld bytes of %.s from %s", FILE,
^
src/tools/singlejar/output_jar.cc: In member function 'void OutputJar::WriteEntry(void
)':
src/tools/singlejar/output_jar.cc:513:42: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=]
entry->compressed_file_size());
^
src/tools/singlejar/output_jar.cc:513:42: warning: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'size_t {aka unsigned int}' [-Wformat=]
src/tools/singlejar/output_jar.cc: In member function 'void OutputJar::AppendToDirectoryBuffer(const CDH*, off_t, uint16_t, bool)':
src/tools/singlejar/output_jar.cc:710:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
int copy_count = out_zip64_attr_count < zip64_attr_count
^
In file included from ./src/tools/singlejar/transient_bytes.h:23:0,
from ./src/tools/singlejar/combiners.h:21,
from ./src/tools/singlejar/output_jar.h:25,
from src/tools/singlejar/output_jar.cc:18:
src/tools/singlejar/output_jar.cc: In member function 'uint8_t* OutputJar::ReserveCdr(size_t)':
./src/tools/singlejar/diag.h:25:40: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=]
#define diag_errx(...) errx(VA_ARGS)
^
src/tools/singlejar/output_jar.cc:738:7: note: in expansion of macro 'diag_errx'
diag_errx(1, "%s:%d: Cannot allocate %ld bytes for the directory",
^
src/tools/singlejar/output_jar.cc: In member function 'bool OutputJar::Close()':
src/tools/singlejar/output_jar.cc:768:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
bool write_zip64_ecd = output_position >= 0xFFFFFFFF || entries
>= 0xFFFF ||
^
src/tools/singlejar/output_jar.cc: In member function 'ssize_t OutputJar::AppendFile(int, off_t, size_t)':
src/tools/singlejar/output_jar.cc:884:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while (total_written < count) {
^
Target //src:bazel failed to build
INFO: Elapsed time: 2288.515s, Critical Path: 222.73s

ERROR: Could not build Bazel

download the binary for armv7l(pi 3) with this link below
https://drive.google.com/open?id=0B7NeIJaVzSxIZmZHUnVzZjBjVDg