Problem with reassignment of uuid when a package is registered

I’m afraid that this might bite a lot of people, because that had not been necessary in the past. Any dependencies that a package loaded in, including indirectly, were visible to using and import.
That’s a fairly major change.

1 Like

Indeed and very much an intentional one.

Importing packages that were downloaded only because your dependencies required them is pretty much always a bug in the package. You cannot set compatibility with these packages and their usage might just be an implementation detail that could be taken away at any point. This happens many time when people forget to put Compat in their REQUIRE file but it happens to be pulled in by some other dependency. When things are upgraded, that dependency stops using Compat, Compat is no longer pulled in and things break.

Easiest progress forward is just to fix the REQUIRE file of e.g. ChrBase and retag.

2 Likes

I’d already done that, it just needs somebody to merge all the new tags to METADATA.

Thanks for the quick responses.

In other words, the fact that code loading now enforces correct declaration of dependencies is a feature, not a bug. If you have missing dependencies that you haven’t declared, you won’t be able to load it going forward.

In v0.6 it wasn’t a bug. In v0.7 it is a bug, if you declare the packages incorrectly. This is simply because it works differently now, in a more safe way–although I’m not aware that it was possible to break anything with the way it was done in v0.6, because it worked fine then. But in terms of the evolution of the package management, it seems like a natural direction to go into.

That’s fine for packages with a Project.toml file (and I had made sure that those had all of the dependencies that were used or imported, before being told to eliminate the Project.toml file for now).

The problem I see is that using the old REQUIRE, but requiring that it state all of the indirect dependencies that are used or imported (at least it’s not all indirect dependencies, IIUC), is a breaking change, in that all packages that for whatever reason don’t have them all listed will have to update their REQUIRE files, when from the docs and messages from Pkg3 (stating that a Project.toml file will be required, which is why I wasted the time creating Project.toml file for all of the packages), that in v0.7/v1.0, you’d only have to worry about the Project.toml file.

Is that something that can be addressed (or else switch to actually requiring a Project.toml file (and ignoring the old REQUIRE file)), in the short term?

I’m a lot closer to getting everything working, however there’s one thing still failing, I get a very strange error about trying to load julia as a package:

julia> Pkg.test("Strs")
   Testing Strs
ERROR: Trying to add julia as a package
Stacktrace:
 [1] #add_or_develop#52(::Array{Base.UUID,1}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/Types.jl:359
 [2] add_or_develop at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:951 [inlined]
 [3] (::getfield(Pkg.Operations, Symbol("##35#37")){Bool,getfield(Pkg.Operations, Symbol("##59#61")),Pkg.Types.Context,Pkg.Types.PackageSpec,Pkg.Types.Context,Bool})(::String) at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:772
 [4] mktempdir(::getfield(Pkg.Operations, Symbol("##35#37")){Bool,getfield(Pkg.Operations, Symbol("##59#61")),Pkg.Types.Context,Pkg.Types.PackageSpec,Pkg.Types.Context,Bool}, ::String) at ./file.jl:564
 [5] mktempdir at ./file.jl:562 [inlined]
 [6] #with_dependencies_loadable_at_toplevel#33(::Bool, ::Function, ::Function, ::Pkg.Types.Context, ::Pkg.Types.PackageSpec) at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:741
 [7] #with_dependencies_loadable_at_toplevel at ./logging.jl:0 [inlined]
 [8] #test#57(::Bool, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:1108
 [9] #test at ./none:0 [inlined]
 [10] #test#35(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:216
 [11] test at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:205 [inlined]
 [12] #test#34 at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:202 [inlined]
 [13] test at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:202 [inlined]
 [14] #test#33 at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:201 [inlined]
 [15] test at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:201 [inlined]
 [16] #test#32 at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:200 [inlined]
 [17] test(::String) at /j/julia/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:200
 [18] top-level scope at none:0

Any ideas?

Do you have julia itself as a dep in the Project.toml?

I never had julia listed except in the REQUIRE files, I removed all of the old Project.toml files, and everything is now registered.