Skip to content

Commit

Permalink
add precompilation statements for Pkg3
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Feb 22, 2018
1 parent 28c0e9b commit 2f0db6d
Show file tree
Hide file tree
Showing 4 changed files with 281 additions and 4 deletions.
6 changes: 3 additions & 3 deletions stdlib/Pkg3/src/GraphType.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ mutable struct GraphData
versions::Dict{UUID,Set{VersionNumber}},
deps::Dict{UUID,Dict{VersionRange,Dict{String,UUID}}},
compat::Dict{UUID,Dict{VersionRange,Dict{String,VersionSpec}}},
uuid_to_name::Dict{UUID,String};
uuid_to_name::Dict{UUID,String},
verbose::Bool = false
)
# generate pkgs
Expand Down Expand Up @@ -246,15 +246,15 @@ mutable struct Graph
compat::Dict{UUID,Dict{VersionRange,Dict{String,VersionSpec}}},
uuid_to_name::Dict{UUID,String},
reqs::Requires = Requires(),
fixed::Dict{UUID,Fixed} = Dict{UUID,Fixed}(uuid_julia=>Fixed(VERSION));
fixed::Dict{UUID,Fixed} = Dict{UUID,Fixed}(uuid_julia=>Fixed(VERSION)),
verbose::Bool = false
)

extra_uuids = union(keys(reqs), keys(fixed), map(fx->keys(fx.requires), values(fixed))...)
extra_uuids keys(versions) || error("unknown UUID found in reqs/fixed") # TODO?

# Type assert below due to https://github.com/JuliaLang/julia/issues/25918
data = GraphData(versions, deps, compat, uuid_to_name, verbose = verbose)::GraphData
data = GraphData(versions, deps, compat, uuid_to_name, verbose)::GraphData
pkgs, np, spp, pdict, pvers, vdict, rlog = data.pkgs, data.np, data.spp, data.pdict, data.pvers, data.vdict, data.rlog

local extended_deps
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Pkg3/src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function deps_graph(ctx::Context, uuid_to_name::Dict{UUID,String}, reqs::Require
uuid_to_name[UUID(info["uuid"])] = info["name"]
end

return Graph(all_versions, all_deps, all_compat, uuid_to_name, reqs, fixed; verbose=ctx.graph_verbose)
return Graph(all_versions, all_deps, all_compat, uuid_to_name, reqs, fixed, #=verbose=# ctx.graph_verbose)
end

# Resolve a set of versions given package version specs
Expand Down
5 changes: 5 additions & 0 deletions stdlib/Pkg3/src/Pkg3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ function __init__()
end
end

using Pkg3.Types
using UUIDs
import LibGit2
include("precompile.jl")

end # module
Loading

0 comments on commit 2f0db6d

Please sign in to comment.