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

[Prefix] Handle package input on all dependencies #212

Open
wants to merge 1 commit 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
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
30 changes: 30 additions & 0 deletions test/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,36 @@ 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"
@test all(in(readdir(joinpath(destdir(dir, platform), "lib"))), ("libjulia.1.6.dylib", "libjulia.1.dylib", "libjulia.dylib")) 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