Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From source build failing with zlib::compress is unavailable #373

Closed
Zentrik opened this issue Jul 30, 2024 · 2 comments
Closed

From source build failing with zlib::compress is unavailable #373

Zentrik opened this issue Jul 30, 2024 · 2 comments

Comments

@Zentrik
Copy link
Contributor

Zentrik commented Jul 30, 2024

Log is at https://buildkite.com/julialang/julia-master-scheduled/builds/833#019102a8-3ed7-4311-873f-f01ec5a4890e and the error is:

cd /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/base && /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/julia -C "generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1);x86-64-v4,-rdrnd,base(1)"  --output-ji /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/lib/julia/corecompiler.ji.tmp --startup-file=no --warn-overwrite=yes -g0 -O1 compiler/compiler.jl
zlib::compress is unavailable
UNREACHABLE executed at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/deps/srccache/llvm-julia-17.0.6-4/llvm/lib/Support/Compression.cpp:149!

[199707] signal 6 (-6): Aborted
in expression starting at boot.jl:264
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_ZN4llvm25llvm_unreachable_internalEPKcS1_j at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm11compression4zlib8compressENS_8ArrayRefIhEERNS_15SmallVectorImplIhEEi at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
registerJITObject at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/debuginfo.cpp:340
jl_register_jit_object at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/debuginfo.cpp:410
registerRTDyldJITObject at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/jitlayers.cpp:989
_ZN4llvm3orc24RTDyldObjectLinkingLayer9onObjLoadERNS0_29MaterializationResponsibilityERKNS_6object10ObjectFileERNS_11RuntimeDyld13MemoryManagerERNS8_16LoadedObjectInfoESt3mapINS_9StringRefENS_18JITEvaluatedSymbolESt4lessISE_ESaISt4pairIKSE_SF_EEERSt3setISE_SH_SaISE_EE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm6detail18UniqueFunctionBaseINS_5ErrorEJRKNS_6object10ObjectFileERNS_11RuntimeDyld16LoadedObjectInfoESt3mapINS_9StringRefENS_18JITEvaluatedSymbolESt4lessISB_ESaISt4pairIKSB_SC_EEEEE8CallImplIZNS_3orc24RTDyldObjectLinkingLayer4emitESt10unique_ptrINSM_29MaterializationResponsibilityESt14default_deleteISP_EESO_INS_12MemoryBufferESQ_IST_EEEUlS6_S9_SJ_E_EES2_PvS6_S9_RSJ_ at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm13jitLinkForORCENS_6object12OwningBinaryINS0_10ObjectFileEEERNS_11RuntimeDyld13MemoryManagerERNS_17JITSymbolResolverEbNS_15unique_functionIFNS_5ErrorERKS2_RNS4_16LoadedObjectInfoESt3mapINS_9StringRefENS_18JITEvaluatedSymbolESt4lessISG_ESaISt4pairIKSG_SH_EEEEEENS9_IFvS3_St10unique_ptrISD_St14default_deleteISD_EESA_EEE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc24RTDyldObjectLinkingLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EES2_INS_12MemoryBufferES4_IS7_EE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
emit at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/jitlayers.h:375
_ZN4llvm3orc14IRCompileLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc16IRTransformLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc16IRTransformLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc16IRTransformLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc16IRTransformLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc31BasicIRLayerMaterializationUnit11materializeESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc19MaterializationTask3runEv at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm6detail18UniqueFunctionBaseIvJSt10unique_ptrINS_3orc4TaskESt14default_deleteIS4_EEEE8CallImplIPFvS7_EEEvPvRS7_ at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession22dispatchOutstandingMUsEv at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession17OL_completeLookupESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EESt10shared_ptrINS0_23AsynchronousSymbolQueryEESt8functionIFvRKNS_8DenseMapIPNS0_8JITDylibENS_8DenseSetINS0_15SymbolStringPtrENS_12DenseMapInfoISF_vEEEENSG_ISD_vEENS_6detail12DenseMapPairISD_SI_EEEEEE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc25InProgressFullLookupState8completeESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession19OL_applyQueryPhase1ESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EENS_5ErrorE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession6lookupENS0_10LookupKindERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS8_EENS0_15SymbolLookupSetENS0_11SymbolStateENS_15unique_functionIFvNS_8ExpectedINS_8DenseMapINS0_15SymbolStringPtrENS0_17ExecutorSymbolDefENS_12DenseMapInfoISI_vEENS_6detail12DenseMapPairISI_SJ_EEEEEEEEESt8functionIFvRKNSH_IS6_NS_8DenseSetISI_SL_EENSK_IS6_vEENSN_IS6_SV_EEEEEE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
_ZN4llvm3orc16ExecutionSession6lookupERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS7_EENS0_15SymbolLookupSetENS0_10LookupKindENS0_11SymbolStateESt8functionIFvRKNS_8DenseMapIS5_NS_8DenseSetINS0_15SymbolStringPtrENS_12DenseMapInfoISI_vEEEENSJ_IS5_vEENS_6detail12DenseMapPairIS5_SL_EEEEEE at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/../lib/libLLVM-17jl.so (unknown line)
addModule at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/jitlayers.cpp:1799
_jl_compile_codeinst at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/jitlayers.cpp:228
jl_generate_fptr_for_unspecialized_impl at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/jitlayers.cpp:531
jl_compile_method_internal at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/gf.c:2761
_jl_invoke at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/gf.c:3169 [inlined]
ijl_invoke at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/gf.c:3184
jl_toplevel_eval_flex at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/toplevel.c:996
jl_parse_eval_all at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/toplevel.c:1132
ijl_load_ at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/toplevel.c:1179
ijl_load at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/toplevel.c:1192
_finish_julia_init at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/init.c:875
jl_repl_entrypoint at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/src/jlapi.c:1053
main at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/cli/loader_exe.c:58
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/bin/julia (unknown line)
Allocations: 0 (Pool: 0; Big: 0); GC: 0
Aborted
make[1]: *** [sysimage.mk:64: /cache/build/tester-amdci4-8/julialang/julia-master-scheduled/usr/lib/julia/corecompiler.ji] Error 134
make[1]: Leaving directory '/cache/build/tester-amdci4-8/julialang/julia-master-scheduled'
make: *** [Makefile:107: julia-sysimg-ji] Error 2
@Zentrik
Copy link
Contributor Author

Zentrik commented Aug 1, 2024

Perhaps JuliaLang/julia#55180 is related.

giordano added a commit to JuliaLang/julia that referenced this issue Aug 6, 2024
### Elaboration of the issue

After #55180 we implicitly require an LLVM built with Zlib support, but
compiling Julia with `make USE_BINARYBUILDER_LLVM=0` builds an LLVM
without Zlib support, despite the fact we attempt to request it at

https://github.com/JuliaLang/julia/blob/996351f5f6651d1508aef3c35c7d37eb22a0fb1e/deps/llvm.mk#L97
This was first identified in #55337.

### Explanation of how configuration of LLVM failed

`ZLIB_LIBRARY` must be the path to the zlib library, but we currently
set it to the libdir where the library is installed (introduced in
#42622):

https://github.com/JuliaLang/julia/blob/996351f5f6651d1508aef3c35c7d37eb22a0fb1e/deps/llvm.mk#L97
which is wrong. However, CMake is actually able to find Zlib correctly,
but then the check at
https://github.com/llvm/llvm-project/blob/46425b8d0fac3c529aa4a716d19abd7032e452f3/llvm/cmake/config-ix.cmake#L139-L141
uses the value of `ZLIB_LIBRARY` to list the Zlib to link for the test,
but being `ZLIB_LIBRARY` a directory, CMake doesn't see any valid Zlib
and thus tries to run the test without linking any Zlib, and the test
silently fails (they're silent only when `LLVM_ENABLE_ZLIB=ON`),
resulting in no usable Zlib available, even if found.

### Proposed solution

`ZLIB_ROOT` is the only [hint recommended by the CMake module
`FindZLIB`](https://cmake.org/cmake/help/latest/module/FindZLIB.html#hints).
This PR replaces a broken `ZLIB_LIBRARY` with an appropriate
`ZLIB_ROOT`. Also, we set `LLVM_ENABLE_ZLIB=FORCE_ON` which is the only
way to make CMake fail loudly if no usable Zlib is available, and avoid
going on with a non-usable build.

### Other comments

I confirm this fixes #55337 for me, it should likely address
JuliaCI/julia-buildkite#373 as well.

Also, options `COMPILER_RT_ENABLE_IOS`, `COMPILER_RT_ENABLE_WATCHOS`,
`COMPILER_RT_ENABLE_TVOS`, and `HAVE_HISTEDIT_H` don't exist anymore,
and they are removed.
giordano added a commit to JuliaLang/julia that referenced this issue Aug 6, 2024
After #55180 we implicitly require an LLVM built with Zlib support, but
compiling Julia with `make USE_BINARYBUILDER_LLVM=0` builds an LLVM
without Zlib support, despite the fact we attempt to request it at

https://github.com/JuliaLang/julia/blob/996351f5f6651d1508aef3c35c7d37eb22a0fb1e/deps/llvm.mk#L97
This was first identified in #55337.

`ZLIB_LIBRARY` must be the path to the zlib library, but we currently
set it to the libdir where the library is installed (introduced in

https://github.com/JuliaLang/julia/blob/996351f5f6651d1508aef3c35c7d37eb22a0fb1e/deps/llvm.mk#L97
which is wrong. However, CMake is actually able to find Zlib correctly,
but then the check at
https://github.com/llvm/llvm-project/blob/46425b8d0fac3c529aa4a716d19abd7032e452f3/llvm/cmake/config-ix.cmake#L139-L141
uses the value of `ZLIB_LIBRARY` to list the Zlib to link for the test,
but being `ZLIB_LIBRARY` a directory, CMake doesn't see any valid Zlib
and thus tries to run the test without linking any Zlib, and the test
silently fails (they're silent only when `LLVM_ENABLE_ZLIB=ON`),
resulting in no usable Zlib available, even if found.

`ZLIB_ROOT` is the only [hint recommended by the CMake module
`FindZLIB`](https://cmake.org/cmake/help/latest/module/FindZLIB.html#hints).
This PR replaces a broken `ZLIB_LIBRARY` with an appropriate
`ZLIB_ROOT`. Also, we set `LLVM_ENABLE_ZLIB=FORCE_ON` which is the only
way to make CMake fail loudly if no usable Zlib is available, and avoid
going on with a non-usable build.

I confirm this fixes #55337 for me, it should likely address
JuliaCI/julia-buildkite#373 as well.

Also, options `COMPILER_RT_ENABLE_IOS`, `COMPILER_RT_ENABLE_WATCHOS`,
`COMPILER_RT_ENABLE_TVOS`, and `HAVE_HISTEDIT_H` don't exist anymore,
and they are removed.
giordano added a commit to JuliaLang/julia that referenced this issue Aug 6, 2024
After #55180 we implicitly require an LLVM built with Zlib support, but
compiling Julia with `make USE_BINARYBUILDER_LLVM=0` builds an LLVM
without Zlib support, despite the fact we attempt to request it at

https://github.com/JuliaLang/julia/blob/996351f5f6651d1508aef3c35c7d37eb22a0fb1e/deps/llvm.mk#L97
This was first identified in #55337.

`ZLIB_LIBRARY` must be the path to the zlib library, but we currently
set it to the libdir where the library is installed (introduced in

https://github.com/JuliaLang/julia/blob/996351f5f6651d1508aef3c35c7d37eb22a0fb1e/deps/llvm.mk#L97
which is wrong. However, CMake is actually able to find Zlib correctly,
but then the check at
https://github.com/llvm/llvm-project/blob/46425b8d0fac3c529aa4a716d19abd7032e452f3/llvm/cmake/config-ix.cmake#L139-L141
uses the value of `ZLIB_LIBRARY` to list the Zlib to link for the test,
but being `ZLIB_LIBRARY` a directory, CMake doesn't see any valid Zlib
and thus tries to run the test without linking any Zlib, and the test
silently fails (they're silent only when `LLVM_ENABLE_ZLIB=ON`),
resulting in no usable Zlib available, even if found.

`ZLIB_ROOT` is the only [hint recommended by the CMake module
`FindZLIB`](https://cmake.org/cmake/help/latest/module/FindZLIB.html#hints).
This PR replaces a broken `ZLIB_LIBRARY` with an appropriate
`ZLIB_ROOT`. Also, we set `LLVM_ENABLE_ZLIB=FORCE_ON` which is the only
way to make CMake fail loudly if no usable Zlib is available, and avoid
going on with a non-usable build.

I confirm this fixes #55337 for me, it should likely address
JuliaCI/julia-buildkite#373 as well.

Also, options `COMPILER_RT_ENABLE_IOS`, `COMPILER_RT_ENABLE_WATCHOS`,
`COMPILER_RT_ENABLE_TVOS`, and `HAVE_HISTEDIT_H` don't exist anymore,
and they are removed.
@Zentrik Zentrik closed this as completed Aug 7, 2024
@Zentrik
Copy link
Contributor Author

Zentrik commented Aug 7, 2024

Fixed by JuliaLang/julia@46ed1ba

lazarusA pushed a commit to lazarusA/julia that referenced this issue Aug 17, 2024
### Elaboration of the issue

After JuliaLang#55180 we implicitly require an LLVM built with Zlib support, but
compiling Julia with `make USE_BINARYBUILDER_LLVM=0` builds an LLVM
without Zlib support, despite the fact we attempt to request it at

https://github.com/JuliaLang/julia/blob/996351f5f6651d1508aef3c35c7d37eb22a0fb1e/deps/llvm.mk#L97
This was first identified in JuliaLang#55337.

### Explanation of how configuration of LLVM failed

`ZLIB_LIBRARY` must be the path to the zlib library, but we currently
set it to the libdir where the library is installed (introduced in
JuliaLang#42622):

https://github.com/JuliaLang/julia/blob/996351f5f6651d1508aef3c35c7d37eb22a0fb1e/deps/llvm.mk#L97
which is wrong. However, CMake is actually able to find Zlib correctly,
but then the check at
https://github.com/llvm/llvm-project/blob/46425b8d0fac3c529aa4a716d19abd7032e452f3/llvm/cmake/config-ix.cmake#L139-L141
uses the value of `ZLIB_LIBRARY` to list the Zlib to link for the test,
but being `ZLIB_LIBRARY` a directory, CMake doesn't see any valid Zlib
and thus tries to run the test without linking any Zlib, and the test
silently fails (they're silent only when `LLVM_ENABLE_ZLIB=ON`),
resulting in no usable Zlib available, even if found.

### Proposed solution

`ZLIB_ROOT` is the only [hint recommended by the CMake module
`FindZLIB`](https://cmake.org/cmake/help/latest/module/FindZLIB.html#hints).
This PR replaces a broken `ZLIB_LIBRARY` with an appropriate
`ZLIB_ROOT`. Also, we set `LLVM_ENABLE_ZLIB=FORCE_ON` which is the only
way to make CMake fail loudly if no usable Zlib is available, and avoid
going on with a non-usable build.

### Other comments

I confirm this fixes JuliaLang#55337 for me, it should likely address
JuliaCI/julia-buildkite#373 as well.

Also, options `COMPILER_RT_ENABLE_IOS`, `COMPILER_RT_ENABLE_WATCHOS`,
`COMPILER_RT_ENABLE_TVOS`, and `HAVE_HISTEDIT_H` don't exist anymore,
and they are removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant