尝试在运行Raspbian(32位)的树莓pi零(armv6l soc)上构建bazel。 我添加了一个大的swapfile,以具有足够的“ ram”资源来构建bazel。速度很慢,但这是一个很好的解决方案。
顺便说一句,我仍然收到以下错误:
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../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_OB2hZgud -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_OB2hZgud/src -d /tmp/bazel_OB2hZgud/classes -source 1.8 -target 1.8 -encoding UTF-8 -J-Xmx512M -J-Xms512M @/tmp/bazel_PGVNRajy/param
....
? 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_WObd2rcu/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_WObd2rcu/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_WObd2rcu/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.916s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (16 packages loaded, 65 targets co\
nfigured)
ERROR: Could not build Bazel
有关该系统的一些信息:
pi@raspberrypi:/home/pi# hostnamectl
Static hostname: raspberrypi
Icon name: computer
Machine ID: aab2e9df2c214a7a973208a33d079aed
Boot ID: d1cb79e98f4344aeb58b6d35b8bba17d
Operating System: Raspbian GNU/Linux 9 (stretch)
Kernel: Linux 4.19.42+
Architecture: arm
pi@raspberrypi:/home/pi# uname -m
armv6l
pi@raspberrypi:/home/pi# java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-2~deb9u1-b03)
OpenJDK Client VM (build 25.212-b03, mixed mode)
Bazel版本 0.26.1 (但 0.19.2 上存在相同错误)
似乎在自动配置期间正确传播了“ armv6l”,但是当bazel使用Java系统属性尝试检测当前体系结构时,os.arch返回“ arm”而不是“ armv6l”。
能帮您解决错误吗?