From a536e4c5aabf0b52e6a78b4d58400022b240bb22 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Mon, 17 Aug 2020 09:34:36 +0200 Subject: [PATCH 1/6] Better error message from Pkg.pin when package is not found in the manifest. (#1932) (cherry picked from commit a0074c21f76b1ebecbb8dbd6ad92898363f82100) --- src/Operations.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Operations.jl b/src/Operations.jl index d44e4e39a6..781de500e2 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -1245,6 +1245,10 @@ function update_package_pin!(ctx::Context, pkg::PackageSpec, entry::PackageEntry end end +function update_package_pin!(ctx::Context, pkg::PackageSpec, ::Nothing) + pkgerror("package $(err_rep(pkg)) not found in the manifest, run `Pkg.resolve()` and retry.") +end + function pin(ctx::Context, pkgs::Vector{PackageSpec}) foreach(pkg -> update_package_pin!(ctx, pkg, manifest_info(ctx, pkg.uuid)), pkgs) pkgs = load_direct_deps(ctx, pkgs) From 6b792ff765a27a5613459e61374a12cb8e18a668 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Mon, 17 Aug 2020 06:10:54 -0500 Subject: [PATCH 2/6] Fix an invalidation from overloading `broadcasted` (#1960) I used this invalidation as a demonstration in a [new video](https://www.youtube.com/watch?v=7VbXbI6OmYo). But now that it's fixed, there's no good reason to leave this "open." (cherry picked from commit 06119a728b77b5e46d67b61dab3a7f6f4a6ac2a5) --- src/PlatformEngines.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlatformEngines.jl b/src/PlatformEngines.jl index a4bff0ecc7..bcc5952619 100644 --- a/src/PlatformEngines.jl +++ b/src/PlatformEngines.jl @@ -947,7 +947,7 @@ Given a `.tar.gz` filepath, return a dictionary of symlinks in the archive function list_tarball_symlinks(tarball_path::AbstractString) output = get_tarball_contents(tarball_path; verbose_tar = true) mm = [m.captures for m in eachmatch(parse_symlinks(), output)] - symlinks = [m[1] => joinpath(dirname(m[1]), m[2]) for m in mm] + symlinks = [String(m[1]) => joinpath(dirname(m[1]), m[2]) for m in mm if m[1] !== nothing && m[2] !== nothing] return symlinks end From 3094649139ba20b6b185962cfeb8dbb5daa5aa95 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 17 Aug 2020 13:07:17 +0200 Subject: [PATCH 3/6] try instantiate without updating the registry (#1959) (cherry picked from commit 78477206ef6fafeadf9fea0dedf87f8086264e6c) --- src/API.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/API.jl b/src/API.jl index afcfc82ae5..446e2efd06 100644 --- a/src/API.jl +++ b/src/API.jl @@ -828,9 +828,17 @@ function instantiate(ctx::Context; manifest::Union{Bool, Nothing}=nothing, # check if all source code and artifacts are downloaded to exit early Operations.is_instantiated(ctx) && return - Types.update_registries(ctx) pkgs = Operations.load_all_deps(ctx) - Operations.check_registered(ctx, pkgs) + try + # First try without updating the registry + Operations.check_registered(ctx, pkgs) + catch e + if !(e isa PkgError) || update_registries == false + rethrow(e) + end + Types.update_registries(ctx) + Operations.check_registered(ctx, pkgs) + end new_git = UUID[] # Handling packages tracking repos for pkg in pkgs From d0b2516047645d410720fe0c48c90a82e096108a Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Tue, 18 Aug 2020 18:09:31 +0200 Subject: [PATCH 4/6] Propagate Threads.nthreads() to Pkg.test subprocess. (#1953) (cherry picked from commit 4a4621b4c3d36021ec34aaa77d5e69c0b72c1a81) --- src/Operations.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Operations.jl b/src/Operations.jl index 781de500e2..ee9141e14b 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -1326,6 +1326,7 @@ function gen_test_code(testfile::String; --inline=$(Bool(Base.JLOptions().can_inline) ? "yes" : "no") --startup-file=$(Base.JLOptions().startupfile == 1 ? "yes" : "no") --track-allocation=$(("none", "user", "all")[Base.JLOptions().malloc_log + 1]) + --threads=$(Threads.nthreads()) $(julia_args) --eval $(code) ``` From 2a7eb444299deee3e36b90a423b94ded45953f49 Mon Sep 17 00:00:00 2001 From: Kristoffer Date: Wed, 19 Aug 2020 09:42:44 +0200 Subject: [PATCH 5/6] test on 1.5 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 707d867b7c..bb56ebd932 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: julia julia: # - 1.0 - - 1.4 + - 1.5 - nightly os: From 66718516644424844e092d2b03e1296597540f35 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 19 Aug 2020 11:20:36 +0200 Subject: [PATCH 6/6] add project to manifest in case a package depends on it, so that manifest is always complete (#1958) * add project to manifest in case a package depends on it, so that manifest is always complete (cherry picked from commit 60bb6857eed6cd7a8742b5e69d5065e92f9e745d) --- src/Operations.jl | 14 ++++++++++++-- test/new.jl | 31 ++++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/Operations.jl b/src/Operations.jl index ee9141e14b..f41fd8b4d3 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -116,11 +116,18 @@ end function update_manifest!(ctx::Context, pkgs::Vector{PackageSpec}, deps_map) manifest = ctx.env.manifest empty!(manifest) + if ctx.env.pkg !== nothing + pkgs = [pkgs; ctx.env.pkg] + end for pkg in pkgs entry = PackageEntry(;name = pkg.name, version = pkg.version, pinned = pkg.pinned, tree_hash = pkg.tree_hash, path = pkg.path, repo = pkg.repo) is_stdlib(pkg.uuid) && (entry.version = nothing) # do not set version for stdlibs - entry.deps = deps_map[pkg.uuid] + if Types.is_project(ctx, pkg) + entry.deps = ctx.env.project.deps + else + entry.deps = deps_map[pkg.uuid] + end ctx.env.manifest[pkg.uuid] = entry end prune_manifest(ctx) @@ -1695,6 +1702,9 @@ function print_status(ctx::Context, old_ctx::Union{Nothing,Context}, header::Sym xs = sort!(xs, by = (x -> (is_stdlib(x[1]), something(x[3], x[2]).name, x[1]))) all_packages_downloaded = true for (uuid, old, new) in xs + if Types.is_project_uuid(ctx, uuid) + continue + end pkg_downloaded = !is_instantiated(new) || is_package_downloaded(ctx, new) all_packages_downloaded &= pkg_downloaded print(ctx.io, pkg_downloaded ? " " : not_installed_indicator) @@ -1736,7 +1746,7 @@ end function status(ctx::Context, pkgs::Vector{PackageSpec}=PackageSpec[]; header=nothing, mode::PackageMode=PKGMODE_PROJECT, git_diff::Bool=false, env_diff=nothing) ctx.io == Base.devnull && return - # if a packge, print header + # if a package, print header if header === nothing && ctx.env.pkg !== nothing printstyled(ctx.io, "Project "; color=Base.info_color(), bold=true) println(ctx.io, ctx.env.pkg.name, " v", ctx.env.pkg.version) diff --git a/test/new.jl b/test/new.jl index 4d98799941..0803ccaaeb 100644 --- a/test/new.jl +++ b/test/new.jl @@ -2376,13 +2376,30 @@ end @testset "not collecting multiple package instances #1570" begin isolate(loaded_depot=true) do - Pkg.generate("A") - Pkg.generate("B") - Pkg.activate("B") - Pkg.develop(Pkg.PackageSpec(path="A")) - Pkg.activate(".") - Pkg.develop(Pkg.PackageSpec(path="A")) - Pkg.develop(Pkg.PackageSpec(path="B")) + cd_tempdir() do dir + Pkg.generate("A") + Pkg.generate("B") + Pkg.activate("B") + Pkg.develop(Pkg.PackageSpec(path="A")) + Pkg.activate(".") + Pkg.develop(Pkg.PackageSpec(path="A")) + Pkg.develop(Pkg.PackageSpec(path="B")) + end + end +end + +@testset "cyclic dependency graph" begin + isolate(loaded_depot=true) do + cd_tempdir() do dir + Pkg.generate("A") + Pkg.generate("B") + Pkg.activate("A") + Pkg.develop(path="B") + git_init_and_commit("A") + Pkg.activate("B") + # This shouldn't error even though A has a dependency on B + Pkg.add(path="A") + end end end