Skip to content

Commit

Permalink
get rid of some non-needed code
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Nov 27, 2022
1 parent 08240da commit c44b463
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,6 @@ function manifest_deps_get(env::String, where::PkgId, name::String)::Union{Nothi
pkg_uuid = explicit_project_deps_get(project_file, name)
return PkgId(pkg_uuid, name)
end
# Check for this being a dependency to a glue module
# glue_dep = project_file_gluedeps_get(project_file, where, name)
# glue_dep === nothing || return glue_dep
# look for manifest file and `where` stanza
return explicit_manifest_deps_get(project_file, where, name)
elseif project_file
Expand All @@ -583,10 +580,6 @@ function manifest_uuid_path(env::String, pkg::PkgId)::Union{Nothing,String,Missi
# if `pkg` matches the project, return the project itself
return project_file_path(project_file)
end
# Only used when the project is loading the glue pkg itself
# which is currently not supported
# mby_glue = project_file_glue_path(project_file, pkg.name)
# mby_glue === nothing || return mby_glue
# look for manifest file and `where` stanza
return explicit_manifest_uuid_path(project_file, pkg)
elseif project_file
Expand All @@ -605,40 +598,6 @@ function project_file_name_uuid(project_file::String, name::String)::PkgId
return PkgId(uuid, name)
end

function project_file_gluedeps_get(project_file::String, where::PkgId, name::String)
d = parsed_toml(project_file)
glue = get(d, "gluepkgs", nothing)::Union{Dict{String, Any}, Nothing}
project_id = project_file_name_uuid(project_file, "")
if glue !== nothing && where.uuid == uuid5(project_id.uuid, where.name)
gluedeps = get(glue, where.name, nothing)::Union{Nothing, String, Vector{String}}
if gluedeps !== nothing
if gluedeps isa String && name == gluedeps ||
gluedeps isa Vector{String} && name in gluedeps
gluedepses = get(d, "gluedeps", nothing)::Union{Dict{String, Any}, Nothing}
return PkgId(UUID(gluedepses[name]::String), name)
end
# Fall back to normal rules for loading a dep for a a package
return identify_package(project_id, name)
end
end
return nothing
end

function project_file_glue_path(project_file::String, name::String)
d = parsed_toml(project_file)
p = project_file_path(project_file)
glue = get(d, "gluepkgs", nothing)::Union{Dict{String, Any}, Nothing}
if glue !== nothing
if name in keys(glue)
gluefile = joinpath(p, "glue", name * ".jl")
isfile(gluefile) && return gluefile
gluefiledir = joinpath(p, "glue", name, name * ".jl")
isfile(gluefiledir) && return gluefiledir
end
end
return nothing
end

function project_file_path(project_file::String)
d = parsed_toml(project_file)
joinpath(dirname(project_file), get(d, "path", "")::String)
Expand Down Expand Up @@ -730,16 +689,6 @@ function explicit_project_deps_get(project_file::String, name::String)::Union{No
uuid = get(deps, name, nothing)::Union{String, Nothing}
uuid === nothing || return UUID(uuid)
end

#=
# Unclear if this is needed
glue = get(d, "gluepkgs", nothing)::Union{Dict{String, Any}, Nothing}
if glue !== nothing
if name in keys(glue)
return uuid5(uuid_project, name)
end
end
=#
return nothing
end

Expand Down Expand Up @@ -783,12 +732,6 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
uuid === nothing && continue
if UUID(uuid) === where.uuid
found_where = true
gluepkgs = get(entry, "gluepkgs", nothing)::Union{Nothing, Dict{String, Any}}
if gluepkgs !== nothing
if name in keys(gluepkgs)
return PkgId(uuid5(where.uuid, name), name)
end
end
# deps is either a list of names (deps = ["DepA", "DepB"]) or
# a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
deps = get(entry, "deps", nothing)::Union{Vector{String}, Dict{String, Any}, Nothing}
Expand Down

0 comments on commit c44b463

Please sign in to comment.