From 0041e76a6246b5cea76bc8b27aa258326a3fcdfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Mon, 18 May 2020 23:56:42 +0100 Subject: [PATCH] More robust check that artifact is installed This doesn't fail badly if the artifact is not available for the given platform. --- src/Prefix.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Prefix.jl b/src/Prefix.jl index 55a86ef5b..92105bdee 100644 --- a/src/Prefix.jl +++ b/src/Prefix.jl @@ -451,8 +451,12 @@ function setup_dependencies(prefix::Prefix, dependencies::Vector{PkgSpec}, platf continue end - # Make sure the artifact is actually installed. It may not be the case for lazy artifacts - ensure_artifact_installed(name[1:end-4], artifacts_toml; platform=platform) + # If the artifact is available for the given platform, make sure it + # is also installed. It may not be the case for lazy artifacts + meta = artifact_meta(name[1:end-4], artifacts_toml; platform=platform) + if meta !== nothing + ensure_artifact_installed(name[1:end-4], meta, artifacts_toml; platform=platform) + end # Copy the artifact from the global installation location into this build-specific artifacts collection src_path = Pkg.Artifacts.artifact_path(artifact_hash)