From c44b463098c826ad729c47aa9fc8f8266f8671db Mon Sep 17 00:00:00 2001 From: Kristoffer Date: Sun, 27 Nov 2022 13:21:39 +0100 Subject: [PATCH] get rid of some non-needed code --- base/loading.jl | 57 ------------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 96f726a2189636..4b038d091d4dec 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -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 @@ -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 @@ -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) @@ -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 @@ -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}