Skip to content

Commit 1ef855e

Browse files
committed
Update julia-modules
1 parent 7417049 commit 1ef855e

17 files changed

+1349
-45
lines changed

languages/julia/julia-modules/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ runCommand "julia-${julia.version}-env" {
172172
inherit juliaWrapped;
173173

174174
version = julia.version;
175+
meta = julia.meta;
175176

176177
# Expose the steps we used along the way in case the user wants to use them, for example to build
177178
# expressions and build them separately to avoid IFD.

languages/julia/julia-modules/package-closure.nix

+19-15
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,27 @@ let
7878
pkgs, deps_map = _resolve(ctx.io, ctx.env, ctx.registries, pkgs, PRESERVE_NONE, ctx.julia_version)
7979
8080
if VERSION >= VersionNumber("1.9")
81-
# Check for weak dependencies, which appear on the RHS of the deps_map but not in pkgs.
82-
# Build up weak_name_to_uuid
83-
uuid_to_name = Dict()
84-
for pkg in pkgs
85-
uuid_to_name[pkg.uuid] = pkg.name
86-
end
87-
weak_name_to_uuid = Dict()
88-
for (uuid, deps) in pairs(deps_map)
89-
for (dep_name, dep_uuid) in pairs(deps)
90-
if !haskey(uuid_to_name, dep_uuid)
91-
weak_name_to_uuid[dep_name] = dep_uuid
81+
while true
82+
# Check for weak dependencies, which appear on the RHS of the deps_map but not in pkgs.
83+
# Build up weak_name_to_uuid
84+
uuid_to_name = Dict()
85+
for pkg in pkgs
86+
uuid_to_name[pkg.uuid] = pkg.name
87+
end
88+
weak_name_to_uuid = Dict()
89+
for (uuid, deps) in pairs(deps_map)
90+
for (dep_name, dep_uuid) in pairs(deps)
91+
if !haskey(uuid_to_name, dep_uuid)
92+
weak_name_to_uuid[dep_name] = dep_uuid
93+
end
9294
end
9395
end
94-
end
9596
96-
# If we have nontrivial weak dependencies, add each one to the initial pkgs and then re-run _resolve
97-
if !isempty(weak_name_to_uuid)
97+
if isempty(weak_name_to_uuid)
98+
break
99+
end
100+
101+
# We have nontrivial weak dependencies, so add each one to the initial pkgs and then re-run _resolve
98102
println("Found weak dependencies: $(keys(weak_name_to_uuid))")
99103
100104
orig_uuids = Set([pkg.uuid for pkg in orig_pkgs])
@@ -113,7 +117,7 @@ let
113117
orig_pkgs[length(orig_pkgs)] = update_package_add(ctx, pkg, entry, false)
114118
end
115119
116-
pkgs, deps_map = _resolve(ctx.io, ctx.env, ctx.registries, orig_pkgs, PRESERVE_NONE, ctx.julia_version)
120+
global pkgs, deps_map = _resolve(ctx.io, ctx.env, ctx.registries, orig_pkgs, PRESERVE_NONE, ctx.julia_version)
117121
end
118122
end
119123
'';

0 commit comments

Comments
 (0)