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

Add a test for get_addable_spec #207

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Prefix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,7 @@ function setup_dependencies(prefix::Prefix,

# Re-install stdlib dependencies, but this time with `julia_version = nothing`
if !isempty(stdlib_pkgspecs)
#ctx = Pkg.Types.Context!(ctx; julia_version=nothing)
Pkg.add(ctx, stdlib_pkgspecs; julia_version=nothing)
Pkg.add(ctx, stdlib_pkgspecs; io=outs, julia_version=nothing)
end

# Load their Artifacts.toml files
Expand Down
16 changes: 15 additions & 1 deletion test/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ end
end

@testset "Setup" begin
@test BinaryBuilderBase.get_addable_spec("LLVM_jll", v"13.0.0+2") ==
@test get_addable_spec("LLVM_jll", v"13.0.0+2") ==
PackageSpec(
name="LLVM_jll",
uuid="86de99a1-58d6-5da7-8064-bd56ce2e322c",
Expand Down Expand Up @@ -134,6 +134,20 @@ end
@test readdir(joinpath(destdir(dir, platform), "logs")) == []
end

# Make sure we can use `get_addable_spec` to work around
# https://github.com/JuliaLang/Pkg.jl/issues/2942
with_temp_project() do dir
prefix = Prefix(dir)
spec = get_addable_spec("LibOSXUnwind_jll", v"0.0.6+1")
dependencies = [BuildDependency(spec)]
platform = Platform("x86_64", "macos"; julia_version="1.6.0")
@test setup_dependencies(prefix, getpkg.(dependencies), platform) isa Vector{String} broken=VERSION<v"1.8.0-DEV"
@test all(in(readdir(joinpath(destdir(dir, platform), "lib"))), ("libosxunwind.a", "libosxunwind.dylib")) broken=VERSION<v"1.8.0-DEV"
# Make sure the right directory is installed. Note: for this test to be more reliable we'd need a clean depot.
pkg_dir = Pkg.Operations.find_installed(spec.name, spec.uuid, spec.tree_hash)
@test isdir(pkg_dir) broken=VERSION<v"1.8.0-DEV"
end

# Setup a dependency of a JLL package which is also a standard library
with_temp_project() do dir
prefix = Prefix(dir)
Expand Down