Closed protossw512 closed 5 years ago
CC @meisterT @iirina
attn @ArielleA
Re building from scratch:
Seems that we propagate the 'aarch64' correctly during autoconfiguration, but when Bazel tries to detect the current architecture using Java system properties, os.arch
returns 'arm' instead of 'aarch64'. If this is the case, you can change the os.arch
property to 'aarch64' to match the output from uname -m
.
@protossw512 - which Java JDK are you using?
@vielmetti unfortunately we switched to another embedded system and this system is not in my hand right now, but I remember the JDK is installed with apt-get in ubuntu 16.04.
Thanks @protossw512 - I know there are a number of choices for a JDK these days, and wonder if we can figure out if this problem is isolated to that distribution or more widespread.
@vielmetti I also recall I installed dependencies with the command provided from official website:
sudo apt-get install build-essential openjdk-8-jdk python zip unzip
Not sure if it is helpful.
This is unlikely to be an issue with the host, but instead the embedded jdk. I'll have to have a look at where the problem is coming from.
@ArielleA I think you are right, I am trying to build the same bazel version on another embedded system with similar chipset, the building process ended up without any issue.
$ hostnamectl
Static hostname: localhost.localdomain
Icon name: computer
Machine ID: 019126b158794aa0a917f58462e27699
Boot ID: fddeda07e24243869fac709bcb9a7b7d
Operating System: Fedora 28 (Server Edition)
CPE OS Name: cpe:/o:fedoraproject:fedora:28
Kernel: Linux 4.4.167
Architecture: arm64
$ uname -m
aarch64
$ java -version
openjdk version "1.8.0_201"
OpenJDK Runtime Environment (build 1.8.0_201-b09)
OpenJDK 64-Bit Server VM (build 25.201-b09, mixed mode)
Just check both systems are running 64 bit userland with getconf LONG_BIT
that could cause all kinds of weirdness.
I just built 0.25.2 in both Debian Stretch and Ubuntu bionic without any issue on aarch64 as part of #8143. Could you check you're still having issues, it may be due to memory exhaustion.
@ArielleA Thank you for the follow-ups, I tried again and there is no problem at all.
Same issue, but with "arm" instead of "armv6l". (I am not sure this is really caused by the same issue.)
pi@raspberrypi:~/bazel-dist $ env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" BAZEL_JAVAC_OPTS="-J-Xmx512M -J-Xms512M" bash ./compile.sh 🍃 Building Bazel from scratch.. .... 🍃 Building Bazel with Bazel. .WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown". DEBUG: /tmp/bazel_55EbxDW9/out/external/build_bazel_rules_nodejs/internal/common/check_bazel_version.bzl:49:5: Current Bazel is not a release version, cannot check for compatibility. DEBUG: /tmp/bazel_55EbxDW9/out/external/build_bazel_rules_nodejs/internal/common/check_bazel_version.bzl:51:5: Make sure that you are running at least Bazel 0.17.1. ERROR: /tmp/bazel_55EbxDW9/out/external/local_config_cc/BUILD:46:1: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'arm' ERROR: Analysis of target '//src:bazel_nojdk' failed; build aborted: Analysis of target '@local_config_cc//:toolchain' failed; build aborted INFO: Elapsed time: 71.657s INFO: 0 processes. FAILED: Build did NOT complete successfully (16 packages loaded, 65 targets co\ nfigured) ERROR: Could not build Bazel
On a Raspberry Pi Zero W, Rasbpian OS (Debian) 9 Stretch kernel 4.19.42+ 32bit - bazel-0.26.1-dist
This is the verbose
🍃 Building Bazel from scratch../usr/lib/jvm/java-8-openjdk-armhf/bin/javac -classpath third_party/flogger/flogger-system-backend-0.3.1.jar:third_party/flogger/flogger-0.3.1.jar:third_party/flogger/google-extensions-0.3.1.jar:third_party/checker_framework_annotations/checker-compat-qual-2.6.0.jar:third_party/checker_framework_annotations/checker-qual-2.6.0.jar:third_party/jackson2/jackson-core-2.8.6.jar:third_party/jimfs/jimfs-1.1.jar:third_party/apache_velocity/velocity-1.7.jar:third_party/hamcrest/hamcrest-core-1.3.jar:third_party/maven/maven-settings-3.3.3.jar:third_party/maven/maven-settings-builder-3.3.3.jar:third_party/maven/maven-builder-support-3.3.3.jar:third_party/hungarian_algorithm/software-and-algorithms-1.0-src.jar:third_party/hungarian_algorithm/software-and-algorithms-1.0.jar:third_party/error_prone/error_prone_check_api-2.3.2-SNAPSHOT.jar:third_party/error_prone/error_prone_annotation-2.3.2-SNAPSHOT.jar:third_party/error_prone/error_prone_type_annotations-2.3.2-SNAPSHOT.jar:third_party/error_prone/error_prone_annotations-2.2.0.jar:third_party/guava/guava-25.1-jre.jar:third_party/auth/google-auth-library-oauth2-http-0.15.0.jar:third_party/auth/google-auth-library-credentials-0.15.0.jar:third_party/compile_testing/compile-testing-0.13.jar:third_party/jsch/jsch-0.1.54.jar:third_party/apache_commons_codec/commons-codec-1.9.jar:third_party/asm/asm-commons-7.0-sources.jar:third_party/asm/asm-tree-7.0.jar:third_party/asm/asm-commons-7.0.jar:third_party/asm/asm-analysis-7.0.jar:third_party/asm/asm-util-7.0.jar:third_party/asm/asm-util-7.0-sources.jar:third_party/asm/asm-tree-7.0-sources.jar:third_party/asm/asm-analysis-7.0-sources.jar:third_party/asm/asm-7.0-sources.jar:third_party/asm/asm-7.0.jar:third_party/protobuf/3.6.1/libprotobuf_java_util.jar:third_party/protobuf/3.6.1/libprotobuf_java.jar:third_party/truth8/truth-java8-extension-0.44.jar:third_party/xz/xz-1.5.jar:third_party/bazel_bootstrap/libautocodec-processor.jar:third_party/bazel_bootstrap/libregistered-singleton.jar:third_party/bazel_bootstrap/libserialization.jar:third_party/bazel_bootstrap/libautocodec-annotation.jar:third_party/bazel_bootstrap/libunsafe-provider.jar:third_party/jsr330_inject/javax.inject.jar:third_party/api_client/google-http-client-1.22.0-SNAPSHOT.jar:third_party/api_client/google-api-client-jackson2-1.22.0.jar:third_party/api_client/google-api-client-1.22.0.jar:third_party/api_client/google-http-client-jackson2-1.22.0.jar:third_party/apache_commons_collections/commons-collections-3.2.2.jar:third_party/tomcat_annotations_api/tomcat-annotations-api-8.0.5.jar:third_party/opencensus/opencensus-contrib-grpc-metrics-0.19.2.jar:third_party/opencensus/opencensus-api-0.19.2.jar:third_party/jcip_annotations/jcip-annotations-1.0-1.jar:third_party/diffutils/diffutils-1.3.0.jar:third_party/plexus_component_annotations/plexus-component-annotations-1.6.jar:third_party/java/android_databinding/v2_3_1/exec.jar:third_party/java/jdk/langtools/javac-9+181-r4173-1.jar:third_party/java/jdk/langtools/jdk_compiler-src.jar:third_party/java/jdk/langtools/java_compiler-src.jar:third_party/java/jdk/langtools/jdk_compiler.jar:third_party/java/jdk/langtools/java_compiler.jar:third_party/java/jcommander/jcommander-1.48.jar:third_party/java/javapoet/javapoet-1.8.0.jar:third_party/java/jacoco/org.jacoco.report-0.7.5.201505241946.jar:third_party/java/jacoco/org.jacoco.core-0.7.5.201505241946-src.jar:third_party/java/jacoco/org.jacoco.core-0.7.5.201505241946.jar:third_party/java/jacoco/org.jacoco.report-0.7.5.201505241946-src.jar:third_party/java/jacoco/org.jacoco.agent-0.7.5.201505241946.jar:third_party/java/jacoco/org.jacoco.agent-0.7.5.201505241946-src.jar:third_party/java/jacoco/jacocoagent.jar:third_party/java/proguard/proguard5.3.3/examples/annotations/lib/annotations.jar:third_party/java/proguard/proguard5.3.3/lib/proguard.jar:third_party/java/proguard/proguard5.3.3/lib/retrace.jar:third_party/java/proguard/proguard5.3.3/lib/proguardgui.jar:third_party/auto/auto-service-1.0-rc4.jar:third_party/auto/auto-value-annotations-1.6.3rc1.jar:third_party/auto/auto-common-0.10.jar:third_party/auto/auto-value-1.6.3rc1.jar:third_party/ijar/test/jar-with-manifest-and-target-label.jar:third_party/ijar/test/libwrongcentraldir.jar:third_party/ijar/test/jar-without-manifest.jar:third_party/ijar/test/nestmates/nestmates.jar:third_party/ijar/test/jar-with-manifest.jar:third_party/apache_commons_lang/commons-lang-2.6.jar:third_party/instrumentation/instrumentation-api-0.4.3.jar:third_party/apache_commons_logging/commons-logging-1.1.1.jar:third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar:third_party/pcollections/pcollections-2.1.2.jar:third_party/apache_httpcore/httpcore-4.4.6.jar:third_party/plexus_utils/plexus-utils-3.0.21.jar:third_party/maven_model/maven-model-builder-3.2.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/objenesis/objenesis-1_3.jar:third_party/plexus_interpolation/plexus-interpolation-1.22.jar:third_party/gson/gson-2.2.4.jar:third_party/apache_httpclient/httpclient-4.5.3.jar:third_party/bytebuddy/byte-buddy-1.9.7.jar:third_party/bytebuddy/byte-buddy-agent-1.9.7.jar:third_party/apache_commons_pool2/commons-pool2-2.3.jar:third_party/turbine/turbine_direct.jar:third_party/jsr305/jsr-305.jar:third_party/netty_tcnative/netty-tcnative-boringssl-static-2.0.24.Final.jar:third_party/aether/aether-transport-wagon-1.0.0.v20140518.jar:third_party/aether/aether-transport-file-1.0.0.v20140518.jar:third_party/aether/aether-transport-http-1.0.0.v20140518.jar:third_party/aether/aether-impl-1.0.0.v20140518.jar:third_party/aether/aether-api-1.0.0.v20140518.jar:third_party/aether/aether-util-1.0.0.v20140518.jar:third_party/aether/aether-spi-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/android_common/com.android.tools_sdk-common_25.0.0-stripped.jar:third_party/android_common/com.android.tools_sdk-common_25.0.0.jar:third_party/android_common/com.android.tools.layoutlib_layoutlib_26.1.2.jar:third_party/android_common/com.android.tools_common_25.0.0.jar:third_party/android_common/com.android.tools_sdklib_25.0.0.jar:third_party/android_common/com.android.tools.build_builder-model_2.0.0.jar:third_party/android_common/com.android.tools.external.lombok_lombok-ast_0.2.3.jar:third_party/android_common/com.android.tools.lint_lint-api_25.0.0.jar:third_party/android_common/com.android.tools.layoutlib_layoutlib_26.1.2-stripped.jar:third_party/android_common/com.android.tools.build_manifest-merger_25.0.0-patched.jar:third_party/android_common/com.android.tools_repository_25.0.0.jar:third_party/android_common/com.android.tools.build_builder_2.0.0.jar:third_party/android_common/com.android.tools_dvlib_25.0.0.jar:third_party/android_common/com.android.tools.lint_lint-checks_25.0.0.jar:third_party/android_common/com.android_annotations_25.0.0.jar:third_party/android_common/com.android.tools.build_builder-test-api_2.0.0.jar:third_party/junit/junit-4.12.jar:third_party/apache_commons_compress/apache-commons-compress-1.9.jar:third_party/javax_annotations/javax.annotation-api-1.3.2.jar:third_party/javax_annotations/javax.annotation-api-1.3.2-sources.jar:third_party/checker_framework_dataflow/dataflow-2.5.3.jar:third_party/checker_framework_dataflow/dataflow-2.5.3-sources.jar:third_party/mockito/mockito-core-2.25.1.jar:third_party/jaxb/jaxb-api-2.3.1-patched.jar:third_party/jaxb/jaxb-api-2.3.1.jar:third_party/jaxb/jaxb-api-2.3.1-sources.jar:third_party/netty/netty-all-4.1.34.Final.jar:third_party/truth/truth-0.44.jar:third_party/slf4j/slf4j-api-1.7.7.jar:third_party/slf4j/slf4j-jdk14-1.7.7.jar:third_party/checker_framework_javacutil/javacutil-2.5.3.jar:third_party/checker_framework_javacutil/javacutil-2.5.3-sources.jar:third_party/grpc/grpc-context-1.20.0.jar:third_party/grpc/grpc-netty-1.20.0.jar:third_party/grpc/grpc-protobuf-lite-1.20.0.jar:third_party/grpc/grpc-stub-1.20.0.jar:third_party/grpc/grpc-core-1.20.0.jar:third_party/grpc/grpc-auth-1.20.0.jar:third_party/grpc/grpc-protobuf-1.20.0.jar:third_party/guava/guava-testlib-25.1-jre.jar:third_party/error_prone/error_prone_core-2.3.2-SNAPSHOT.jar:/tmp/bazel_oTzlyLI0 -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:tools/java/runfiles:third_party/java/dd_plist/java:/tmp/bazel_oTzlyLI0/src -d /tmp/bazel_oTzlyLI0/classes -source 1.8 -target 1.8 -encoding UTF-8 --J-Xmx512M -J-Xms512m @/tmp/bazel_qVgNSO0j/param
pi@raspberrypi:~ $ hostnamectl Static hostname: raspberrypi Icon name: computer Machine ID: aab2e9df2c214a7a973208a33d079aed Boot ID: 82fd50b9f1e74e86863fd8a435742827 Operating System: Raspbian GNU/Linux 9 (stretch) Kernel: Linux 4.19.42+ Architecture: arm
pi@raspberrypi:~ $ uname -a Linux raspberrypi 4.19.42+ #1219 Tue May 14 21:16:38 BST 2019 armv6l GNU/Linux
Seeing this too when trying to build bazel 0.26.1 on my raspberry pi
$ uname -a
Linux raspberrypi 4.19.83-v8+ #1277 SMP PREEMPT Mon Nov 11 16:53:30 GMT 2019 aarch64 GNU/Linux
$ java -version
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-post-Raspbian-1deb10u1)
OpenJDK Server VM (build 11.0.5+10-post-Raspbian-1deb10u1, mixed mode)
I was able to get around this by editing com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java
and replacing return "arm"
with return "aarch64"
.
I am having bazel 0.17.2 installed on aarch64 cpu with linux, but wanted to upgrade to bazel 0.22.0.
Followed the instruction on official documentation here.
First I tried building bazel with existing bazel, but not working:
Then I tried to compile bazel from scratch, and it shows below error:
Here is the output of
hostnamectl
:and
uname -m
:aarch64
Somehow the cpu is recognized as 'arm' instead of 'aarch64' when "Building Bazel with Bazel" after "Building Bazel from scratch"? The hardware I am running on is this with RK3399 chip.