Skip to content

Commit

Permalink
[Prefix] Handle package input on all dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Jan 27, 2022
1 parent 48d2dbc commit 5312ce3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Prefix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ function setup_dependencies(prefix::Prefix,
return p
end
dependencies = filter_redundant_version.(dependencies)
Pkg.API.handle_package_input!.(dependencies)
dependencies_names = getname.(dependencies)

# Get julia version specificity, if it exists, from the `Platform` object
Expand Down
29 changes: 29 additions & 0 deletions test/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,35 @@ end
@test readdir(joinpath(destdir(dir, platform), "logs")) == []
end

# Make sure we can use `get_addable_spec` to install weird packages like
# `LibOSXUnwind_jll` v0.0.6+1, see 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")
pkg_dir = Pkg.Operations.find_installed(spec.name, spec.uuid, spec.tree_hash)
# Delete the directory where the package would be installed, to make sure it is
# actually installed. Note: a cleaner way to do this would be to use a fresh
# depot, but it'd add lots of complexity and this package isn't needed by any
# sane project.
rm(pkg_dir; recursive=true, force=true)
# This is broken in v1.7, see https://github.com/JuliaLang/Pkg.jl/issues/2942
@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.
@test isdir(pkg_dir) broken=VERSION<v"1.8.0-DEV"
end

# Make sure we can install `libjulia_jll` for julia v1.6.0
with_temp_project() do dir
prefix = Prefix(dir)
dependencies = [BuildDependency("libjulia_jll")]
platform = Platform("x86_64", "macos"; julia_version="1.6.0")
# This is broken in v1.7, see https://github.com/JuliaLang/Pkg.jl/issues/2942
@test setup_dependencies(prefix, getpkg.(dependencies), platform) isa Vector{String} 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

0 comments on commit 5312ce3

Please sign in to comment.