Skip to content

Commit

Permalink
Merge pull request #26152 from JuliaLang/sk/pkg3bikeshed
Browse files Browse the repository at this point in the history
Pkg3: the great bikeshed rename
  • Loading branch information
StefanKarpinski authored Feb 24, 2018
2 parents 7a0b38d + 9f633a5 commit a61ed85
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 42 deletions.
18 changes: 9 additions & 9 deletions stdlib/Pkg3/bin/generate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

prefix = joinpath(homedir(), ".julia", "registries", "Uncurated")

write_toml(prefix, "registry") do io
write_toml(prefix, "Registry") do io
repo = "https://github.com/JuliaRegistries/Uncurated.git"
uuid = string(uuid5(uuid_registry, repo))
println(io, "name = ", repr("Uncurated"))
Expand Down Expand Up @@ -64,15 +64,15 @@ for (bucket, b_pkgs) in buckets, (pkg, p) in b_pkgs
uuid = string(p.uuid)
startswith(url, "git://github.com") && (url = "https"*url[4:end])

# package.toml
write_toml(prefix, bucket, pkg, "package") do io
# Package.toml
write_toml(prefix, bucket, pkg, "Package") do io
println(io, "name = ", repr(pkg))
println(io, "uuid = ", repr(uuid))
println(io, "repo = ", repr(url))
end

# versions.toml
write_toml(prefix, bucket, pkg, "versions") do io
# Versions.toml
write_toml(prefix, bucket, pkg, "Versions") do io
for (i, (ver, v)) in enumerate(sort!(collect(p.versions), by=first))
i > 1 && println(io)
println(io, "[", toml_key(string(ver)), "]")
Expand Down Expand Up @@ -108,13 +108,13 @@ for (bucket, b_pkgs) in buckets, (pkg, p) in b_pkgs
end
end

# dependencies.toml
write_versions_data("dependencies") do dep, d
# Deps.toml
write_versions_data("Deps") do dep, d
dep == "julia" ? nothing : repr(string(pkgs[dep].uuid))
end

# compatibility.toml
write_versions_data("compatibility", lt=packagelt) do dep, d
# Compat.toml
write_versions_data("Compat", lt=packagelt) do dep, d
dep in STDLIBS ? nothing : versions_repr(compress_versions(
d.versions, collect(keys(pkgs[dep].versions))
))
Expand Down
22 changes: 11 additions & 11 deletions stdlib/Pkg3/bin/genstdlib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ for pkg in readdir(stdlibdir)
end

#=
write_toml(prefix, "registry") do io
write_toml(prefix, "Registry") do io
repo = "https://github.com/JuliaRegistries/Stdlib.git"
uuid = string(uuid5(uuid_registry, repo))
println(io, "name = ", repr("Stdlib"))
Expand All @@ -50,33 +50,33 @@ for (pkg, uuid) in stdlib_uuids
tree = stdlib_trees[pkg]
deps = stdlib_deps[pkg]
# package.toml
write_toml(prefix, pkg, "package") do io
# Package.toml
write_toml(prefix, pkg, "Package") do io
println(io, "name = ", repr(pkg))
println(io, "uuid = ", repr(uuid))
println(io, "repo = ", repr(url))
end
# versions.toml
write_toml(prefix, pkg, "versions") do io
# Versions.toml
write_toml(prefix, pkg, "Versions") do io
println(io, "[", toml_key("0.7.0-DEV+r$(tree[1:8])"), "]")
println(io, "git-tree-sha1 = ", repr(tree))
println(io, "tree.git.sha1 = ", repr(tree))
end
# dependencies.toml
# Deps.toml
if isempty(deps)
rm(joinpath(prefix, pkg, "dependencies.toml"), force=true)
rm(joinpath(prefix, pkg, "Deps.toml"), force=true)
else
write_toml(prefix, pkg, "dependencies") do io
write_toml(prefix, pkg, "Deps") do io
println(io, "[", toml_key("0.7"), "]")
for dep in sort!(deps, by=lowercase)
println(io, "$dep = ", repr(stdlib_uuids[dep]))
end
end
end
# compatibility.toml
write_toml(prefix, pkg, "compatibility") do io
# Compat.toml
write_toml(prefix, pkg, "Compat") do io
println(io, "[", toml_key("0.7"), "]")
println(io, "julia = \"0.7\"")
end
Expand Down
4 changes: 2 additions & 2 deletions stdlib/Pkg3/bin/gitmeta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function gitmeta(pkgs::Dict{String,Package})
if ispath(fs)
s = TOML.parsefile(fs)
get(s, "STDLIBS", nothing) == STDLIBS || empty!(s)
mv(fs, "$fs.old", remove_destination=true)
mv(fs, "$fs.old", force=true)
end
s["STDLIBS"] = STDLIBS
io = open(fs, "w")
Expand All @@ -65,7 +65,7 @@ function gitmeta(pkgs::Dict{String,Package})
haskey(d, uuid) || (d[uuid] = Dict())
haskey(s, uuid) || (s[uuid] = Dict())
updated = false
repo_path = joinpath(homedir(), ".julia", "upstream", uuid)
repo_path = joinpath(homedir(), ".julia", "clones", uuid)
repo = nothing
for (ver, v) in p.versions
haskey(d[uuid], v.sha1) &&
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Pkg3/src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function gc(ctx::Context=Context(); period = Dates.Week(6), kwargs...)

# If the manifest was not used
gc_time = Dates.now() - period
usage_file = joinpath(logdir(), "usage.toml")
usage_file = joinpath(logdir(), "manifest_usage.toml")

# Collect only the manifest that is least recently used
manifest_date = Dict{String, Dates.DateTime}()
Expand Down
28 changes: 14 additions & 14 deletions stdlib/Pkg3/src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function find_installed(name::String, uuid::UUID, sha1::SHA1)
end

function load_versions(path::String)
toml = parse_toml(path, "versions.toml")
toml = parse_toml(path, "Versions.toml")
return Dict{VersionNumber, SHA1}(VersionNumber(ver) => SHA1(info["git-tree-sha1"]) for (ver, info) in toml)
end

Expand Down Expand Up @@ -172,8 +172,8 @@ function deps_graph(ctx::Context, uuid_to_name::Dict{UUID,String}, reqs::Require
for path in registered_paths(ctx.env, uuid)
version_info = load_versions(path)
versions = sort!(collect(keys(version_info)))
deps_data = load_package_data_raw(UUID, joinpath(path, "dependencies.toml"))
compatibility_data = load_package_data_raw(VersionSpec, joinpath(path, "compatibility.toml"))
deps_data = load_package_data_raw(UUID, joinpath(path, "Deps.toml"))
compat_data = load_package_data_raw(VersionSpec, joinpath(path, "Compat.toml"))

union!(all_versions_u, versions)

Expand All @@ -185,7 +185,7 @@ function deps_graph(ctx::Context, uuid_to_name::Dict{UUID,String}, reqs::Require
other_uuid in uuids || push!(uuids, other_uuid)
end
end
for (vr, cd) in compatibility_data
for (vr, cd) in compat_data
all_compat_u_vr = get_or_make!(all_compat_u, vr)
for (name,vs) in cd
# check conflicts??
Expand Down Expand Up @@ -260,15 +260,15 @@ end
function version_data(ctx::Context, pkgs::Vector{PackageSpec})
names = Dict{UUID,String}()
hashes = Dict{UUID,SHA1}()
upstreams = Dict{UUID,Vector{String}}()
clones = Dict{UUID,Vector{String}}()
for pkg in pkgs
pkg.uuid in ctx.stdlib_uuids && continue
pkg.path == nothing || continue
uuid = pkg.uuid
ver = pkg.version::VersionNumber
upstreams[uuid] = String[]
clones[uuid] = String[]
for path in registered_paths(ctx.env, uuid)
info = parse_toml(path, "package.toml")
info = parse_toml(path, "Package.toml")
if haskey(names, uuid)
names[uuid] == info["name"] ||
cmderror("$uuid: name mismatch between registries: ",
Expand All @@ -277,7 +277,7 @@ function version_data(ctx::Context, pkgs::Vector{PackageSpec})
names[uuid] = info["name"]
end
repo = info["repo"]
repo in upstreams[uuid] || push!(upstreams[uuid], repo)
repo in clones[uuid] || push!(clones[uuid], repo)
vers = load_versions(path)
if haskey(vers, ver)
h = vers[ver]
Expand All @@ -291,8 +291,8 @@ function version_data(ctx::Context, pkgs::Vector{PackageSpec})
end
@assert haskey(hashes, uuid)
end
foreach(sort!, values(upstreams))
return names, hashes, upstreams
foreach(sort!, values(clones))
return names, hashes, clones
end

########################
Expand Down Expand Up @@ -350,9 +350,9 @@ function install_git(
version::Union{VersionNumber,Nothing},
version_path::String
)::Nothing
upstream_dir = joinpath(depots()[1], "upstream")
ispath(upstream_dir) || mkpath(upstream_dir)
repo_path = joinpath(upstream_dir, string(uuid))
clones_dir = joinpath(depots()[1], "clones")
ispath(clones_dir) || mkpath(clones_dir)
repo_path = joinpath(clones_dir, string(uuid))
repo = ispath(repo_path) ? LibGit2.GitRepo(repo_path) : begin
@info("Cloning [$uuid] $name from $(urls[1])")
LibGit2.clone(urls[1], repo_path, isbare=true)
Expand Down Expand Up @@ -527,7 +527,7 @@ function update_manifest(env::EnvCache, pkg::PackageSpec, hash::Union{SHA1, Noth
end
else
for path in registered_paths(env, uuid)
data = load_package_data(UUID, joinpath(path, "dependencies.toml"), version)
data = load_package_data(UUID, joinpath(path, "Deps.toml"), version)
data == nothing && continue
info["deps"] = Dict(string(k) => string(v) for (k,v) in data)
break
Expand Down
8 changes: 4 additions & 4 deletions stdlib/Pkg3/src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ end

function write_env_usage(manifest_file::AbstractString)
!ispath(logdir()) && mkpath(logdir())
usage_file = joinpath(logdir(), "usage.toml")
usage_file = joinpath(logdir(), "manifest_usage.toml")
touch(usage_file)
!isfile(manifest_file) && return
# Do not rewrite as do syntax (no longer precompilable)
Expand Down Expand Up @@ -657,7 +657,7 @@ function registries(depot::String)::Vector{String}
d = joinpath(depot, "registries")
ispath(d) || return String[]
regs = filter!(readdir(d)) do r
isfile(joinpath(d, r, "registry.toml"))
isfile(joinpath(d, r, "Registry.toml"))
end
String[joinpath(depot, "registries", r) for r in regs]
end
Expand Down Expand Up @@ -759,7 +759,7 @@ function find_registered!(

# search through all registries
for registry in registries()
open(joinpath(registry, "registry.toml")) do io
open(joinpath(registry, "Registry.toml")) do io
# skip forward until [packages] section
for line in eachline(io)
contains(line, r"^ \s* \[ \s* packages \s* \] \s* $"x) && break
Expand Down Expand Up @@ -854,7 +854,7 @@ function registered_info(env::EnvCache, uuid::UUID, key::String)
isempty(paths) && cmderror("`$uuid` is not registered")
values = []
for path in paths
info = parse_toml(path, "package.toml")
info = parse_toml(path, "Package.toml")
value = get(info, key, nothing)
push!(values, (path, value))
end
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Pkg3/test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ temp_pkg_dir() do project_path
end

@testset "check logging" begin
usage = Pkg3.TOML.parse(String(read(joinpath(Pkg3.logdir(), "usage.toml"))))
usage = Pkg3.TOML.parse(String(read(joinpath(Pkg3.logdir(), "manifest_usage.toml"))))
@test any(x -> startswith(x, joinpath(project_path, "Manifest.toml")), keys(usage))
end

Expand Down

2 comments on commit a61ed85

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong when running your job:

NanosoldierError: failed to run benchmarks against primary commit: failed process: Process(`sudo cset shield -e su nanosoldier -- -c ./benchscript.sh`, ProcessExited(1)) [1]

Logs and partial data can be found here
cc @ararslan

Please sign in to comment.