I have a project with a few local packages. Some packages use dev path/to/Package
to use another package, but this only works for one level. That is, if activate PkgB and do dev path/to/PkgA
, then if we activate PkgC and do dev path/to/PkgB
, we’ll get a warning about “Unsatisfiable requirements detected for package PkgA”. The commands to recreate this are below.
My understanding is that dev
’d packages aren’t part of the Manifest.toml, so when PkgC is trying to dev
PkgB, it can’t figure out what/where PkgA is.
For my case, it does not make sense to make these packages separate git repos and use them as unregistered packages. The code must be local and all in one repo, as this is part of a larger project, or which Julia is only a tiny (but growing!) part.
Is there a way to make local packages “first class”? That is, we just need to tell the manifest about the local path, or something like this.
Here are those commands:
julia> import Pkg
julia> Pkg.generate("PkgA")
Generating project PkgA:
PkgA\Project.toml
PkgA/src/PkgA.jl
Dict{String,Base.UUID} with 1 entry:
"PkgA" => UUID("742a3e6f-54ea-4f98-9a06-d7829e97a94c")
julia> Pkg.generate("PkgB")
Generating project PkgB:
PkgB\Project.toml
PkgB/src/PkgB.jl
Dict{String,Base.UUID} with 1 entry:
"PkgB" => UUID("45f31414-b817-4f24-9a66-b38385072404")
julia> Pkg.generate("PkgC")
Generating project PkgC:
PkgC\Project.toml
PkgC/src/PkgC.jl
Dict{String,Base.UUID} with 1 entry:
"PkgC" => UUID("ec7805be-d493-4525-8c88-e1eff6e8520a")
(v1.3) pkg> activate PkgB
Activating environment at `C:\Users\Tucker\Desktop\PkgB\Project.toml`
(PkgB) pkg> dev PkgA
[ Info: resolving package identifier `PkgA` as a directory at `C:\Users\Tucker\Desktop\PkgA`.
Resolving package versions...
Updating `C:\Users\Tucker\Desktop\PkgB\Project.toml`
[742a3e6f] + PkgA v0.1.0 [`..\PkgA`]
Updating `C:\Users\Tucker\Desktop\PkgB\Manifest.toml`
[742a3e6f] + PkgA v0.1.0 [`..\PkgA`]
(PkgB) pkg> st
Project PkgB v0.1.0
Status `C:\Users\Tucker\Desktop\PkgB\Project.toml`
[742a3e6f] PkgA v0.1.0 [`..\PkgA`]
(PkgB) pkg> activate PkgC
Activating environment at `C:\Users\Tucker\Desktop\PkgC\Project.toml`
(PkgC) pkg> dev PkgB
[ Info: resolving package identifier `PkgB` as a directory at `C:\Users\Tucker\Desktop\PkgB`.
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package PkgA [742a3e6f]:
PkgA [742a3e6f] log:
├─PkgA [742a3e6f] has no known versions!
└─restricted to versions * by PkgB [45f31414] — no versions left
└─PkgB [45f31414] log:
├─possible versions are: 0.1.0 or uninstalled
└─PkgB [45f31414] is fixed to version 0.1.0