Pkg.add(PKG,VER) Version Ignored - Workarounds?

Recent versions of HDF5 and OffsetArrays seem to be incompatible with Julia 0.6.0 because of the change from Range to AbstractRange, but Pkg.add(PKG) just installs the latest. I believe I’ve found the latest compatible versions by looking through their repo histories (0.8.5 and 0.4.0, respectively), but Pkg.add(PKG,VER) silently ignores the provided version.

Is there a workaround for this?

I can’t Pkg.pin() before add()ing. I can install the latest and then pin() to an older version, but then how do I get Julia to see the pin and downgrade?

Discovered a workaround by fiddling with it on my own. Doing Pkg.update() followed by Pkg.clone() to get the package, and then using Pkg.pin() seems to do the trick.

I just ran all the HDF5.jl and OffsetArrays.jl tests on Julia v0.6.0, and they all pass with the latest tagged versions of both packages (v0.8.6 and v0.4.2). What results are you getting that make you think they’re not compatible?

They both install fine (Pkg.add() succeeds), but upon using either I get e.g.

INFO: Precompiling module OffsetArrays.
ERROR: LoadError: UndefVarError: AbstractRange not defined
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:569
 [2] include(::String) at ./sysimg.jl:14
 [3] anonymous at ./<missing>:2
while loading /root/.julia/v0.6/OffsetArrays/src/OffsetArrays.jl, in expression starting on line 145

Both fail because their latest code uses the AbstractRange type instead of Range, which appears to be a change that’s in the repo slated for Julia 0.7. HDF5 0.8.5 and OffsetArrays 0.4.0 (as well as FFTViews 0.0.2, I’ve recently found) are what work for me—all versions prior to their changing from Range to AbstractRange.

Ah, I see. I think the issue is actually that your version of Compat.jl is out of date (possibly pinned to an old version). On v0.6.0, I get:

julia> Pkg.installed("OffsetArrays")
v"0.4.2"

julia> using OffsetArrays

The reason this works is that Compat provides an alias in 0.6:

julia> using Compat

julia> Compat.AbstractRange
Range

which is how OffsetArrays gets its AbstractRange type.

I suspect that your version of Compat is pinned to before that alias was added.