Old version (1.0.5) can't find BenchmarkTools in General registry

I’m trying to compare something on v1.12.5 with 1.0.5, but I immediately hit a snag on adding BenchmarkTools to the version environment. AFAIK BenchmarkTools does have versions in the General registry that is compatible with Julia 1.0, so is this an old registry tweak I have to do manually?

(v1.0) pkg> add BenchmarkTools
ERROR: The following package names could not be resolved:
 * BenchmarkTools (not found in project, manifest or registry)
Please specify by known `name=uuid`.

(v1.0) pkg> add BenchmarkTools@1.5
ERROR: The following package names could not be resolved:
 * BenchmarkTools (not found in project, manifest or registry)
Please specify by known `name=uuid`.

(v1.0) pkg> add BenchmarkTools=6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package BenchmarkTools [6e4b80f9]:
 BenchmarkTools [6e4b80f9] log:
 ├─BenchmarkTools [6e4b80f9] has no known versions!
 └─restricted to versions * by an explicit requirement — no versions left

Julia 1.0 cannot understand the current registry format. You need to do:

mv ~/.julia/registries/General.tar.gz ~/.julia/registries/General.tar.gz.bak
mv ~/.julia/registries/General.toml ~/.julia/registries/General.toml.bak
git clone https://github.com/JuliaRegistries/General.git ~/.julia/registries/General

Then, this should work:

julia +1.0

And in Julia:

using Pkg
Pkg.add("BenchmarkTools")

Just to check some things before I pull the trigger, that looks like I’m backing up the compressed registry I already have, then cloning the registry’s repo. Is that right? Is the rationale that the compressed registry does not contain the necessary information but the repo does? Do I reverse this with registry rm General and registry add General?

Both contain the same information, but in a different format.

You can revert this with the commands:

pkg> registry rm General
pkg> registry add General

Actually it’s better not to rename those files. Then sufficiently new Julia will use the compressed registry and old Julia will use it from git.

1 Like