Skip to content

Commit a415b58

Browse files
dep fixes
1 parent d3c81d9 commit a415b58

File tree

4 files changed

+64
-51
lines changed

4 files changed

+64
-51
lines changed

stdlib/CompilerSupportLibraries_jll/src/CompilerSupportLibraries_jll.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ if Sys.isfreebsd()
8181
_libstdcxx_dependencies = LazyLibrary[]
8282
elseif Sys.isapple()
8383
_libstdcxx_dependencies = LazyLibrary[libgcc_s]
84+
elseif Sys.islinux()
85+
_libstdcxx_dependencies = LazyLibrary[libgcc_s]
8486
else
8587
_libstdcxx_dependencies = LazyLibrary[libgcc_s, libgfortran]
8688
end

stdlib/LibGit2_jll/src/LibGit2_jll.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,21 @@ const LIBPATH_list = String[]
1919
artifact_dir::String = ""
2020
libgit2_path::String = ""
2121

22-
_libgit2_dependencies = LazyLibrary[libssh2]
2322
if Sys.iswindows()
2423
const _libgit2_path = BundledLazyLibraryPath("libgit2.dll")
2524
elseif Sys.isapple()
2625
const _libgit2_path = BundledLazyLibraryPath("libgit2.1.9.dylib")
2726
else
2827
const _libgit2_path = BundledLazyLibraryPath("libgit2.so.1.9")
29-
append!(_libgit2_dependencies, [libcrypto, libssl])
3028
end
3129

30+
if Sys.isfreebsd()
31+
_libgit2_dependencies = LazyLibrary[]
32+
elseif Sys.islinux()
33+
_libgit2_dependencies = LazyLibrary[libssh2, libssl, libcrypto]
34+
else
35+
_libgit2_dependencies = LazyLibrary[libssh2]
36+
end
3237
const libgit2 = LazyLibrary(_libgit2_path, dependencies=_libgit2_dependencies)
3338

3439
function eager_mode()

stdlib/OpenBLAS_jll/src/OpenBLAS_jll.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ if Sys.isapple()
3434
if isdefined(CompilerSupportLibraries_jll, :libquadmath)
3535
push!(_libopenblas_dependencies, CompilerSupportLibraries_jll.libquadmath)
3636
end
37+
if Sys.ARCH != :aarch64
38+
push!(_libopenblas_dependencies, CompilerSupportLibraries_jll.libgcc_s)
39+
end
3740
elseif Sys.isfreebsd()
3841
_libopenblas_dependencies = LazyLibrary[]
3942
else

test/stdlib_dependencies.jl

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ function get_deps_readelf(lib_path::String)
101101
end
102102

103103

104-
104+
skip = false
105105
# On linux, we need `readelf` available, otherwise we refuse to attempt this
106106
if Sys.islinux() || Sys.isfreebsd()
107107
if Sys.which("readelf") === nothing
108108
@debug("Silently skipping stdlib_dependencies.jl as `readelf` not available.")
109-
exit(0)
109+
skip = true
110110
end
111111
get_deps = get_deps_readelf
112112
strip_soversion = strip_soversion_linux
@@ -115,63 +115,66 @@ elseif Sys.isapple()
115115
# On macOS, we need `otool` available
116116
if Sys.which("otool") === nothing
117117
@debug("Silently skipping stdlib_dependencies.jl as `otool` not available.")
118-
exit(0)
118+
skip = true
119119
end
120120
get_deps = get_deps_otool
121121
strip_soversion = strip_soversion_macos
122122
is_system_lib = is_system_lib_macos
123123
else
124124
@debug("Don't know how to run `stdlib_dependencies.jl` on this platform")
125-
exit(0)
125+
skip = true
126126
end
127127

128-
# Iterate over all JLL stdlibs, check their lazy libraries to ensure
129-
# that they list all valid library dependencies, avoiding a situation
130-
# where the JLL wrapper code has fallen out of sync with the binaries
131-
# themselves.
132-
@testset "Stdlib JLL dependency check" begin
133-
for (_, (stdlib_name, _)) in Pkg.Types.stdlibs()
134-
if !endswith(stdlib_name, "_jll")
135-
continue
136-
end
137-
138-
# Import the stdlib, skip it if it's not available on this platform
139-
m = eval(Meta.parse("import $(stdlib_name); $(stdlib_name)"))
140-
if !Base.invokelatest(getproperty(m, :is_available))
141-
continue
142-
end
143-
144-
for prop_name in names(m)
145-
prop = getproperty(m, prop_name)
146-
if isa(prop, Libdl.LazyLibrary)
147-
lib_path = dlpath(prop)
148-
lazy_lib_deps = strip_soversion.(basename.(dlpath.(prop.dependencies)))
149-
real_lib_deps = filter(!is_system_lib, get_deps(lib_path))
150-
151-
# See if there are missing dependencies in the lazy library deps
152-
missing_deps = setdiff(real_lib_deps, lazy_lib_deps)
153-
extraneous_deps = setdiff(lazy_lib_deps, real_lib_deps)
154-
155-
# We expect there to be no missing or extraneous deps
156-
deps_mismatch = !isempty(missing_deps) || !isempty(extraneous_deps)
157-
158-
# This is a manually-managed special case
159-
if stdlib_name == "libblastrampoline_jll" &&
160-
prop_name == :libblastrampoline &&
161-
extraneous_deps == ["libopenblas64_"]
162-
deps_mismatch = false
163-
end
128+
if !skip
129+
# Iterate over all JLL stdlibs, check their lazy libraries to ensure
130+
# that they list all valid library dependencies, avoiding a situation
131+
# where the JLL wrapper code has fallen out of sync with the binaries
132+
# themselves.
133+
@testset "Stdlib JLL dependency check" begin
134+
for (_, (stdlib_name, _)) in Pkg.Types.stdlibs()
135+
if !endswith(stdlib_name, "_jll")
136+
continue
137+
end
164138

165-
@test !deps_mismatch
139+
# Import the stdlib, skip it if it's not available on this platform
140+
m = eval(Meta.parse("import $(stdlib_name); $(stdlib_name)"))
141+
if !Base.invokelatest(getproperty(m, :is_available))
142+
continue
143+
end
166144

167-
# Print out the deps mismatch if we find one
168-
if deps_mismatch
169-
@warn("Dependency mismatch",
170-
jll=stdlib_name,
171-
library=string(prop_name),
172-
missing_deps=join(missing_deps, ", "),
173-
extraneous_deps=join(extraneous_deps, ", "),
174-
)
145+
for prop_name in names(m)
146+
prop = getproperty(m, prop_name)
147+
if isa(prop, Libdl.LazyLibrary)
148+
lib_path = dlpath(prop)
149+
lazy_lib_deps = strip_soversion.(basename.(dlpath.(prop.dependencies)))
150+
real_lib_deps = filter(!is_system_lib, get_deps(lib_path))
151+
152+
# See if there are missing dependencies in the lazy library deps
153+
missing_deps = setdiff(real_lib_deps, lazy_lib_deps)
154+
extraneous_deps = setdiff(lazy_lib_deps, real_lib_deps)
155+
156+
# We expect there to be no missing or extraneous deps
157+
deps_mismatch = !isempty(missing_deps) || !isempty(extraneous_deps)
158+
159+
# This is a manually-managed special case
160+
if stdlib_name == "libblastrampoline_jll" &&
161+
prop_name == :libblastrampoline &&
162+
extraneous_deps == ["libopenblas64_"]
163+
deps_mismatch = false
164+
end
165+
166+
@test !deps_mismatch
167+
168+
# Print out the deps mismatch if we find one
169+
if deps_mismatch
170+
@warn("Dependency mismatch",
171+
jll=stdlib_name,
172+
library=string(prop_name),
173+
missing_deps=join(missing_deps, ", "),
174+
extraneous_deps=join(extraneous_deps, ", "),
175+
actual_deps=join(real_lib_deps, ", "),
176+
)
177+
end
175178
end
176179
end
177180
end

0 commit comments

Comments
 (0)