Skip to content

Commit

Permalink
fix STDLIBS_BY_VERSION on non-latest version of Julia
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Apr 6, 2021
1 parent 185b7f7 commit 6a9c8bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ext/HistoricaStdlibGenerator/generate_historical_stdlibs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ open(output_fname, "w") do io
# Julia standard libraries with duplicate entries removed so as to store only the
# first release in a set of releases that all contain the same set of stdlibs.
const STDLIBS_BY_VERSION = [
const STDLIBS_BY_VERSION = Dict(
""")
for v in sorted_versions
print(io, " $(repr(v)) => ")
print_sorted(io, versions_dict[v]; indent=8)
println(io, ",")
end
println(io, "]")
println(io, ")")

print(io, """
# Next, we also embed a list of stdlibs that must _always_ be treated as stdlibs,
Expand Down
4 changes: 2 additions & 2 deletions src/HistoricalStdlibs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Base: UUID

# Julia standard libraries with duplicate entries removed so as to store only the
# first release in a set of releases that all contain the same set of stdlibs.
const STDLIBS_BY_VERSION = [
const STDLIBS_BY_VERSION = Dict(
v"1.0.0" => Dict(
UUID("2a0f44e3-6c83-55bd-87e4-b1978d98bd5f") => "Base64",
UUID("8bf52ea8-c179-5cab-976a-9e18b702a9bc") => "CRC32c",
Expand Down Expand Up @@ -155,7 +155,7 @@ const STDLIBS_BY_VERSION = [
UUID("8e850ede-7688-5339-a07c-302acd2aaf8d") => "nghttp2_jll",
UUID("3f19e933-33d8-53b3-aaab-bd5110c3b7a0") => "p7zip_jll",
),
]
)
# Next, we also embed a list of stdlibs that must _always_ be treated as stdlibs,
# because they cannot be resolved in the registry; they have only ever existed within
# the Julia stdlib source tree, and because of that, trying to resolve them will fail.
Expand Down
7 changes: 4 additions & 3 deletions test/new.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2603,11 +2603,12 @@ using Pkg.Types: is_stdlib
end

@testset "STDLIBS_BY_VERSION up-to-date" begin
test_result = Pkg.Types.STDLIBS_BY_VERSION[end][2] == Pkg.Types.load_stdlib()
v = VersionNumber(VERSION.major, VERSION.minor, VERSION.patch)
test_result = Pkg.Types.STDLIBS_BY_VERSION[v] == Pkg.Types.load_stdlib()
if !test_result
@error("STDLIBS_BY_VERSION out of date! Manually fix given the info below, or re-run generate_historical_stdlibs.jl!")
@show length(Pkg.Types.STDLIBS_BY_VERSION[end][2]) length(Pkg.Types.load_stdlib())
@show setdiff(Pkg.Types.STDLIBS_BY_VERSION[end][2], Pkg.Types.load_stdlib())
@show length(Pkg.Types.STDLIBS_BY_VERSION[v]) length(Pkg.Types.load_stdlib())
@show setdiff(Pkg.Types.STDLIBS_BY_VERSION[v], Pkg.Types.load_stdlib())
@show setdiff(Pkg.Types.load_stdlib(), Pkg.Types.STDLIBS_BY_VERSION[end][2])
end
@test test_result
Expand Down

0 comments on commit 6a9c8bb

Please sign in to comment.