Pkg.jl: Add package with specific branch failing since julia 1.5.2

Created on 23 Nov 2020  路  5Comments  路  Source: JuliaLang/Pkg.jl

Since julia 1.5.2, adding a package with a specific branch fails:

(@v1.5) pkg> add https://[email protected]/orgname/reponame.git#dev

In julia 1.5.1, it works fine.
(It is a private repo, if that matters).
Without specifying the branch, it works fine on any version (1.5.1, 1.5.2, 1.5.3)

The versions stated are julia versions and the Pkg used is the bundled one.

The error in julia 1.5.2 and 1.5.3 is:

ERROR: ArgumentError: invalid version range: "bitbucket.org/orgname/reponame.git"
Stacktrace:
[1] Pkg.Types.VersionRange(::String) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/versions.jl:136
[2] Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Rev, Pkg.REPLMode.Subdir}(::String) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/argument_parsers.jl:66
[3] iterate at ./generator.jl:47 [inlined]
[4] collect_to!(::Array{String,1}, ::Base.Generator{Array{String,1},Type{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Rev, Pkg.REPLMode.Subdir}}}, ::Int64, ::Int64) at ./array.jl:732
[5] collect_to_with_first!(::Array{String,1}, ::String, ::Base.Generator{Array{String,1},Type{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Rev, Pkg.REPLMode.Subdir}}}, ::Int64) at ./array.jl:710
[6] _collect(::Array{String,1}, ::Base.Generator{Array{String,1},Type{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Rev, Pkg.REPLMode.Subdir}}}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:704
[7] collect_similar at ./array.jl:628 [inlined]
[8] map at ./abstractarray.jl:2162 [inlined]
[9] parse_package(::Array{Pkg.REPLMode.QString,1}, ::Dict{Symbol,Any}; add_or_dev::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/argument_parsers.jl:10
[10] (::Pkg.REPLMode.var"#64#69")(::Array{Pkg.REPLMode.QString,1}, ::Dict{Symbol,Any}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/command_declarations.jl:89
[11] Pkg.REPLMode.Command(::Pkg.REPLMode.Statement) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/REPLMode.jl:366
[12] iterate at ./generator.jl:47 [inlined]
[13] _collect(::Array{Pkg.REPLMode.Statement,1}, ::Base.Generator{Array{Pkg.REPLMode.Statement,1},Type{Pkg.REPLMode.Command}}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:699
[14] collect_similar at ./array.jl:628 [inlined]
[15] map at ./abstractarray.jl:2162 [inlined]
[16] do_cmd(::REPL.LineEditREPL, ::String; do_rethrow::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/REPLMode.jl:379
[17] do_cmd at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/REPLMode.jl:377 [inlined]
[18] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/REPLMode/REPLMode.jl:546
[19] #invokelatest#1 at ./essentials.jl:710 [inlined]
[20] invokelatest at ./essentials.jl:709 [inlined]
[21] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2355
[22] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:1144
[23] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at ./task.jl:356

REPL

Most helpful comment

Note that you can use

Pkg.add(url = "https://[email protected]/orgname/reponame.git", rev = "dev")

All 5 comments

Note that you can use

Pkg.add(url = "https://[email protected]/orgname/reponame.git", rev = "dev")

Quoting should work in the Pkg REPL too:

(@v1.5) pkg> add "https://[email protected]/orgname/reponame.git#dev"

Introduced by #1936, should probably allow special characters # and @ after .git too.

Quoting should work in the Pkg REPL too:

(@v1.5) pkg> add "https://[email protected]/orgname/reponame.git#dev"

this did not work for me, albeit with a different error (ERROR: failed to clone from https://[email protected]/orgname/reponame.git#dev, error: GitError(Code:ERROR, Class:Net, unexpected HTTP status code: 404))

The Pkg.add(url = "", rev="") did work

Maybe

add "https://[email protected]/orgname/reponame.git"#dev
Was this page helpful?
0 / 5 - 0 ratings

Related issues

GregPlowman picture GregPlowman  路  3Comments

cossio picture cossio  路  3Comments

StefanKarpinski picture StefanKarpinski  路  3Comments

dpsanders picture dpsanders  路  3Comments

KristofferC picture KristofferC  路  4Comments