|
1 | 1 | # This file is a part of Julia. License is MIT: https://julialang.org/license |
2 | 2 |
|
3 | 3 | using Libdl |
4 | | -using Pkg |
5 | 4 | using Test |
6 | | -prev_env = Base.active_project() |
7 | | -Pkg.activate(temp=true) |
8 | | -Pkg.add(Pkg.PackageSpec(name="ObjectFile", uuid="d8793406-e978-5875-9003-1fc021f44a92", version="0.4")) |
9 | | -using ObjectFile |
10 | | -try |
11 | 5 |
|
| 6 | +# Load ObjectFile.jl from the vendored jlutilities depot |
| 7 | +buildroot = get(ENV, "JULIA_TEST_BUILDROOT", joinpath(@__DIR__, "..")) |
| 8 | +depspath = joinpath(buildroot, "deps", "jlutilities") |
| 9 | +if ispath(depspath) |
| 10 | + depspath = realpath(depspath) |
| 11 | + # With a source-tree use the vendored depot |
| 12 | + pushfirst!(DEPOT_PATH, joinpath(depspath, "depot")) |
| 13 | + using Pkg |
| 14 | + old_active_project = Base.active_project() |
| 15 | + Base.redirect_stdout(devnull) do |
| 16 | + Base.redirect_stderr(devnull) do |
| 17 | + Pkg.activate(realpath(joinpath(@__DIR__, "..", "deps", "jlutilities", "objectfile"))) |
| 18 | + Pkg.instantiate() |
| 19 | + end |
| 20 | + end |
| 21 | + using ObjectFile |
| 22 | + popfirst!(DEPOT_PATH) |
| 23 | + Base.set_active_project(old_active_project) |
| 24 | +else |
| 25 | + # Without a source-tree - expect that the user has installed it for us - warn otherwise |
| 26 | + ObjectFile_pkgid = Base.PkgId(Base.UUID("d8793406-e978-5875-9003-1fc021f44a92"), "ObjectFile") |
| 27 | + if Base.locate_package(ObjectFile_pkgid) !== nothing |
| 28 | + @eval using ObjectFile |
| 29 | + end |
| 30 | +end |
| 31 | + |
| 32 | +if !@isdefined(ObjectFile) |
| 33 | + @warn("ObjectFile.jl not available; skipping stdlib JLL dependency tests") |
| 34 | +else |
12 | 35 | strip_soversion(lib::AbstractString) = Base.BinaryPlatforms.parse_dl_name_version(lib)[1] |
13 | 36 |
|
14 | 37 | function get_deps_objectfile_macos(lib_path::String) |
|
249 | 272 |
|
250 | 273 | # This is a manually-managed special case |
251 | 274 | if stdlib_name == "libblastrampoline_jll" && |
252 | | - prop_name == :libblastrampoline && |
253 | | - extraneous_deps in (["libopenblas64_"], ["libopenblas"]) |
| 275 | + prop_name == :libblastrampoline && |
| 276 | + extraneous_deps in (["libopenblas64_"], ["libopenblas"]) |
254 | 277 | deps_mismatch = false |
255 | 278 | end |
256 | 279 |
|
|
315 | 338 | end |
316 | 339 | end |
317 | 340 | end |
318 | | - |
319 | | -finally |
320 | | - if prev_env !== nothing |
321 | | - Pkg.activate(prev_env) |
322 | | - else |
323 | | - # If no previous environment, activate the default one |
324 | | - Pkg.activate() |
325 | | - end |
326 | 341 | end |
0 commit comments