Skip to content
This repository was archived by the owner on Aug 16, 2023. It is now read-only.
This repository was archived by the owner on Aug 16, 2023. It is now read-only.

Generated deps script for ExecutableProducts breaks curl on 1.4 #186

Description

@maleadt

This is probably what @SimonDanisch mentioned in #129 (comment)

julia> versioninfo()
Julia Version 1.4.0-DEV.688
Commit c32d166ffe (2020-01-09 09:30 UTC)

shell> curl -o /dev/null https://google.com
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   220  100   220    0     0   2095      0 --:--:-- --:--:-- --:--:--  2095

julia> using GDAL

shell> curl -o /dev/null https://google.com
curl: /opt/julia/bin/../lib/julia/libcurl.so.4: no version information available (required by curl)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) Cert verify failed: BADCERT_NOT_TRUSTED
More details here: https://curl.haxx.se/docs/sslcerts.html

The linker warning is telling; this is due to a different libcurl getting loaded:

shell> ldd /usr/bin/curl
        linux-vdso.so.1 (0x00007ffea2979000)
        libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f7e1a1ec000)
...

julia> using GDAL

shell> ldd /usr/bin/curl
/usr/bin/curl: /opt/julia/bin/../lib/julia/libcurl.so.4: no version information available (required by /usr/bin/curl)
        linux-vdso.so.1 (0x00007ffe5bdfc000)
        libcurl.so.4 => /opt/julia/bin/../lib/julia/libcurl.so.4 (0x00007fc122fad000)

This is due to modifying LD_LIBRARY_PATH in a BinaryProvider-generated deps script:

shell> cat $(dirname(pathof(GDAL)))/../deps/build.jl
write_deps_file(joinpath(@__DIR__, "deps_gdal.jl"), products, verbose=verbose)

shell> cat $(dirname(pathof(GDAL)))/../deps/deps_gdal.jl
ENV["LD_LIBRARY_PATH"] = join(filter(!isempty, libpaths), ":")

# If any of the products are `ExecutableProduct`s, we need to add Julia's
# library directory onto the end of {DYLD,LD}_LIBRARY_PATH
@static if !Sys.iswindows()
if any(p isa ExecutableProduct for p in products)
dllist = Libdl.dllist()
libjulia = filter(x -> occursin("libjulia", x), dllist)[1]
julia_libdir = repr(joinpath(dirname(libjulia), "julia"))
envvar_name = @static if Sys.isapple()
"DYLD_LIBRARY_PATH"
else Sys.islinux()
"LD_LIBRARY_PATH"
end
envvar_name = repr(envvar_name)
println(depsjl_file, """
libpaths = split(get(ENV, $(envvar_name), ""), ":")
if !($(julia_libdir) in libpaths)
push!(libpaths, $(julia_libdir))
end
ENV[$(envvar_name)] = join(filter(!isempty, libpaths), ":")
""")
end
end

Spotted in PkgEval runs: https://github.com/JuliaCI/NanosoldierReports/blob/f062a47c6bb3b5dd7c7bd29e7a3cc53cc6feeedd/pkgeval/by_hash/c32d166_vs_2e6715c/logs/GeoArrays/1.4.0-DEV-015cd56127.log#L290-L294 https://github.com/JuliaCI/NanosoldierReports/blob/f062a47c6bb3b5dd7c7bd29e7a3cc53cc6feeedd/pkgeval/by_hash/c32d166_vs_2e6715c/logs/DensityRatioEstimation/1.4.0-DEV-015cd56127.log#L336-L349

cc @KristofferC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions