# Julia 1.4 fails to add local package

**URL:** <https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326>\
**Category:** General Usage\
**Tags:** package-manager\
**Created:** [May 12, 2020, 6:52am UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326 "2020-05-12T06:52:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![alkoedl](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@alkoedl](https://discourse.julialang.org/u/alkoedl)\
**Post date:** [May 12, 2020, 6:52am UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326/1 "2020-05-12T06:52:57Z")

</div>

With Julia 1.3.1 I can add a Julia package which is hosted on my local git server with IP 10.20.30.40 by doing

```julia
pkg> add "user@10.20.30.40:PackageName.jl"

```

In Julia 1.4.0 and 1.4.1 the above throws the error

```julia
ERROR: Path `user@10.20.30.40:PackageName.jl` does not exist.

```

Did the syntax for `add` change between 1.3.1 and 1.4.0? I couldn’t find anything to that respect in the docs.

Thanks.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 12, 2020, 7:29am UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326/2 "2020-05-12T07:29:51Z")

</div>

Looks like a bug to me, please open an issue. Note that you can always use the non-ambigous syntax outside of the Pkg REPL mode

```julia
using Pkg
Pkg.add(PackageSpec(url = "user@10.20.30.40:PackageName.jl"))

```

---

<div class="post-metadata">

**Author:** ![alkoedl](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@alkoedl](https://discourse.julialang.org/u/alkoedl)\
**Post date:** [May 12, 2020, 7:40am UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326/3 "2020-05-12T07:40:34Z")

</div>

Yes, but unfortunately

```julia
using Pkg
Pkg.add(PackageSpec(url = "user@10.20.30.40:PackageName.jl"))

```

fails as well with

```julia
julia> Pkg.add(PackageSpec(url = "user@10.20.30.40:PackageName.jl"))
ERROR: Path `user@10.20.30.40:PackagesName.jl` does not exist.
Stacktrace:
 [1] pkgerror(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:53
 [2] handle_repo_add!(::Pkg.Types.Context, ::Pkg.Types.PackageSpec) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:558
 [3] handle_repos_add!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:620
 [4] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:139
 [5] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:112
 [6] #add#27 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:109 [inlined]
 [7] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:109 [inlined]
 [8] #add#23 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:106 [inlined]
 [9] add(::Pkg.Types.PackageSpec) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:106
 [10] top-level scope at REPL[5]:1

julia> 

```

Will open an issue.

Thanks

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 12, 2020, 10:02am UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326/4 "2020-05-12T10:02:07Z")

</div>

Okay thanks, the problem is that we don’t interpret that as a url:

```julia
julia> Pkg.Types.isurl("user@10.20.30.40:PackageName.jl")
false

```

I guess something else changed to 1.4 which made this problem apparent.

---

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [May 12, 2020, 2:22pm UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326/5 "2020-05-12T14:22:37Z")

</div>

Try:

```julia
Pkg.add(PackageSpec(url = "ssh://user@10.20.30.40:PackageName.jl"))

```

That seems to work for me.

---

<div class="post-metadata">

**Author:** ![alkoedl](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@alkoedl](https://discourse.julialang.org/u/alkoedl)\
**Post date:** [May 12, 2020, 4:21pm UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326/6 "2020-05-12T16:21:08Z")

</div>

@pixel27 Thanks for the hint. I assume there is a typo. Your proposal works for me, if I replace the colon between IP and package name by a slash:

```julia
Pkg.add(PackageSpec(url = "ssh://user@10.20.30.40/PackageName.jl"))

```

this also works directly in Pkg like this

```julia
(@v1.4) pkg> add "ssh://user@10.20.30.40/PackageName.jl"

```

After some trying in Julia 1.3 and 1.4, I get the following results:

```julia
(v1.3) pkg> add "user@10.20.30.40:PackageName.jl" -> ok
(v1.3) pkg> add "ssh://user@10.20.30.40/PackageName.jl" -> ok
(v1.3) pkg> add "user@10.20.30.40/PackageName.jl" -> Error: unsupported URL protocol
(v1.3) pkg> add "ssh://user@10.20.30.40:PackageName.jl" -> Error: git repository not found

(v1.4) pkg> add "user@10.20.30.40:PackageName.jl" -> Error: Unable to parse "..." as a package
(v1.4) pkg> add "ssh://user@10.20.30.40/PackageName.jl" -> ok
(v1.4) pkg> add "user@10.20.30.40/PackageName.jl" -> Error: Unable to parse "..." as a package
(v1.4) pkg> add "ssh://user@10.20.30.40:PackageName.jl" -> Error: git repository not found

```

The equivalent PackageSpec commands behave in the same way (slightly different error messages though).

Hence, difference between 1.3 and 1.4 is that the first form in not working any longer. I am wondering whether this is a bug or is actually intended to remove ambiguity?

Is there any place where the desired behavior is documented? In the Pkg docs I could find only a subset of all options.

Thanks

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [May 12, 2020, 4:28pm UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326/7 "2020-05-12T16:28:31Z")

</div>

Not the documentation but if you read regular expressions fluently the relevant rows of the implementation (as it looks for the upcoming Julia 1.5) are [Pkg.jl/Types.jl at fff698d3d7d90a55431ad2f4fa0af9719d899954 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/blob/fff698d3d7d90a55431ad2f4fa0af9719d899954/src/Types.jl#L37) and [Pkg.jl/argument\_parsers.jl at fff698d3d7d90a55431ad2f4fa0af9719d899954 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/blob/fff698d3d7d90a55431ad2f4fa0af9719d899954/src/REPLMode/argument_parsers.jl#L27-L54).

---

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [May 12, 2020, 5:22pm UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326/8 "2020-05-12T17:22:48Z")

</div>

Sorry yeah, that last colon should be slash…I just copied it from @kristoffer.carlsson post earlier (yes I’m passing the buck).

And I have to agree that this looks like just a change to remove any ambiguity.

---

<div class="post-metadata">

**Author:** ![alkoedl](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@alkoedl](https://discourse.julialang.org/u/alkoedl)\
**Post date:** [May 14, 2020, 8:18pm UTC](https://discourse.julialang.org/t/julia-1-4-fails-to-add-local-package/39326/9 "2020-05-14T20:18:38Z")

</div>

Very interesting. So, in the end it seems reasonable to require specification of the protocol to eliminate ambiguity. No bug report necessary.

Thanks everyone.
