Incorrect manifest after adding package as dependency that has forked package as dependency

What I am doing is creating a custom package. In that package I add forked package as dependency and resulting manifest is correct (so my package has both manifest.toml and project.toml). However, once I add my package to my project using develop, that automatically generated manifest.toml is not correct. It has non-forked version of dependency in the manifest.toml. I can make the correct manifest by manually editing it using the package manifest as template. However, this is tedious and makes updating dependencies time consuming.

How should I approach this? Should I create an issue on Julia’s Github if this is a bug? Should I change UUID of the forked package, could that resolve the issue (or maybe it will break other things if I change it)?

Can you provide the steps to reproduce this issue?

Yes.

  1. Create mwe folder
  2. In mwe folder open Julia and run pkg> generate mwe.jl
  3. Close Julia and reopen it in mwe/mwe.jl folder (or just cd there)
  4. Run pkg> activate . to setup package environment.
  5. Run pkg> add https://github.com/KSepetanc/PowerModels.jl/tree/v0.21.2 to add forked dependency.
  6. Exit Julia and reopen it in mwe folder.
  7. Run pkg> activate . to setup project environment.
  8. Run pkg> dev ./mwe.jl
  9. Inspect mwe/manifest.toml and compare it with mwe/mwe.jl/manifest.toml. The mwe/manifest.toml will contain information about latest official PowerModels which is currently v0.21.4, and not forked as supplied in package mwe/mwe.jl/manifest.toml.

I was using Julia 1.10.9, but I think there is the same issue with 1.11 as well.

Much nastier manifest errors occur when dealing with HSL_jll.jl as the one obtained from HSL organization has different dependencies compared to the dummy HSL_jll.jl version obtained from JuliaBinaryWrappers.

If I understand your issue correctly, you need to use the sources feature that comes with Julia 1.11 - see Julia 1.11 Highlights and 10. Project.toml and Manifest.toml · Pkg.jl

1 Like

That solved it for me. Thank you!

However, please note that documentation states that it should not work (but it does):

“Note that this information is only used when this environment is active, i.e. it is not used if this project is a package that is being used as a dependency.”

1 Like

I’d forgotten about that caveat! It’s weird that it works when explicitly documented to not do so, though convenient in this case.

I agree. Hopefully, someone from the devs takes a look at this as I think even the Manifest approach should work too. Could be some bugs with this.