diff --git a/src/Prefix.jl b/src/Prefix.jl index 35ebe065..7201f286 100644 --- a/src/Prefix.jl +++ b/src/Prefix.jl @@ -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 diff --git a/test/dependencies.jl b/test/dependencies.jl index bc4bfa5f..f5e6f37b 100644 --- a/test/dependencies.jl +++ b/test/dependencies.jl @@ -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