11export build_tarballs, autobuild, print_artifacts_toml, build, get_meta_json
22import GitHub: gh_get_json, DEFAULT_API
33import SHA: sha256, sha1
4- using Pkg . TOML, Dates, UUIDs
4+ using TOML, Dates, UUIDs
55using RegistryTools
66import LibGit2
77import PkgLicenses
@@ -104,7 +104,7 @@ const BUILD_HELP = (
104104 instead of actually building. Note that this can
105105 (and often does) output multiple JSON objects for
106106 multiple platforms, multi-stage builds, etc...
107-
107+
108108 --skip-audit Skips auditing of the output products.
109109
110110 --help Print out this message.
@@ -543,8 +543,8 @@ function register_jll(name, build_version, dependencies, julia_compat;
543543 code_dir= joinpath (Pkg. devdir (), " $(name) _jll" ),
544544 gh_auth= Wizard. github_auth (;allow_anonymous= false ),
545545 gh_username= gh_get_json (DEFAULT_API, " /user" ; auth= gh_auth)[" login" ],
546- lazy_artifacts :: Bool = false ,
547- augment_platform_block = " " ,
546+ augment_platform_block :: String = " " ,
547+ lazy_artifacts :: Bool = ! isempty (augment_platform_block) && minimum_compat (julia_compat) < v " 1.7 " ,
548548 kwargs... )
549549 if ! isempty (augment_platform_block) && minimum_compat (julia_compat) < v " 1.6"
550550 error (" Augmentation blocks cannot be used with Julia v1.5-.\n Change `julia_compat` to require at least Julia v1.6" )
@@ -622,9 +622,10 @@ function get_meta_json(
622622 products:: Vector{<:Product} ,
623623 dependencies:: Vector{<:AbstractDependency} ;
624624 julia_compat:: String = DEFAULT_JULIA_VERSION_SPEC,
625- lazy_artifacts:: Bool = false ,
626625 init_block:: String = " " ,
627- augment_platform_block:: String = " " )
626+ augment_platform_block:: String = " " ,
627+ lazy_artifacts:: Bool = ! isempty (augment_platform_block) && minimum_compat (julia_compat) < v " 1.7" ,
628+ )
628629
629630 dict = Dict (
630631 " name" => src_name,
@@ -654,7 +655,7 @@ function compose_debug_prompt(workspace)
654655 end
655656 end
656657 end
657-
658+
658659 if length (log_files) > 0
659660 log_files_str = join (log_files, " \n - " )
660661
@@ -1064,7 +1065,6 @@ function rebuild_jll_package(obj::Dict;
10641065 build_version = nothing ,
10651066 gh_org:: String = " JuliaBinaryWrappers" ,
10661067 verbose:: Bool = false ,
1067- lazy_artifacts:: Bool = false ,
10681068 from_scratch:: Bool = true )
10691069 if build_version === nothing
10701070 build_version = BinaryBuilder. get_next_wrapper_version (obj[" name" ], obj[" version" ])
@@ -1079,6 +1079,9 @@ function rebuild_jll_package(obj::Dict;
10791079 error (" If download_dir is specified, you must specify upload_prefix as well!" )
10801080 end
10811081
1082+ julia_compat = get (obj, " julia_compat" , DEFAULT_JULIA_VERSION_SPEC)
1083+ augment_platform_block = get (obj, " augment_platform_block" , " " )
1084+ lazy_artifacts = get (obj, " lazy_artifacts" , ! isempty (augment_platform_block) && minimum_compat (julia_compat) < v " 1.7" )
10821085 return rebuild_jll_package (
10831086 obj[" name" ],
10841087 build_version,
@@ -1088,12 +1091,12 @@ function rebuild_jll_package(obj::Dict;
10881091 obj[" dependencies" ],
10891092 download_dir,
10901093 upload_prefix;
1091- verbose= verbose ,
1092- lazy_artifacts = lazy_artifacts ,
1093- julia_compat = get (obj, " julia_compat " , DEFAULT_JULIA_VERSION_SPEC) ,
1094+ verbose,
1095+ lazy_artifacts,
1096+ julia_compat,
10941097 init_block = get (obj, " init_block" , " " ),
1095- augment_platform_block = get (obj, " augment_platform_block " , " " ) ,
1096- from_scratch = from_scratch ,
1098+ augment_platform_block,
1099+ from_scratch,
10971100 )
10981101end
10991102
@@ -1196,8 +1199,8 @@ function build_jll_package(src_name::String,
11961199 bin_path:: String ;
11971200 verbose:: Bool = false ,
11981201 julia_compat:: String = DEFAULT_JULIA_VERSION_SPEC,
1199- init_block = " " ,
1200- augment_platform_block = " " ,
1202+ init_block:: String = " " ,
1203+ augment_platform_block:: String = " " ,
12011204 # If we support versions older than Julia v1.7 the artifact
12021205 # should be lazy when we augment the platform.
12031206 lazy_artifacts:: Bool = ! isempty (augment_platform_block) && minimum_compat (julia_compat) < v " 1.7" ,
@@ -1327,33 +1330,28 @@ function build_jll_package(src_name::String,
13271330 if ! isempty (augment_platform_block)
13281331 pkg_dir = joinpath (code_dir, " .pkg" )
13291332 ! ispath (pkg_dir) && mkdir (pkg_dir)
1330- open (joinpath (pkg_dir, " platform_augmentation.jl" ), " w" ) do io
1331- println (io, """
1332- $(augment_platform_block)
1333- """ )
1334- end
1333+ write (joinpath (pkg_dir, " platform_augmentation.jl" ), augment_platform_block)
13351334
1336- open (joinpath (pkg_dir, " select_artifacts.jl" ), " w " ) do io
1337- println (io, """
1338- push!(Base.LOAD_PATH, dirname(@__DIR__))
1335+ write (joinpath (pkg_dir, " select_artifacts.jl" ),
1336+ """
1337+ push!(Base.LOAD_PATH, dirname(@__DIR__))
13391338
1340- using TOML, Artifacts, Base.BinaryPlatforms
1341- include("./platform_augmentation.jl")
1342- artifacts_toml = joinpath(dirname(@__DIR__), "Artifacts.toml")
1339+ using TOML, Artifacts, Base.BinaryPlatforms
1340+ include("./platform_augmentation.jl")
1341+ artifacts_toml = joinpath(dirname(@__DIR__), "Artifacts.toml")
13431342
1344- # Get "target triplet" from ARGS, if given (defaulting to the host triplet otherwise)
1345- target_triplet = get(ARGS, 1, Base.BinaryPlatforms.host_triplet())
1343+ # Get "target triplet" from ARGS, if given (defaulting to the host triplet otherwise)
1344+ target_triplet = get(ARGS, 1, Base.BinaryPlatforms.host_triplet())
13461345
1347- # Augment this platform object with any special tags we require
1348- platform = augment_platform!(HostPlatform(parse(Platform, target_triplet)))
1346+ # Augment this platform object with any special tags we require
1347+ platform = augment_platform!(HostPlatform(parse(Platform, target_triplet)))
13491348
1350- # Select all downloadable artifacts that match that platform
1351- artifacts = select_downloadable_artifacts(artifacts_toml; platform, include_lazy=true)
1349+ # Select all downloadable artifacts that match that platform
1350+ artifacts = select_downloadable_artifacts(artifacts_toml; platform, include_lazy=true)
13521351
1353- #Output the result to `stdout` as a TOML dictionary
1354- TOML.print(stdout, artifacts)
1355- """ )
1356- end
1352+ #Output the result to `stdout` as a TOML dictionary
1353+ TOML.print(stdout, artifacts)
1354+ """ )
13571355 end
13581356
13591357 # Generate target-demuxing main source file.
@@ -1419,9 +1417,9 @@ function build_jll_package(src_name::String,
14191417 if is_yggdrasil ()
14201418 println (io, """
14211419 The originating [`build_tarballs.jl`](https://github.com/JuliaPackaging/Yggdrasil/blob/$(yggdrasil_head ()) /$(ENV [" PROJECT" ]) /build_tarballs.jl) script can be found on [`Yggdrasil`](https://github.com/JuliaPackaging/Yggdrasil/), the community build tree.")
1422-
1420+
14231421 ## Bug Reports
1424-
1422+
14251423 If you have any issue, please report it to the Yggdrasil [bug tracker](https://github.com/JuliaPackaging/Yggdrasil/issues).
14261424 """ )
14271425 end
@@ -1505,7 +1503,7 @@ function build_jll_package(src_name::String,
15051503 jllwrappers_compat = isempty (augment_platform_block) ? " 1.2.0" : " 1.4.0"
15061504 project = build_project_dict (src_name, build_version, dependencies, julia_compat; lazy_artifacts, jllwrappers_compat, augment_platform_block)
15071505 open (joinpath (code_dir, " Project.toml" ), " w" ) do io
1508- Pkg . TOML. print (io, project)
1506+ TOML. print (io, project)
15091507 end
15101508
15111509 # Add a `.gitignore`
@@ -1579,8 +1577,8 @@ end
15791577function build_project_dict (name, version, dependencies:: Array{Dependency} ,
15801578 julia_compat:: String = DEFAULT_JULIA_VERSION_SPEC;
15811579 jllwrappers_compat:: String = DEFAULT_JLLWRAPPERS_VERSION_SPEC,
1582- lazy_artifacts :: Bool = false ,
1583- augment_platform_block = " " ,
1580+ augment_platform_block :: String = " " ,
1581+ lazy_artifacts :: Bool = ! isempty (augment_platform_block) && minimum_compat (julia_compat) < v " 1.7 " ,
15841582 kwargs... )
15851583 Pkg. Types. semver_spec (julia_compat) # verify julia_compat is valid
15861584 project = Dict (
0 commit comments