Skip to content

Commit 0238730

Browse files
giordanostaticfloat
authored andcommitted
Add keyword argument lazy_artifacts for build_tarballs() (#613)
1 parent 512c4a4 commit 0238730

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/AutoBuild.jl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ function build_tarballs(ARGS, src_name, src_version, sources, script,
224224
# The location the binaries will be available from
225225
bin_path = "https://github.com/$(deploy_jll_repo)/releases/download/$(tag)"
226226
build_jll_package(src_name, build_version, code_dir, build_output_meta,
227-
dependencies, bin_path; verbose=verbose)
227+
dependencies, bin_path; verbose=verbose,
228+
extract_kwargs(kwargs, (:lazy_artifacts,))...,
229+
)
228230
push_jll_package(src_name, build_version; code_dir=code_dir, deploy_repo=deploy_repo)
229231
if register
230232
if verbose
@@ -544,6 +546,8 @@ here are the relevant actors, broken down in brief:
544546
* `require_license` enables a special audit pass that requires licenses to be
545547
installed by all packages.
546548
549+
* `lazy_artifacts` sets whether the artifacts should be lazy.
550+
547551
* `meta_json_stream`: If this is set to an IOStream, do not actually build, just
548552
output a JSON representation of all the metadata about this build to the stream.
549553
"""
@@ -562,6 +566,7 @@ function autobuild(dir::AbstractString,
562566
autofix::Bool = true,
563567
code_dir::Union{String,Nothing} = nothing,
564568
require_license::Bool = true,
569+
lazy_artifacts::Bool = false,
565570
meta_json_stream = nothing,
566571
kwargs...)
567572
# If they've asked for the JSON metadata, by all means, give it to them!
@@ -577,6 +582,7 @@ function autobuild(dir::AbstractString,
577582
"platforms" => triplet.(platforms),
578583
"products" => products,
579584
"dependencies" => dep_name.(dependencies),
585+
"lazy_artifacts" => lazy_artifacts,
580586
)))
581587
return Dict()
582588
end
@@ -867,7 +873,7 @@ function init_jll_package(name, code_dir, deploy_repo;
867873
end
868874
end
869875

870-
function rebuild_jll_packages(obj::Dict; build_version = nothing, verbose::Bool = false)
876+
function rebuild_jll_packages(obj::Dict; build_version = nothing, verbose::Bool = false, lazy_artifacts::Bool = false)
871877
if build_version === nothing
872878
build_version = BinaryBuilder.get_next_wrapper_version(obj["name"], obj["version"])
873879
end
@@ -878,14 +884,15 @@ function rebuild_jll_packages(obj::Dict; build_version = nothing, verbose::Bool
878884
obj["products"],
879885
obj["dependencies"],
880886
verbose=verbose,
887+
lazy_artifacts = lazy_artifacts,
881888
)
882889
end
883890

884891
function rebuild_jll_packages(name::String, build_version::VersionNumber,
885892
platforms::Vector, products::Vector, dependencies::Vector;
886893
gh_org::String = "JuliaBinaryWrappers",
887894
code_dir::String = joinpath(Pkg.devdir(), "$(name)_jll"),
888-
verbose::Bool = false)
895+
verbose::Bool = false, lazy_artifacts::Bool = false)
889896
repo = "$(gh_org)/$(name)_jll.jl"
890897
tag = "$(name)-v$(build_version)"
891898
bin_path = "https://github.com/$(repo)/releases/download/$(tag)"
@@ -948,13 +955,13 @@ function rebuild_jll_packages(name::String, build_version::VersionNumber,
948955
end
949956

950957
# Finally, generate the full JLL package
951-
build_jll_package(name, build_version, code_dir, build_output_meta, dependencies, bin_path; verbose=verbose)
958+
build_jll_package(name, build_version, code_dir, build_output_meta, dependencies, bin_path; verbose=verbose, lazy_artifacts=lazy_artifacts)
952959
end
953960
end
954961

955962
function build_jll_package(src_name::String, build_version::VersionNumber, code_dir::String,
956963
build_output_meta::Dict, dependencies::Vector, bin_path::String;
957-
verbose::Bool = false)
964+
verbose::Bool = false, lazy_artifacts::Bool = false)
958965
# Make way, for prince artifacti
959966
mkpath(joinpath(code_dir, "src", "wrappers"))
960967

@@ -973,7 +980,7 @@ function build_jll_package(src_name::String, build_version::VersionNumber, code_
973980
download_info = Tuple[
974981
(joinpath(bin_path, basename(tarball_name)), tarball_hash),
975982
]
976-
bind_artifact!(artifacts_toml, src_name, git_hash; platform=platform, download_info=download_info, force=true)
983+
bind_artifact!(artifacts_toml, src_name, git_hash; platform=platform, download_info=download_info, force=true, lazy=lazy_artifacts)
977984

978985
# Generate the platform-specific wrapper code
979986
open(joinpath(code_dir, "src", "wrappers", "$(triplet(platform)).jl"), "w") do io

src/compat.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function extract_kwargs(kwargs, keys)
2-
return (k => v for (k, v) in kwargs if k in keys)
2+
return (k => v for (k, v) in pairs(kwargs) if k in keys)
33
end

0 commit comments

Comments
 (0)