Skip to content

Commit

Permalink
Work around precompiling packages with no version entry (#2251)
Browse files Browse the repository at this point in the history
While experimenting with non-precompiled stdlibs, I found that a
`Project.toml` that has no `version` entry set will cause `precompile()`
to fail in a nasty way.

(cherry picked from commit f9307f8)
  • Loading branch information
staticfloat authored and KristofferC committed Dec 2, 2020
1 parent c97afbd commit 83cbe5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,10 @@ function precompile(ctx::Context; internal_call::Bool=false, kwargs...)
was_recompiled[pkgid] = false
if haskey(man, pkgid.uuid)
pkgent = man[pkgid.uuid]
push!(pkg_specs, PackageSpec(uuid = pkgid.uuid, name = pkgent.name, version = pkgent.version, tree_hash = pkgent.tree_hash))
# If we have an unusual situation such as an un-versioned package (like an stdlib that
# is being overridden) its `version` may be `nothing`.
pkgver = something(pkgent.version, VersionSpec())
push!(pkg_specs, PackageSpec(uuid = pkgid.uuid, name = pkgent.name, version = pkgver, tree_hash = pkgent.tree_hash))
end
end
precomp_prune_suspended!(pkg_specs)
Expand Down

0 comments on commit 83cbe5f

Please sign in to comment.