diff --git a/src/DepotDelivery.jl b/src/DepotDelivery.jl index c7ae5bf..802d289 100644 --- a/src/DepotDelivery.jl +++ b/src/DepotDelivery.jl @@ -28,7 +28,7 @@ function sandbox(f::Function) end #-----------------------------------------------------------------------------# build -function build(path::String; platform = Base.BinaryPlatforms.HostPlatform()) +function build(path::String; platform = Base.BinaryPlatforms.HostPlatform(), verbose=true) depot = mktempdir() sandbox() do proj_file = joinpath(path, "Project.toml") @@ -38,7 +38,7 @@ function build(path::String; platform = Base.BinaryPlatforms.HostPlatform()) name = proj["name"] build_spec = Dict( :datetime => Dates.now(), - :versioninfo => (buf = IOBuffer(); InteractiveUtils.versioninfo(buf); String(take!(buf))), + :versioninfo => sprint(InteractiveUtils.versioninfo), :project_file => proj_file, :project => proj, :platform => string(platform) @@ -50,7 +50,15 @@ function build(path::String; platform = Base.BinaryPlatforms.HostPlatform()) cp(path, joinpath(depot, "dev", name)) # Copy project into dev/ Pkg.activate(joinpath(depot, "dev", name)) - Pkg.instantiate(; platform) + Pkg.instantiate(; platform, verbose) + + # Ensure all artifacts (including lazy ones) are installed for the correct platform + manifest_file = replace(proj_file, "Project" => "Manifest") + for (uuid, entry) in Pkg.Types.read_manifest(manifest_file) + src = Pkg.dir(entry.name) # How to get the source directory of a package? + # find entry's Artifacts.toml + end + open(io -> TOML.print(io, build_spec), joinpath(depot, "config", "depot_build.toml"), "w") open(io -> print(io, startup_script(name)), joinpath(depot, "config", "depot_startup.jl"), "w") diff --git a/test/TestProject/Manifest.toml b/test/TestProject/Manifest.toml index 0c3742c..b12c43e 100644 --- a/test/TestProject/Manifest.toml +++ b/test/TestProject/Manifest.toml @@ -1,8 +1,8 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.10.1" +julia_version = "1.10.2" manifest_format = "2.0" -project_hash = "441ce5673294795b2311ef0d574564a3f3e7c070" +project_hash = "b6c8be5a742fdffa37a9701ccc32d1928629b873" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" @@ -58,7 +58,7 @@ version = "0.17.1" [[deps.HDF5_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "LibCURL_jll", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "OpenSSL_jll", "TOML", "Zlib_jll", "libaec_jll"] -git-tree-sha1 = "e4591176488495bf44d7456bd73179d87d5e6eab" +path = "/Users/joshday/.julia/dev/HDF5_jll" uuid = "0234f1f7-429e-5d53-9886-15a909be8d59" version = "1.14.3+1" diff --git a/test/TestProject/Project.toml b/test/TestProject/Project.toml index 45921b6..8ab360d 100644 --- a/test/TestProject/Project.toml +++ b/test/TestProject/Project.toml @@ -3,3 +3,4 @@ uuid = "f3e3185f-ad83-4044-845c-222ba027dc34" [deps] HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" +HDF5_jll = "0234f1f7-429e-5d53-9886-15a909be8d59" diff --git a/test/runtests.jl b/test/runtests.jl index 07177b5..a6e1f16 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -12,3 +12,8 @@ DepotDelivery.sandbox() do @test !occursin(".julia", pathof(TestProject.HDF5)) @test !occursin(".julia", pathof(TestProject.HDF5.API.HDF5_jll)) end + + +depot2 = DepotDelivery.build(joinpath(@__DIR__, "TestProject"), platform = Pkg.BinaryPlatforms.Windows(:x86_64)) + +path = joinpath(depot2, "packages", "HDF5_jll")