Stream: helpdesk (published)

Topic: Pkg.develop() on unregistered or local packages


view this post on Zulip Peter Goodall (Dec 02 2021 at 05:08):

Should I be able to cycle through Pkg.([add, develop, free, rm]) with either unregistered
or local packages?
(That was notation not Julia)
Pkg.free() seems to fall-over.

view this post on Zulip Ronny Bergmann (Dec 02 2021 at 16:27):

What do you mean by cycle through? Usually when you run Julia in the folder of the Repo of the local (unregistered) package you can do ] add . to add it? Similarly develop or rm (I have not tried free)

view this post on Zulip Sukera (Dec 02 2021 at 16:40):

you mean should you be able to add, develop, free or rm unregistered packages? Yes, though free will probably only do something after pin

view this post on Zulip j-fu (Dec 02 2021 at 18:48):

This is the way it goes with 1.6.4:
https://gist.github.com/j-fu/9deaa9d117e617c00a8e37bb20ad30af

That means that one needs to replace free by rm +add. It doesn't seem to be a bug. And no, pin doesn't change this (tried).

view this post on Zulip Sukera (Dec 02 2021 at 19:01):

ah, I see what you mean now

view this post on Zulip Sukera (Dec 02 2021 at 19:01):

In my 1.8-DEV branch, I get

(@v1.8) pkg> free BigNums
ERROR: unable to free unregistered package `BigNums [0882b250]`

view this post on Zulip Sukera (Dec 02 2021 at 19:02):

I think the reason is that add of a local path doesn't have any idea which versions of a package exist - after all, that is managed by the registry

view this post on Zulip Sukera (Dec 02 2021 at 19:03):

so if you'd do free of an unregistered package you've deved, it has no idea what to fall back to - there is no dependency resolution to run, precisely because it's not registered

view this post on Zulip Sukera (Dec 02 2021 at 19:04):

though one way to possibly alleviate that is by using something like LocalRegistry.jl

view this post on Zulip j-fu (Dec 02 2021 at 19:17):

Sure, LocalRegistry.jl can help to manage this. I didn't try it out in this particular situation, but it is not complicated to use and it can help to take advantage of the Pkg resolver etc. with packages developed in an organization or at early development stages. AFAIK one e.g. can register 0.0.x versions locally, and starting with 0.1.0 register in General, and Pkg will handle this smoothly.


Last updated: Nov 06 2024 at 04:40 UTC