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

Pass location of built zlib to LLVM build #42622

Merged
merged 2 commits into from
Oct 13, 2021

Conversation

rbvermaa
Copy link
Contributor

This fixes the source build when run in Nix.

Related: #42524

@vchuravy
Copy link
Member

Thanks! Does everything still work after a make install and deleting usr, e.g. is the result relocatable?

@rbvermaa
Copy link
Contributor Author

Yeah everything seemed to work after the nix build finished (which includes make install and removal of build dir)

However I have not tested on other systems, like what you use normally for building the binaries, but I assume the GH checks would cover that?

@Sacha0
Copy link
Member

Sacha0 commented Oct 13, 2021

The tester_{linux32,linux64,linuxaarch64} failures are all of the same form and unrelated (breakage on master? still catching up this morning):


Error in testset Downloads:
Error During Test at /buildworker/worker/tester_linux64/build/share/julia/stdlib/v1.8/Downloads/test/runtests.jl:410
  Got exception outside of a @test
  ssl_handshake returned - mbedTLS: (-0x7280) SSL - The connection indicated an EOF while requesting https://httpbingo.org/drip
  Stacktrace:
    [1] (::Downloads.var"#9#18"{IOStream, Base.DevNull, Nothing, Vector{Pair{String, String}}, Float64, Main.Test76Main_Downloads.var"#22#40"{Vector{Any}}, Bool, Bool, String, Int64, Bool, Bool})(easy::Downloads.Curl.Easy)
      @ Downloads /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.8/Downloads/src/Downloads.jl:369
...

The tester_win64 failure is also unrelated:


Error in testset TOML:
Error During Test at none:1
  Got exception outside of a @test
  ProcessExitedException(3)
  Stacktrace:
    [1] try_yieldto(undo::typeof(Base.ensure_rescheduled))
      @ Base .\task.jl:764
...

tester_freebsd64 exhibits the Download failures of testers mentioned above and also fails in a couple other seemingly unrelated ways, probably known:

    LinearAlgebra/diagonal          |     2635                     2635
    LinearAlgebra/structuredbroadcast |               1                 1
    compiler/inline                 |       82                       82
    compiler/codegen                |      155      1               156

and particularly


Error in testset LinearAlgebra/structuredbroadcast:
Error During Test at none:1
  Got exception outside of a @test
  ProcessExitedException(5)
  Stacktrace:
    [1] try_yieldto(undo::typeof(Base.ensure_rescheduled))
      @ Base ./task.jl:764
    [2] wait()
      @ Base ./task.jl:824
    [3] wait(c::Base.GenericCondition{ReentrantLock})
      @ Base ./condition.jl:113
    [4] take_buffered(c::Channel{Any})
      @ Base ./channels.jl:390
    [5] take!(c::Channel{Any})
      @ Base ./channels.jl:384
    [6] take!(::Distributed.RemoteValue)
      @ Distributed /usr/home/julia/buildbot/w1_builder/package_freebsd64/build/usr/share/julia/stdlib/v1.8/Distributed/src/remotecall.jl:651
    [7] remotecall_fetch(::Function, ::Distributed.Worker, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, UInt128, Tuple{Symbol}, NamedTuple{(:seed,), Tuple{UInt128}}})
      @ Distributed /usr/home/julia/buildbot/w1_builder/package_freebsd64/build/usr/share/julia/stdlib/v1.8/Distributed/src/remotecall.jl:442
    [8] remotecall_fetch(::Function, ::Int64, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, UInt128, Tuple{Symbol}, NamedTuple{(:seed,), Tuple{UInt128}}})
      @ Distributed /usr/home/julia/buildbot/w1_builder/package_freebsd64/build/usr/share/julia/stdlib/v1.8/Distributed/src/remotecall.jl:473
    [9] macro expansion
      @ /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/share/julia/test/runtests.jl:241 [inlined]
   [10] (::var"#33#43"{Vector{Task}, var"#print_testworker_errored#39"{ReentrantLock, Int64, Int64}, var"#print_testworker_stats#37"{ReentrantLock, Int64, Int64, Int64, Int64, Int64, Int64}, Vector{Any}, Dict{String, DateTime}})()
      @ Main ./task.jl:411
Error in testset compiler/codegen:
Error During Test at /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/share/julia/test/testdefs.jl:21
  Got exception outside of a @test
  LoadError: failed process: Process(`cp -r /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/bin/.. /tmp/jl_IOVLKO`, ProcessExited(1)) [1]
  
  Stacktrace:
    [1] pipeline_error
      @ ./process.jl:529 [inlined]
    [2] run(::Cmd; wait::Bool)
      @ Base ./process.jl:444
    [3] run
      @ ./process.jl:442 [inlined]
    [4] (::Main.Test50Main_compiler_codegen.var"#28#29")(pfx::String)
      @ Main.Test50Main_compiler_codegen /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/share/julia/test/compiler/codegen.jl:643
    [5] mktempdir(fn::Main.Test50Main_compiler_codegen.var"#28#29", parent::String; prefix::String)
      @ Base.Filesystem ./file.jl:762
    [6] mktempdir(fn::Function, parent::String) (repeats 2 times)
      @ Base.Filesystem ./file.jl:760
    [7] top-level scope
      @ /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/share/julia/test/compiler/codegen.jl:642
    [8] include
      @ ./Base.jl:416 [inlined]
    [9] macro expansion
      @ /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/share/julia/test/testdefs.jl:24 [inlined]
   [10] macro expansion
      @ /usr/home/julia/buildbot/w1_builder/package_freebsd64/build/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:1321 [inlined]
   [11] macro expansion
      @ /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/share/julia/test/testdefs.jl:23 [inlined]
   [12] macro expansion
      @ ./timing.jl:380 [inlined]
   [13] runtests(name::String, path::String, isolate::Bool; seed::UInt128)
      @ Main /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/share/julia/test/testdefs.jl:21
   [14] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, UInt128, Tuple{Symbol}, NamedTuple{(:seed,), Tuple{UInt128}}})
      @ Base ./essentials.jl:720
   [15] (::Distributed.var"#106#108"{Distributed.CallMsg{:call_fetch}})()
      @ Distributed /usr/home/julia/buildbot/w1_builder/package_freebsd64/build/usr/share/julia/stdlib/v1.8/Distributed/src/process_messages.jl:278
   [16] run_work_thunk(thunk::Distributed.var"#106#108"{Distributed.CallMsg{:call_fetch}}, print_error::Bool)
      @ Distributed /usr/home/julia/buildbot/w1_builder/package_freebsd64/build/usr/share/julia/stdlib/v1.8/Distributed/src/process_messages.jl:63
   [17] macro expansion
      @ /usr/home/julia/buildbot/w1_builder/package_freebsd64/build/usr/share/julia/stdlib/v1.8/Distributed/src/process_messages.jl:278 [inlined]
   [18] (::Distributed.var"#105#107"{Distributed.CallMsg{:call_fetch}, Distributed.MsgHeader, Sockets.TCPSocket})()
      @ Distributed ./task.jl:411
  in expression starting at /usr/home/julia/buildbot/w2_tester/tester_freebsd64/build/share/julia/test/compiler/codegen.jl:642

which I think is to say that CI is happy modulo unrelated breakage.

@Sacha0
Copy link
Member

Sacha0 commented Oct 13, 2021

Confirmed, the Download failures occurred on other jobs launched at roughly the same time. Cycling those jobs.

@vchuravy vchuravy merged commit ec0eac1 into JuliaLang:master Oct 13, 2021
@rbvermaa rbvermaa deleted the rv-zlib-lib-location branch October 14, 2021 10:39
giordano added a commit that referenced this pull request 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.
lazarusA pushed a commit to lazarusA/julia that referenced this pull request 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

Successfully merging this pull request may close these issues.

3 participants