@@ -28,7 +28,7 @@ function generate_imports(src_name)
2828 # Use slow Pkg-based Artifacts
2929 return quote
3030 using Libdl, Pkg, Pkg. BinaryPlatforms, Pkg. Artifacts
31- using Pkg. Artifacts: load_artifacts_toml, unpack_platform
31+ using Pkg. Artifacts: load_artifacts_toml, unpack_platform, ensure_artifact_installed
3232 using Pkg. BinaryPlatforms: triplet, select_platform
3333 HostPlatform () = platform_key_abi ()
3434 if ! @isdefined (augment_platform!)
@@ -41,6 +41,7 @@ function generate_imports(src_name)
4141 using Libdl, Artifacts, JLLWrappers. Preferences, Base. BinaryPlatforms
4242 using Artifacts: load_artifacts_toml, unpack_platform
4343 using Base. BinaryPlatforms: triplet, select_platform
44+ using Pkg. Artifacts: ensure_artifact_installed
4445 if ! @isdefined (augment_platform!)
4546 augment_platform! (platform) = platform
4647 end
@@ -128,8 +129,8 @@ function generate_wrapper_load(src_name, pkg_uuid, __source__)
128129 # a `let` block here to avoid storing unnecessary data in our `.ji` files
129130
130131 const host_platform = augment_platform! (HostPlatform ())
132+ const artifacts_toml = joinpath ($ (pkg_dir), " .." , " Artifacts.toml" )
131133 best_wrapper = let
132- artifacts_toml = joinpath ($ (pkg_dir), " .." , " Artifacts.toml" )
133134 valid_wrappers = Dict {Platform,String} ()
134135 artifacts = load_artifacts_toml (artifacts_toml; pkg_uuid= $ (pkg_uuid))[$ (src_name)]
135136
@@ -175,6 +176,8 @@ function generate_wrapper_load(src_name, pkg_uuid, __source__)
175176 @debug (string (" Unable to load " , $ (src_name), " ; unsupported platform " , triplet (host_platform)))
176177 is_available () = false
177178 else
179+ # FIXME : This is horrid
180+ ensure_artifact_installed ($ (src_name), artifacts_toml; platform= host_platform, pkg_uuid= $ (pkg_uuid))
178181 Base. include ($ (Symbol (" $(src_name) _jll" )), best_wrapper)
179182 is_available () = true
180183 end
0 commit comments