Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/HistoricalStdlibs.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
using Base: UUID

const DictStdLibs = Dict{UUID,Tuple{String,Union{VersionNumber,Nothing}}}

# 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.
#
# This needs to be populated via HistoricalStdlibVersions.jl by consumers
# (e.g. BinaryBuilder) that want to use the "resolve things as if it were a
# different Julia version than what is currently running" feature.
const STDLIBS_BY_VERSION = Pair{VersionNumber, Dict{UUID}}[]
const STDLIBS_BY_VERSION = Pair{VersionNumber, DictStdLibs}[]

# This is 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.
const UNREGISTERED_STDLIBS = Dict{UUID,Tuple{String,Union{VersionNumber,Nothing}}}(
const UNREGISTERED_STDLIBS = DictStdLibs(
UUID("2a0f44e3-6c83-55bd-87e4-b1978d98bd5f") => ("Base64", nothing),
UUID("8bf52ea8-c179-5cab-976a-9e18b702a9bc") => ("CRC32c", nothing),
UUID("ade2ca70-3891-5945-98fb-dc099432e06a") => ("Dates", nothing),
Expand Down
6 changes: 3 additions & 3 deletions src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Base.@kwdef mutable struct Project
deps::Dict{String,UUID} = Dict{String,UUID}()
# deps that are also in weakdeps for backwards compat
# we do not store them in deps because we want to ignore them
# but for writing out the project file we need to remember them:
# but for writing out the project file we need to remember them:
_deps_weak::Dict{String,UUID} = Dict{String,UUID}()
weakdeps::Dict{String,UUID} = Dict{String,UUID}()
exts::Dict{String,Union{Vector{String}, String}} = Dict{String,String}()
Expand Down Expand Up @@ -407,9 +407,9 @@ is_project_uuid(env::EnvCache, uuid::UUID) = project_uuid(env) == uuid
# Context #
###########

const STDLIB = Ref{Dict{UUID,Tuple{String,Union{VersionNumber,Nothing}}}}()
const STDLIB = Ref{DictStdLibs}()
function load_stdlib()
stdlib = Dict{UUID,Tuple{String,Union{VersionNumber,Nothing}}}()
stdlib = DictStdLibs()
for name in readdir(stdlib_dir())
projfile = projectfile_path(stdlib_path(name); strict=true)
nothing === projfile && continue
Expand Down