Make Turbine x86_64 native image more compatible#20306
Make Turbine x86_64 native image more compatible#20306fmeum wants to merge 1 commit intobazelbuild:masterfrom
Conversation
|
@bazel-io flag |
|
@fmeum is this for 7.0.0 too? |
|
@keertk No, this one can go into 7.1.0. |
|
@bazel-io fork 7.1.0 |
Could you build
Bazel 7.0.0 ships with rules_java 7.1.0, which doesn't even contain a native image of Turbine and thus shouldn't be affected by this issue. Once this PR and #20294 have been merged, I would ask for a new patch release that will hopefully become the default in Bazel 7.1.0. |
I cannot build this branch out of the box on my outdated laptop, I guess I need to revert davido@localhost:~/projects/bazel (20298-compatible-turbine %)$ bazelisk build //src:java_tools_prebuilt_zip
WARNING: Download from https://mirror.bazel.build/github.com/bazelbuild/rules_java/releases/download/7.3.0/rules_java-7.3.0.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Analyzed target //src:java_tools_prebuilt_zip (7 packages loaded, 674 targets configured).
INFO: Found 1 target...
ERROR: /home/davido/.cache/bazel/_bazel_davido/0fa756dec521553dbe2dde6b6eac99b4/external/rules_jvm_external~5.2/private/tools/java/com/github/bazelbuild/rules_jvm_external/zip/BUILD:1:13: Compiling Java headers external/rules_jvm_external~5.2/private/tools/java/com/github/bazelbuild/rules_jvm_external/zip/libzip-hjar.jar (1 source file) [for tool] failed: (Exit 1): turbine_direct_graal failed: error executing command (from target @rules_jvm_external~5.2//private/tools/java/com/github/bazelbuild/rules_jvm_external/zip:zip) external/rules_java~7.3.0~toolchains~remote_java_tools_linux/java_tools/turbine_direct_graal --output ... (remaining 27 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
The current machine does not support all of the following CPU features that are required by the image: [CX8, CMOV, FXSR, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, AVX, AVX2, BMI1, BMI2, FMA].
Please rebuild the executable with an appropriate setting of the -march option.Target //src:java_tools_prebuilt_zip failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/davido/.cache/bazel/_bazel_davido/0fa756dec521553dbe2dde6b6eac99b4/external/rules_jvm_external~5.2/private/tools/java/com/github/bazelbuild/rules_jvm_external/jar/BUILD:3:12 Building external/rules_jvm_external~5.2/private/tools/java/com/github/bazelbuild/rules_jvm_external/jar/AddJarManifestEntry.jar (1 source file) [for tool] failed: (Exit 1): turbine_direct_graal failed: error executing command (from target @rules_jvm_external~5.2//private/tools/java/com/github/bazelbuild/rules_jvm_external/zip:zip) external/rules_java~7.3.0~toolchains~remote_java_tools_linux/java_tools/turbine_direct_graal --output ... (remaining 27 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
INFO: Elapsed time: 20.273s, Critical Path: 0.54s
INFO: 28 processes: 26 internal, 2 linux-sandbox.
FAILED: Build did NOT complete successfullyOf course, I have access to other machines, where I could build it though...and then test the result on my outdated laptop.
Thanks for clarifying, I assumed for some reason, that if java_rules 7.3.0 release is bumped on Bazel@HEAD, that the final 7.0.0 release would also ship this |
|
Confirmed! I've built from the branch on another machine: davido@wizball:~/projects/bazel (20298-compatible-turbine %)$ bazelisk build //src:java_tools_prebuilt_zip
2023/11/23 22:31:20 Downloading https://releases.bazel.build/6.4.0/release/bazel-6.4.0-linux-x86_64...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
WARNING: Download from https://mirror.bazel.build/github.com/bazelbuild/rules_java/releases/download/7.3.0/rules_java-7.3.0.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
DEBUG: /home/dos/.cache/bazel/_bazel_dos/953b7366ee92774e569a6b4daf38af93/external/rules_jvm_external~5.2/private/extensions/maven.bzl:141:14: The maven repository 'maven' is used in two different bazel modules, originally in 'bazel' and now in 'protobuf'
DEBUG: /home/dos/.cache/bazel/_bazel_dos/953b7366ee92774e569a6b4daf38af93/external/rules_jvm_external~5.2/coursier.bzl:600:18: Found duplicate artifact versions
com.google.code.gson:gson has multiple versions 2.9.0, 2.8.9
com.google.errorprone:error_prone_annotations has multiple versions 2.23.0, 2.3.2
com.google.truth:truth has multiple versions 1.1.3, 1.1.2
org.mockito:mockito-core has multiple versions 5.4.0, 4.3.1
Please remove duplicate artifacts from the artifact list so you do not get unexpected artifact versions
INFO: Analyzed target //src:java_tools_prebuilt_zip (99 packages loaded, 2764 targets configured).
INFO: Found 1 target...
INFO: From Native Image (fastbuild) //src/java_tools/buildjar/java/com/google/devtools/build/java/turbine:turbine_direct_graal:
========================================================================================================================
GraalVM Native Image: Generating 'turbine_direct_graal' (static executable)...
========================================================================================================================
For detailed information and explanations on the build output, visit:
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md
------------------------------------------------------------------------------------------------------------------------
[1/8] Initializing... (8.2s @ 0.17GB)
Java version: 20.0.2+9, vendor version: GraalVM CE 20.0.2+9.1
Graal compiler: optimization level: b, target machine: x86-64-v2
C compiler: gcc (null, null, 0.0.0)
Garbage collector: Serial GC (max heap size: 80% of RAM)
[2/8] Performing analysis... [******] (23.9s @ 0.42GB)
5,260 (80.11%) of 6,566 types reachable
7,362 (56.64%) of 12,999 fields reachable
26,876 (49.31%) of 54,507 methods reachable
1,770 types, 83 fields, and 846 methods registered for reflection
57 types, 55 fields, and 52 methods registered for JNI access
4 native libraries: dl, pthread, rt, z
[3/8] Building universe... (4.0s @ 0.60GB)
[4/8] Parsing methods... [**] (2.6s @ 0.57GB)
[5/8] Inlining methods... [***] (1.5s @ 0.64GB)
[6/8] Compiling methods... [***] (11.6s @ 0.51GB)
[7/8] Layouting methods... [**] (3.5s @ 0.84GB)
[8/8] Creating image... [**] (4.5s @ 0.65GB)
10.65MB (47.24%) for code area: 16,239 compilation units
10.85MB (48.11%) for image heap: 138,983 objects and 5 resources
1.05MB ( 4.65%) for other data
22.55MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 origins of code area: Top 10 object types in image heap:
5.94MB java.base 2.44MB byte[] for code metadata
1.34MB processed_turbine-0.3.0.jar 1.35MB java.lang.String
1.07MB svm.jar (Native Image) 1.21MB java.lang.Class
892.06kB libcore.jar 1.11MB byte[] for general heap data
334.65kB guava-32.1.1-jre.jar 1.08MB byte[] for java.lang.String
288.66kB liblite_runtime_only.jar 452.03kB com.oracle.svm.core.hub.DynamicHubCompanion
250.32kB jdk.zipfs 273.70kB java.util.HashMap$Node
115.98kB java.logging 266.89kB java.lang.String[]
60.13kB jdk.crypto.ec 256.35kB java.lang.Object[]
56.01kB org.graalvm.nativeimage.base 253.14kB byte[] for reflection metadata
236.19kB for 16 more packages 2.00MB for 1169 more object types
------------------------------------------------------------------------------------------------------------------------
Recommendations:
HEAP: Set max heap for improved and more predictable memory usage.
------------------------------------------------------------------------------------------------------------------------
3.5s (5.7% of total time) in 105 GCs | Peak RSS: 1.67GB | CPU load: 5.63
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
/home/dos/.cache/bazel/_bazel_dos/953b7366ee92774e569a6b4daf38af93/sandbox/linux-sandbox/384/execroot/_main/bazel-out/k8-fastbuild/bin/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/turbine_direct_graal (executable)
========================================================================================================================
Finished generating 'turbine_direct_graal' in 1m 0s.
Target //src:java_tools_prebuilt_zip up-to-date:
bazel-bin/src/java_tools_prebuilt.zip
INFO: Elapsed time: 242.243s, Critical Path: 115.14s
INFO: 421 processes: 34 internal, 381 linux-sandbox, 6 worker.
INFO: Build completed successfully, 421 total actionsThen I extracted and copied the artifact: davido@localhost:~/projects/bazel (20298-compatible-turbine %)$ file turbine_direct_graal
turbine_direct_graal: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0bc5c26095e615292a2bba22a9ba669aeb3ef463, for GNU/Linux 3.2.0, with debug_info, not stripped
davido@localhost:~/projects/bazel (20298-compatible-turbine %)$ ./turbine_direct_graal
at least one of --output, --gensrc_output, or --resource_output is required
Usage: turbine [options]
Options:
--output
The jar output file.
--sources
The sources to compile.
--source_jars
jar archives of sources to compile.
--classpath
The compilation classpath.
--bootclasspath
The compilation bootclasspath.
--help
Print this usage statement.
@<filename>
Read options and filenames from file.Thanks again for fixing it, really appreciated! |
I was reminded of this by bazelbuild/bazel#20306 PiperOrigin-RevId: 585447776
I was reminded of this by bazelbuild/bazel#20306 PiperOrigin-RevId: 585447776
I was reminded of this by bazelbuild/bazel#20306 PiperOrigin-RevId: 589210771
Work towards #20298