Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages outside sysimage without versions in Project file are not compatible with Pkg #2146

Closed
vtjnash opened this issue Oct 20, 2020 · 2 comments · Fixed by #2251
Closed

Comments

@vtjnash
Copy link
Member

vtjnash commented Oct 20, 2020

This reproducibly fails for me, when Pkg is not baked into the system image:

julia> Pkg.update()
    Updating registry at `~/.julia/registries/General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
    Updating git-repo `https://github.com/chriselrod/VectorizationBase.jl.git`
No Changes to `~/.julia/environments/v1.1/Project.toml`
No Changes to `~/.julia/environments/v1.1/Manifest.toml`
ERROR: MethodError: Cannot `convert` an object of type 
  Nothing to an object of type 
  Union{Pkg.Types.UpgradeLevel, VersionNumber, Pkg.Types.VersionSpec}
Closest candidates are:
  convert(::Type{T}, ::T) where T at essentials.jl:205
Stacktrace:
  [1] Pkg.Types.PackageSpec(name::String, uuid::Base.UUID, version::Nothing, tree_hash::Nothing, repo::Pkg.Types.GitRepo, path::Nothing, pinned::Bool, mode::Pkg.Types.PackageMode)
    @ Pkg.Types /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:91
  [2] Pkg.Types.PackageSpec(; name::String, uuid::Base.UUID, version::Nothing, tree_hash::Nothing, repo::Pkg.Types.GitRepo, path::Nothing, pinned::Bool, mode::Pkg.Types.PackageMode)
    @ Pkg.Types ./util.jl:444
  [3] precompile(ctx::Pkg.Types.Context; internal_call::Bool, io::Base.TTY)
    @ Pkg.API /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:959
  [4] _auto_precompile(ctx::Pkg.Types.Context; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:912
  [5] _auto_precompile
    @ /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:911 [inlined]
  [6] #up#38
    @ /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:72 [inlined]
  [7] up
    @ /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:70 [inlined]
  [8] up(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:87
  [9] up()
    @ Pkg.API /data/vtjnash/julia/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:79
 [10] top-level scope
    @ none:1

Failing on:

pkgid = ArgTools [0dad84c5-d112-42e6-8d28-ef12dabb789f]
pkgent = PackageEntry(
  name = ArgTools
)
@IanButterworth
Copy link
Member

IanButterworth commented Oct 21, 2020

This is breaking because of an assumption that the only packages that will be missing the version field in the manifest will be in the sysimage (i.e. stdlibs), which we skip entirely during precomp.

Could we expand the union type of PackageSpec.version to include nothing, like the other fields?

Otherwise a better fix may be to disable the precomp suspension mechanism for packages like this that aren't in the sysimage. That's probably a good idea given the lack of version would mean we couldn't tell when the package has changed.

@KristofferC
Copy link
Member

KristofferC commented Oct 21, 2020

Until we have a well-defined description of what an stdlib actually is, it is hard to write working code for it. Right now, they have been defined in Pkg "by inspection", i.e. how they have actually been used in Base. If they uses in Base changes, those assumptions are likely invalid.

@KristofferC KristofferC changed the title Pkg.update failing Packages outside sysimage without versions in Project file are not compatible with Pkg Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants