Skip to content

Commit

Permalink
fixup Pkg3 broadcasting over iterables
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauman committed Mar 21, 2018
1 parent 7674aca commit e17a2a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stdlib/Pkg3/src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ function with_dependencies_loadable_at_toplevel(f, mainctx::Context, pkg::Packag
need_to_resolve = false

if Types.is_project(localctx.env, pkg)
delete!.(localctx.env.project, ["name", "uuid", "version"])
foreach(k->delete!(localctx.env.project, k), ("name", "uuid", "version"))
localctx.env.project["deps"][pkg.name] = string(pkg.uuid)
localctx.env.manifest[pkg.name] = [Dict(
"deps" => mainctx.env.project["deps"],
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Pkg3/src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ mutable struct EnvCache
git = ispath(joinpath(project_dir, ".git")) ? LibGit2.GitRepo(project_dir) : nothing

project = read_project(project_file)
if any(haskey.(project, ["name", "uuid", "version"]))
if any(k->haskey(project, k), ("name", "uuid", "version"))
project_package = PackageSpec(
get(project, "name", ""),
UUID(get(project, "uuid", 0)),
Expand Down
3 changes: 3 additions & 0 deletions stdlib/Pkg3/src/resolve/FieldValues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,7 @@ function secondmax(f::Field, msk::BitVector = trues(length(f)))
return m2 - m
end

# Support broadcasting like a scalar by default
Base.Broadcast.broadcastable(a::FieldValue) = Ref(a)

end

2 comments on commit e17a2a2

@mbauman
Copy link
Member Author

Choose a reason for hiding this comment

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

@KristofferC this is the commit that needs to be upstreamed to Pkg3.jl.

@KristofferC
Copy link
Member

Choose a reason for hiding this comment

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

👍 Just fyi, there is no problem if you did everything in one commit, the cherrypick command using the subtree strategy will pick out only those changes that are relevant for Pkg3.

Please sign in to comment.