`Pkg.resolve()` fails when upgrading to v0.7

Not to bloat the Upgradathon thread any further, I am asking in a new thread. Irrelevant point: I can’t seem to add or find “upgradathon” or “v0.7” tags, it would be nice to have something like that at least temporarily.

I have been trying to upgrade KissThreading.jl which uses functions that were moved to Random and others to StatsBase. I cloned the package as an old habit since it is not registered, I suppose develop is the Pkg3 analogue. The package was installed in the .julia/dev folder.

I then tried adding the following lines:

if VERSION > v"0.7-"
    using Random: MersenneTwister, randjump
end

I also used similar lines for some StatsBase functions, and then ran the tests again only to get:

ERROR: LoadError: LoadError: ArgumentError: Package KissThreading does not have Random in its dependencies:
 - If you have KissThreading checked out for development and have
   added Random as a dependency but haven't updated your primary
   environment's manifest file, try `Pkg.resolve()`.
 - Otherwise you may need to report an issue with KissThreading.

Now I am on the master branch of KissThreading so I suppose that means I have it checked out for development, but I didn’t add Random as a dependency since it was not in the REQUIRE file, since there was no REQUIRE file to begin with. So great, I added Random and StatsBase to a REQUIRE file and tried again, got the same error. I then ran Pkg.resolve() as it recommends and got the following error:

ERROR: The following package names could not be resolved:
 * Random (9a3f8284-a2c9-5f02-9a11-845980a1fd5c in manifest but not in project)
Please specify by known `name=uuid`.

While I was trying random things, I removed the contents of the REQUIRE file again and tried Pkg.resolve() again getting a different error this time:

ERROR: Unsatisfiable requirements detected for package (unknown) [10745b16]:
 (unknown) [10745b16] log:
 ├─(unknown) [10745b16] has no known versions!
 └─found to have no compatible versions left with StatsBase [2913bbd2]
   └─StatsBase [2913bbd2] log:
     ├─possible versions are: [0.1.0, 0.2.0-0.2.1, 0.2.3-0.2.10, 0.3.0-0.3.13, 0.4.0-0.4.4, 0.5.0-0.5.3, 0.6.0-0.6.16, 0.7.0-0.7.4, 0.8.0-0.8.3, 0.9.0, 0.10.0, 0.11.0-0.11.1, 0.12.0, 0.13.0-0.13.1, 0.14.0-0.14.1, 0.15.0, 0.16.0-0.16.1, 0.17.0, 0.18.0, 0.19.0-0.19.5, 0.20.0-0.20.1, 0.22.0, 0.23.0-0.23.1, 0.24.0] or uninstalled
     └─restricted to versions 0.24.0 by an explicit requirement, leaving only versions 0.24.0

Any idea what’s happening and how to avoid these errors? And more importantly, where can one read more about the awesome-if-only-I-can-use-it Pkg3? Any help is appreciated. Thank you.

Stdlibs are not supported in REQUIRE files. Try remove it and run resolve again.

Yes, I encountered these errors this weekend also, as described in this thread

This problem occurs when you are working with the development version of an unregistered package, you need a Project.toml file in your directory and your ~/.julia/environments/v0.7/Manifest.toml file needs to be pointing towards the dev version of the package instead of the github repo.

Well it seems the issue is not with the package I am upgrading at all. I removed the package and Pkg.resolve() again and it is complaining about BenchmarkTools and some unknown package:

 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package (unknown) [10745b16]:
 (unknown) [10745b16] log:
 ├─(unknown) [10745b16] has no known versions!
 └─found to have no compatible versions left with BenchmarkTools [6e4b80f9]
   └─BenchmarkTools [6e4b80f9] log:
     ├─possible versions are: [0.0.1-0.0.8, 0.2.0-0.2.5, 0.3.0-0.3.2] or uninstalled
     └─restricted to versions 0.3.2 by an explicit requirement, leaving only versions 0.3.2
Stacktrace:
 [1] #propagate_constraints!#61(::Bool, ::Function, ::Pkg.GraphType.Graph, ::Set{Int64}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\GraphType.jl:1005
 [2] propagate_constraints! at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\GraphType.jl:946 [inlined]
 [3] #simplify_graph!#121(::Bool, ::Function, ::Pkg.GraphType.Graph, ::Set{Int64}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\GraphType.jl:1460
 [4] simplify_graph! at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\GraphType.jl:1460 [inlined]
 [5] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Operations.jl:302
 [6] up(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Operations.jl:1113
 [7] #up#27(::Pkg.Types.UpgradeLevel, ::Pkg.Types.PackageMode, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\API.jl:149
 [8] #up#22 at .\none:0 [inlined]
 [9] #up at .\none:0 [inlined]
 [10] resolve at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\API.jl:154 [inlined] (repeats 2 times)
 [11] top-level scope at none:0

Removing BenchmarkTools made it complain about StatsBase. Removing StatsBase made Pkg.resolve() work. Adding KissThreading and adding Random again to the REQUIRE file produced the same error again. It’s not clear to me what I should do now.

You should not add Random to REQUIRE because Random is in the standard library. I also got the confusing messages. Try removing Random from REQUIRE and running resolve again. I didn’t read the other posts in detail, but I had something similar. I think putting import Random in your main module file and then doing resolve might help. It doesn’t make sense; I doubt Pkg3 scans this file. But, you can try anyway. It won’t hurt.

Regarding unresolvable dependencies. This happened to me a few times. In my case, I had done pkg> dev APack in the past. Doing pkg> remove APack to remove it from the dev directory and then pkg> add APack worked for me. The dependencies were resolved. In other words, checking from where the packages in question are loaded might help.

I cloned the package as an old habit since it is not registered, I suppose develop is the Pkg3 analogue. The package was installed in the .julia/dev folder.

Do you mean that you cloned or copied the package into .julia/dev manually ? I think you need to use pkg> dev /path/to/KissThreading.jl instead. If you give a local path, it will not copy the repo, but will note add to your Project and Manifest files (or something like that). If it is a remote repo, even unregistered, then it will be copied to .julia/dev.

I used Pkg.clone initially, but now I am just using dev. I removed Random from the REQUIRE file. When I run the tests, I get:

ERROR: LoadError: LoadError: ArgumentError: Package KissThreading does not have Random in its dependencies:
 - If you have KissThreading checked out for development and have
   added Random as a dependency but haven't updated your primary
   environment's manifest file, try `Pkg.resolve()`.
 - Otherwise you may need to report an issue with KissThreading.

which seems to be complaining about the package Random. Running Pkg.resolve() gives:

 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package (unknown) [10745b16]:
 (unknown) [10745b16] log:
 ├─(unknown) [10745b16] has no known versions!
 └─found to have no compatible versions left with StatsBase [2913bbd2]
   └─StatsBase [2913bbd2] log:
     ├─possible versions are: [0.1.0, 0.2.0-0.2.1, 0.2.3-0.2.10, 0.3.0-0.3.13, 0.4.0-0.4.4, 0.5.0-0.5.3, 0.6.0-0.6.16, 0.7.0-0.7.4, 0.8.0-0.8.3, 0.9.0, 0.10.0, 0.11.0-0.11.1, 0.12.0, 0.13.0-0.13.1, 0.14.0-0.14.1, 0.15.0, 0.16.0-0.16.1, 0.17.0, 0.18.0, 0.19.0-0.19.5, 0.20.0-0.20.1, 0.22.0, 0.23.0-0.23.1, 0.24.0] or uninstalled
     └─restricted to versions 0.24.0 by an explicit requirement, leaving only versions 0.24.0

which shows that is is complaining about StatsBase.

StatsBase was added after KissThreading using add StatsBase. Removing KissThreading doesn’t remove the error. So I think the problem might be in StatsBase, I will open an issue there.

The package “(unknown)” is suspicious. I don’t recall seeing it myself, and the thread linked above does not contain the string “unknown”.

Removing the .julia/v0.7 folder, running init again which didn’t bring the folder back so I assume it is obsolete, then using dev StatsBase instead of add StatsBase resolved the errors above. Also running tests from within Julia using Pkg.test seem to work when running the runtests.jl file from outside doesn’t. This seems like an orthogonal issue but now I am getting somewhere. Thanks for the help.

Is this beta or nightly? Many bugs have been fixed on nightly so if possible, try that out.

BTW, can you please clarify how the Pkg.jl repo is merged to Julia master?

Does it happen on a regular schedule, or an ad hoc basis?

Right now, ad hoc.

Seems to be fine on nightly.

1 Like

Thanks, that’s good to hear.

1 Like