# Registry: support resolving dependencies also when Versions.toml file is empty by using master

**URL:** <https://discourse.julialang.org/t/registry-support-resolving-dependencies-also-when-versions-toml-file-is-empty-by-using-master/33446>\
**Category:** General Usage\
**Created:** [January 16, 2020, 5:50pm UTC](https://discourse.julialang.org/t/registry-support-resolving-dependencies-also-when-versions-toml-file-is-empty-by-using-master/33446 "2020-01-16T17:50:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [January 16, 2020, 5:50pm UTC](https://discourse.julialang.org/t/registry-support-resolving-dependencies-also-when-versions-toml-file-is-empty-by-using-master/33446/1 "2020-01-16T17:50:46Z")

</div>

this is a follow up idea on [Can Versions.toml point to git branch instead of fixed git commit?](https://discourse.julialang.org/t/can-versions-toml-point-to-git-branch-instead-of-fixed-git-commit/33442)

concretely does the current registry already work with an empty Versions.toml file in the restricted situation of just adding one package which does not have any other dependency without a Versions.toml.

Lets say I have package a private A depending on private package B which has no further dependency.  
Both i registered in my private registry, both having only an empty Version.toml file. Having the registry linnked to my current julia…

… I cannot do

```julia-auto
] add A

```

because it searches for a version for B but cannot find any and fails

… however I can in fact do

```julia-auto
] add B

```

which will install it from master from the respective git respository link defined in the Registry entry.  
(after having B installed, I can also add A of course)

## hence my proposal:

**make it possible to resolve dependencies within a registry also when no version is defined in Versions.toml, defaulting to master branch of the defined git repository**

- this would just mimick functionality which is already there as elaborated above
- it is obvious and explicit for everyone that indeed no version is ready to be installed, but that this is development
- the fallback to master of the linked repository is already the default and perfectly fits the usecase for (initial) development with no stable versions yet

---

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [January 18, 2020, 1:20pm UTC](https://discourse.julialang.org/t/registry-support-resolving-dependencies-also-when-versions-toml-file-is-empty-by-using-master/33446/3 "2020-01-18T13:20:42Z")

</div>

@fredrikekre may I ask you for your opinion about this?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [January 21, 2020, 8:56am UTC](https://discourse.julialang.org/t/registry-support-resolving-dependencies-also-when-versions-toml-file-is-empty-by-using-master/33446/4 "2020-01-21T08:56:13Z")

</div>

> [@schlichtanders](#):
>
> … however I can in fact do
> 
> ```julia
> ] add B
> 
> ```

I don’t think you can, since there are no versions of `B` either, e.g.:

```sh
$ pkg registry add https://github.com/fredrikekre/Staging
   Cloning registry from "https://github.com/fredrikekre/Staging"
     Added registry `Staging` to `~/.julia/registries/Staging`

$ pkg add JuAFEM
 Resolving package versions...
ResolverError: Unsatisfiable requirements detected for package JuAFEM [30d91d44]:
 JuAFEM [30d91d44] log:
 ├─JuAFEM [30d91d44] has no known versions!
 └─restricted to versions * by an explicit requirement — no versions left

```

However, you should be able to do

```none
$ pkg add A#master B#master

```

---

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [January 21, 2020, 11:27am UTC](https://discourse.julialang.org/t/registry-support-resolving-dependencies-also-when-versions-toml-file-is-empty-by-using-master/33446/5 "2020-01-21T11:27:41Z")

</div>

thanks a lot. I was really sure this was because of a dependency, but then I probably haven’t looked detailed enough. (the dependency problem was the major problem I had before locally, because of [Automatically detect unregistered dependencies by 00vareladavid · Pull Request #1088 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/1088). This topic here occured when wanting to jump between machines. Apparently this got me confused). I hope I find time soon to check this again on my system.

EDIT: I found the difference. I directly installed the package using `] dev` instead of `] add`. I tried it with your Staging area, and could successfully run `] dev JuAFEM` after adding the registry.

* * *

Still I think it is very valuable to have this fallback feature in the Registry. Reasons:

- it simplifies the initial phase when developing new packages a lot

- it does not bind versions to branches (as disliked in [another discourse discussion](https://discourse.julialang.org/t/can-versions-toml-point-to-git-branch-instead-of-fixed-git-commit/33442)), but only has a fallback branch when no version is given

- with it the registry is the one central place where you can register all your packages in development

- when using a registry today for this purpose, you _artificially_ have to bind a git commit tree-hash to a thought-up version number, while there is in fact no stable version yet to use at this stage of development. This would no longer be needed, as the Versions.toml could stay empty

---

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [January 25, 2020, 9:25pm UTC](https://discourse.julialang.org/t/registry-support-resolving-dependencies-also-when-versions-toml-file-is-empty-by-using-master/33446/6 "2020-01-25T21:25:23Z")

</div>

Anyone else having doubts?

I think this is a very appropriate addition towards Julia Registries  
In case no further complains arise, I will push it as feature-request on Julia github

EDIT: I just opened a feature request [https://github.com/JuliaLang/julia/issues/34515](https://github.com/JuliaLang/julia/issues/34515)
