Pkg REPL mode bug in 1.6.0-rc2

There seems to be a bug in parsing the strings in Pkg. It only happens in a weird subset of cases: specifically, only on 1.6.0, only when using ssh rather than http to clone, and only when trying to add a specific package revision.
Some examples of passing and failing cases. The following code fails:

julia> using Pkg                                                                                                                                                                                        
julia> pkg"add git@bitbucket.org:fakeuser/fake.git#master"                               
ERROR: ArgumentError: invalid base 10 digit 'b' in "bitbucket"                                       
Stacktrace:                                                                                          
  [1] tryparse_internal(#unused#::Type{Int64}, s::SubString{String}, startpos::Int64, endpos::Int64, base_::Int64, raise::Bool)

while the exactly equivalent command not using Pkg REPL mode succeeds. Also, variants of this command that specify packages via http urls succeed, or those that don’t request specific revisions from a bitbucket address succeed.

julia> using Pkg
# not using Pkg strings succeeds
julia> Pkg.add(url="git@bitbucket.org:fakeuser/fake.git", rev="master") 
     Cloning git-repo `git@bitbucket.org:fakeuser/fake.git`
# not requesting a specific revison succeeds
julia> pkg"add git@bitbucket.org:fakeuser/fake.git"
     Cloning git-repo `git@bitbucket.org:fakeuser/fake.git`
# requesting a specific revision from a github account succeeds.
julia> pkg"add https://github.com/haberdashPI/Alert.jl#master"
    Updating git-repo `https://github.com/haberdashPI/Alert.jl`

Of course, fakeuser/fake.git isn’t a real publicly available bitbucket address – using a real address isn’t necessary to see the parsing bug but would be to install a real package. (SSH access into a github address also causes the same error, where it thinks the first g in github is not a valid base 10 digit.)

I thought I would report here and see if the behavior is seen by others before submitting a bug report.

2 Likes

May it be related to Julia v1.5.4 and v1.6.0-rc2 have been released - #12 by stillyslalom ?

Hi lungben,

I don’t think so. Every call to “Pkg.add” continues to work as expected, and as far as I can tell other calls to Pkg functions work perfectly, so I don’t see any bugs like that. This is clearly only a parsing error that comes shows up in the “pkg>” repl mode and equivalently when parsing strings that are prefixed like pkg"add … ".