mirror of
https://github.com/JuliaLang/julia.git
synced 2026-05-28 03:10:33 +08:00
**Best reviewed with "Hide whitespace" When looking into https://github.com/JuliaLang/julia/pull/61292, I tried to use `versioninfo` to get the JIT’s cpu target. I found out that even though it shares parentheses with “ORCJIT”, the displayed cpu is always just the host CPU. Then I fell into the confusing and undocumented output of `versioninfo` rabbit hole trying to improve it and this is the result of that. Once I have a better idea about which changes are/aren't welcome, I’ll edit the docstring to be more explicit about what each item is. May be worth reviewing per-commit as I've tried to separate each change This PR: * Changes “GB” and “MB” to “GiB” and “MiB” when reporting memory information. * Moves the detected host cpu llvm target to be with the CPU instead of in the LLVM section. I changed this because the previous way implied it was the JIT target cpu. They usually match, but they may not if julia was launched with the `-C` flag * The build commit has been moved down into “Build Information” * Refactors the “Build Information” section. It will now always be shown, and the GC julia was built with was moved from the “Platform Information” section. * Adds the target cpu and triple that the base system image was built with when `verbose=true`. ~This adds a new Sys.BASE_SYSIMG_TARGET constant variable because calling `sysimage_target` from InteractiveUtils returns “sysimage”. Hidden behind `verbose` flag~ Edit: `sysimage_target` behaviour seems to have been fixed so the implementation now uses it. * LLVM section now reports the JIT target CPU where the host CPU use to be. ~This expands/uses API that was added by @gbaraldi for GPUCompiler in #49858.~ (edit: I found a way to do it using existing code) * The triple on the OS line is now the JIT target triple (same implementations worries as above), and the build machine triple (MACHINE) is now reported in the verbose-only sysimage line in “Build Information”. This is probably more relevant on macOS, where the triple includes the kernel version, but I find it [confusing](https://github.com/JuliaGPU/Metal.jl/issues/179#issuecomment-1555068273) to show the build kernel version when reporting the current OS. Current output (master): ```julia-repl julia> versioninfo() Julia Version 1.14.0-DEV.2169 Commit61cb0461a4(2026-05-10 23:05 UTC) Build Info: Official https://julialang.org release Platform Info: OS: macOS (arm64-apple-darwin24.0.0) CPU: 12 × Apple M2 Max WORD_SIZE: 64 LLVM: libLLVM-21.1.8 (ORCJIT, apple-m2) GC: Built with stock GC Threads: 8 default, 1 interactive, 8 GC (on 8 virtual cores) Environment: JULIA_NUM_THREADS = auto julia> versioninfo(verbose=true) Julia Version 1.14.0-DEV.2169 Commit61cb0461a4(2026-05-10 23:05 UTC) Build Info: Official https://julialang.org release Platform Info: OS: macOS (arm64-apple-darwin24.0.0) uname: Darwin 25.5.0 Darwin Kernel Version 25.5.0: Mon Apr 27 20:39:09 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T6020 arm64 arm CPU: Apple M2 Max: speed user nice sys idle irq #1-12 2400 MHz 131350 s 0 s 70466 s 1842258 s 0 s Memory: 32.0 GB (304.4375 MB free) Uptime: 469303.0 sec Load Avg: 3.224609375 3.75244140625 3.3671875 WORD_SIZE: 64 LLVM: libLLVM-21.1.8 (ORCJIT, apple-m2) GC: Built with stock GC Threads: 8 default, 1 interactive, 8 GC (on 8 virtual cores) Environment: ``` This PR: ```julia-repl julia> versioninfo() Julia Version 1.14.0-DEV.2178 Build Info: Official https://julialang.org release Commit 09e1b830fde (2026-05-11 13:03 UTC) GC: Built with stock GC Platform Info: OS: macOS (arm64-apple-darwin25.5.0) CPU: 12 × Apple M2 Max (apple-m2) WORD_SIZE: 64 LLVM: libLLVM-21.1.8 (ORCJIT, apple-m2) Threads: 8 default, 1 interactive, 8 GC (on 8 virtual cores) Environment: JULIA_NUM_THREADS = auto julia> versioninfo(verbose=true) Julia Version 1.14.0-DEV.2178 Build Info: Official https://julialang.org release Commit 09e1b830fde (2026-05-11 13:03 UTC) GC: Built with stock GC Sysimage: generic;apple-m1,clone_all (arm64-apple-darwin24.0.0) Platform Info: OS: macOS (arm64-apple-darwin25.5.0) uname: Darwin 25.5.0 Darwin Kernel Version 25.5.0: Mon Apr 27 20:39:09 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T6020 arm64 arm CPU: Apple M2 Max (apple-m2): speed user nice sys idle irq #1-12 2400 MHz 131335 s 0 s 70450 s 1842109 s 0 s Memory: 32.0 GiB (345.53125 MiB free) Uptime: 469288.0 sec Load Avg: 3.2978515625 3.7919921875 3.37451171875 WORD_SIZE: 64 LLVM: libLLVM-21.1.8 (ORCJIT, apple-m2) Threads: 8 default, 1 interactive, 8 GC (on 8 virtual cores) Environment: ```