1
1
export build_tarballs, autobuild, print_artifacts_toml, build, get_meta_json
2
2
import GitHub: gh_get_json, DEFAULT_API
3
3
import SHA: sha256, sha1
4
- using Pkg . TOML, Dates, UUIDs
4
+ using TOML, Dates, UUIDs
5
5
using RegistryTools
6
6
import LibGit2
7
7
import PkgLicenses
@@ -104,7 +104,7 @@ const BUILD_HELP = (
104
104
instead of actually building. Note that this can
105
105
(and often does) output multiple JSON objects for
106
106
multiple platforms, multi-stage builds, etc...
107
-
107
+
108
108
--skip-audit Skips auditing of the output products.
109
109
110
110
--help Print out this message.
@@ -543,8 +543,8 @@ function register_jll(name, build_version, dependencies, julia_compat;
543
543
code_dir= joinpath (Pkg. devdir (), " $(name) _jll" ),
544
544
gh_auth= Wizard. github_auth (;allow_anonymous= false ),
545
545
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 " ,
548
548
kwargs... )
549
549
if ! isempty (augment_platform_block) && minimum_compat (julia_compat) < v " 1.6"
550
550
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(
622
622
products:: Vector{<:Product} ,
623
623
dependencies:: Vector{<:AbstractDependency} ;
624
624
julia_compat:: String = DEFAULT_JULIA_VERSION_SPEC,
625
- lazy_artifacts:: Bool = false ,
626
625
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
+ )
628
629
629
630
dict = Dict (
630
631
" name" => src_name,
@@ -654,7 +655,7 @@ function compose_debug_prompt(workspace)
654
655
end
655
656
end
656
657
end
657
-
658
+
658
659
if length (log_files) > 0
659
660
log_files_str = join (log_files, " \n - " )
660
661
@@ -1064,7 +1065,6 @@ function rebuild_jll_package(obj::Dict;
1064
1065
build_version = nothing ,
1065
1066
gh_org:: String = " JuliaBinaryWrappers" ,
1066
1067
verbose:: Bool = false ,
1067
- lazy_artifacts:: Bool = false ,
1068
1068
from_scratch:: Bool = true )
1069
1069
if build_version === nothing
1070
1070
build_version = BinaryBuilder. get_next_wrapper_version (obj[" name" ], obj[" version" ])
@@ -1079,6 +1079,9 @@ function rebuild_jll_package(obj::Dict;
1079
1079
error (" If download_dir is specified, you must specify upload_prefix as well!" )
1080
1080
end
1081
1081
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" )
1082
1085
return rebuild_jll_package (
1083
1086
obj[" name" ],
1084
1087
build_version,
@@ -1088,12 +1091,12 @@ function rebuild_jll_package(obj::Dict;
1088
1091
obj[" dependencies" ],
1089
1092
download_dir,
1090
1093
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,
1094
1097
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,
1097
1100
)
1098
1101
end
1099
1102
@@ -1196,8 +1199,8 @@ function build_jll_package(src_name::String,
1196
1199
bin_path:: String ;
1197
1200
verbose:: Bool = false ,
1198
1201
julia_compat:: String = DEFAULT_JULIA_VERSION_SPEC,
1199
- init_block = " " ,
1200
- augment_platform_block = " " ,
1202
+ init_block:: String = " " ,
1203
+ augment_platform_block:: String = " " ,
1201
1204
# If we support versions older than Julia v1.7 the artifact
1202
1205
# should be lazy when we augment the platform.
1203
1206
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,
1327
1330
if ! isempty (augment_platform_block)
1328
1331
pkg_dir = joinpath (code_dir, " .pkg" )
1329
1332
! 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)
1335
1334
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__))
1339
1338
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")
1343
1342
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())
1346
1345
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)))
1349
1348
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)
1352
1351
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
+ """ )
1357
1355
end
1358
1356
1359
1357
# Generate target-demuxing main source file.
@@ -1419,9 +1417,9 @@ function build_jll_package(src_name::String,
1419
1417
if is_yggdrasil ()
1420
1418
println (io, """
1421
1419
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
+
1423
1421
## Bug Reports
1424
-
1422
+
1425
1423
If you have any issue, please report it to the Yggdrasil [bug tracker](https://github.com/JuliaPackaging/Yggdrasil/issues).
1426
1424
""" )
1427
1425
end
@@ -1505,7 +1503,7 @@ function build_jll_package(src_name::String,
1505
1503
jllwrappers_compat = isempty (augment_platform_block) ? " 1.2.0" : " 1.4.0"
1506
1504
project = build_project_dict (src_name, build_version, dependencies, julia_compat; lazy_artifacts, jllwrappers_compat, augment_platform_block)
1507
1505
open (joinpath (code_dir, " Project.toml" ), " w" ) do io
1508
- Pkg . TOML. print (io, project)
1506
+ TOML. print (io, project)
1509
1507
end
1510
1508
1511
1509
# Add a `.gitignore`
@@ -1579,8 +1577,8 @@ end
1579
1577
function build_project_dict (name, version, dependencies:: Array{Dependency} ,
1580
1578
julia_compat:: String = DEFAULT_JULIA_VERSION_SPEC;
1581
1579
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 " ,
1584
1582
kwargs... )
1585
1583
Pkg. Types. semver_spec (julia_compat) # verify julia_compat is valid
1586
1584
project = Dict (
0 commit comments