Can't `]dev` my own package

I’m trying to share an unregistered package that’s hosted as a private github repository.
After ]adding the package from the github URL on a machine where it was not previously developed, I try to ]dev it, I get the following error

(v1.1) pkg> dev Elegans
ERROR: The following package names could not be resolved:
 * Elegans (27ab0b70-9e64-11e9-288f-a5d350afe8a8 in manifest but not in project)
Please specify by known `name=uuid`.

I can’t make sense of this error. Any ideas?

I assume, that it searches the registry if you don’t specify path or URL. Did you try ]dev with the github URL?

I tried it now and it worked.
I still don’t understand why that would be necessary. I’d expect ]dev to a package that has already been added to be an entirely local operation. Why is the registry relevant?

how did you ‘added’ ‘locally’ ? ] dev will clone the thing in to a .../dev/ folder and you can do things with them. If you just make your local package dev in-place that will break the consistency of a working package?

I added from the github URL. I realise ]dev clones into the dev folder, I just thought if I have have the package added this is the version that would get used.

I’m not sure if I understood the question right, but I did not expect dev to be “in-place” in the sense of allowing editing of the installed copy. Just to create a separate development copy of the previously added package.

So after learning this is not the case, my updated mental model of how this works is this: when I ]dev Package the package is looked up in the main registry and fetched from there regardless of whether it is already in the manifest, so the fact that I have ]added it has no effect, and in fact I can ]dev a package without ]adding it first. Is that correct?
Maybe the docs should somehow be clearer that dev is a variant of add as opposed to something you do after adding. I’m reluctant to try to write it myself at this point, since I’m not sure I really understand how it works yet.

By only using add your Manifest will always have a “reproducible state”, in other words, as long as the repositories and registries used are still accessible it is possible to retrieve the exact state of all the dependencies in the project. This has the advantage that you can send your project ( Project.toml and Manifest.toml ) to someone else and they can “instantiate” that project in the same state as you had it locally. However, when you are developing a package, it is more convenient to load packages at their current state at some path. For this reason, the dev command exists.

https://julialang.github.io/Pkg.jl/v1/managing-packages/#Developing-packages-1

I have read this section before asking here. It doesn’t actually say anything about how the package name is resolved. In fact, the wording “By only using add…” in the beginning seems to reinforce the notion that dev is used to modify packages that have already been added.

Yes, you can dev a package without adding it previously. The two operations are quite different: add gives you a copy of the package files from the latest release (no git history) whereas dev clones the repository which includes all the git history and possibly additional commits after the latest release. (It’s assumed that you take responsibility for all subsequent git pulls, etc.)

2 Likes

I don’t know what to say, maybe you should PR a language edit.