File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -533,12 +533,23 @@ function get_last_stdlibs(julia_version::VersionNumber; use_historical_for_curre
533533 end
534534 historical_stdlibs_check ()
535535 last_stdlibs = UNREGISTERED_STDLIBS
536+ last_version = nothing
537+
536538 for (version, stdlibs) in STDLIBS_BY_VERSION
539+ if ! isnothing (last_version) && last_version > version
540+ pkgerror (" STDLIBS_BY_VERSION must be sorted by version number" )
541+ end
537542 if VersionNumber (julia_version. major, julia_version. minor, julia_version. patch) < version
538543 break
539544 end
540545 last_stdlibs = stdlibs
546+ last_version = version
541547 end
548+ # Serving different patches is safe-ish, but different majors or minors is most likely not.
549+ if last_version != = nothing && (last_version. major != julia_version. major || last_version. minor != julia_version. minor)
550+ pkgerror (" Could not find a julia version in STDLIBS_BY_VERSION that matches the major & minor version of requested julia_version v$(julia_version) " )
551+ end
552+
542553 return last_stdlibs
543554end
544555# If `julia_version` is set to `nothing`, that means (essentially) treat all registered
Original file line number Diff line number Diff line change @@ -31,10 +31,13 @@ using .Utils
3131 @test is_stdlib (pkg_uuid)
3232 @test is_stdlib (pkg_uuid, v " 1.0" )
3333 @test is_stdlib (pkg_uuid, v " 1.6" )
34- @test is_stdlib (pkg_uuid, v " 999.999.999" )
3534 @test is_stdlib (pkg_uuid, v " 0.7" )
3635 @test is_stdlib (pkg_uuid, nothing )
3736
37+ # We can't serve information for unknown major.minor versions (patches can not match)
38+ @test_throws Pkg. Types. PkgError is_stdlib (pkg_uuid, v " 999.999.999" )
39+ @test is_stdlib (pkg_uuid, v " 1.10.999" )
40+
3841 # MbedTLS_jll stopped being a stdlib in 1.12
3942 @test ! is_stdlib (mbedtls_jll_uuid)
4043 @test ! is_stdlib (mbedtls_jll_uuid, v " 1.12" )
You can’t perform that action at this time.
0 commit comments