Skip to content

Commit

Permalink
Merge pull request #3604 from JuliaLang/backports-release-1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Aug 28, 2023
2 parents 6125786 + 8d5c1de commit a3621e9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,8 @@ function precompile(ctx::Context, pkgs::Vector{PackageSpec}; internal_call::Bool
else
join(split(strip(err), "\n"), color_string("\n", Base.warn_color()))
end
print(iostr, color_string("\n", Base.warn_color()), pkgid, color_string("\n", Base.warn_color()), err, color_string("\n", Base.warn_color()))
name = haskey(exts, pkgid) ? string(exts[pkgid], "", pkgid.name) : pkgid.name
print(iostr, color_string("\n", Base.warn_color()), name, color_string("\n", Base.warn_color()), err, color_string("\n", Base.warn_color()))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,7 @@ function print_status(env::EnvCache, old_env::Union{Nothing,EnvCache}, registrie
printpkgstyle(io, :Info, "Packages marked with $heldback_indicator have new versions available but compatibility constraints restrict them from upgrading.$tip", color=Base.info_color(), ignore_indent)
end
if !no_visible_packages_heldback && !no_packages_upgradable
printpkgstyle(io, :Info, "Packages marked with $upgradable_indicator and $heldback_indicator have new versions available, but those with $heldback_indicator are restricted by compatibility constraints from upgrading.$tip", color=Base.info_color(), ignore_indent)
printpkgstyle(io, :Info, "Packages marked with $upgradable_indicator and $heldback_indicator have new versions available. Those with $upgradable_indicator may be upgradable, but those with $heldback_indicator are restricted by compatibility constraints from upgrading.$tip", color=Base.info_color(), ignore_indent)
end
if !manifest && hidden_upgrades_info && no_visible_packages_heldback && !no_packages_heldback
# only warn if showing project and outdated indirect deps are hidden
Expand Down
4 changes: 3 additions & 1 deletion src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ function handle_repo_develop!(ctx::Context, pkg::PackageSpec, shared::Bool)
entry = manifest_info(ctx.env.manifest, uuid)
if entry !== nothing
pkg.repo.source = entry.repo.source
pkg.repo.subdir = entry.repo.subdir
end
end
end
Expand Down Expand Up @@ -738,8 +739,9 @@ function handle_repo_add!(ctx::Context, pkg::PackageSpec)
manifest_resolve!(ctx.env.manifest, [pkg]; force=true)
if isresolved(pkg)
entry = manifest_info(ctx.env.manifest, pkg.uuid)
if entry !== nothing && entry.repo.source !== nothing # reuse source in manifest
if entry !== nothing
pkg.repo.source = entry.repo.source
pkg.repo.subdir = entry.repo.subdir
end
end
if pkg.repo.source === nothing
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module PkgTestsOuter
original_depot_path = copy(Base.DEPOT_PATH)
original_load_path = copy(Base.LOAD_PATH)
original_env = copy(ENV)
original_project = Base.active_project()

module PkgTestsInner

Expand All @@ -14,6 +15,7 @@ import Pkg
if Base.find_package("HistoricalStdlibVersions") === nothing
@debug "Installing HistoricalStdlibVersions for Pkg tests"
iob = IOBuffer()
Pkg.activate(; temp = true)
try
Pkg.add("HistoricalStdlibVersions", io=iob) # Needed for custom julia version resolve tests
catch
Expand Down Expand Up @@ -109,4 +111,6 @@ for (k, v) in pairs(original_env)
ENV[k] = v
end

Base.set_active_project(original_project)

end # module
8 changes: 8 additions & 0 deletions test/subdir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ end
@test isinstalled("Package")
@test !isinstalled("Dep")
@test isinstalled(dep)

# Test that adding a second time doesn't error (#3391)
pkg"add Package#master"
@test isinstalled("Package")
pkg"rm Package"

pkg"add Dep#master"
Expand All @@ -204,6 +208,10 @@ end
@test isinstalled("Package")
@test !isinstalled("Dep")
@test isinstalled(dep)

# Test developing twice (#3391)
pkg"develop Package"
@test isinstalled("Package")
pkg"rm Package"

pkg"develop Dep"
Expand Down

0 comments on commit a3621e9

Please sign in to comment.