Skip to content

Commit 28af078

Browse files
authored
[AutoBuild] Make artifacts lazy by default if augmenting platform (#1190)
1 parent b96f15a commit 28af078

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/AutoBuild.jl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ function Base.show(io::IO, t::BuildTimer)
4343
end
4444
end
4545

46+
# Helper function to get the minimum version supported by the given compat
47+
# specification, given as a string.
48+
minimum_compat(compat::String) =
49+
minimum(VersionNumber(rng.lower.t) for rng in PKG_VERSIONS.semver_spec(compat).ranges)
50+
4651
const BUILD_HELP = (
4752
"""
4853
Usage: build_tarballs.jl [target1,target2,...] [--help]
@@ -174,7 +179,7 @@ function build_tarballs(ARGS, src_name, src_version, sources, script,
174179
end
175180

176181
# Throw an error if we're going to build for platforms not supported by Julia v1.5-.
177-
if any(p -> arch(p) == "armv6l" || (Sys.isapple(p) && arch(p) == "aarch64"), platforms) && minimum(VersionNumber(rng.lower.t) for rng in PKG_VERSIONS.semver_spec(julia_compat).ranges) < v"1.6"
182+
if any(p -> arch(p) == "armv6l" || (Sys.isapple(p) && arch(p) == "aarch64"), platforms) && minimum_compat(julia_compat) < v"1.6"
178183
error("Experimental platforms cannot be used with Julia v1.5-.\nChange `julia_compat` to require at least Julia v1.6")
179184
end
180185

@@ -541,8 +546,7 @@ function register_jll(name, build_version, dependencies, julia_compat;
541546
lazy_artifacts::Bool=false,
542547
augment_platform_block="",
543548
kwargs...)
544-
if !isempty(augment_platform_block) &&
545-
minimum(VersionNumber(rng.lower.t) for rng in PKG_VERSIONS.semver_spec(julia_compat).ranges) < v"1.6"
549+
if !isempty(augment_platform_block) && minimum_compat(julia_compat) < v"1.6"
546550
error("Augmentation blocks cannot be used with Julia v1.5-.\nChange `julia_compat` to require at least Julia v1.6")
547551
end
548552

@@ -1192,9 +1196,12 @@ function build_jll_package(src_name::String,
11921196
bin_path::String;
11931197
verbose::Bool = false,
11941198
julia_compat::String = DEFAULT_JULIA_VERSION_SPEC,
1195-
lazy_artifacts::Bool = false,
11961199
init_block = "",
1197-
augment_platform_block = "",)
1200+
augment_platform_block = "",
1201+
# If we support versions older than Julia v1.7 the artifact
1202+
# should be lazy when we augment the platform.
1203+
lazy_artifacts::Bool = !isempty(augment_platform_block) && minimum_compat(julia_compat) < v"1.7",
1204+
)
11981205
# Make way, for prince artifacti
11991206
mkpath(joinpath(code_dir, "src", "wrappers"))
12001207

0 commit comments

Comments
 (0)