Pkg.resolve() fails

It is not clear to me how resolve is supposed to work.

Scenario:

  • I have a package A
  • it depends on package B
    There is a new version of package B
    In package A I increase the compat entry of package B to the new version.
    I type Pkg.resolve(). It fails because the old version is still in the manifest.

Now I have to type

add PackageB@<newversion>

And all works fine.

Is this an intended behaviour? Wouldn’t it be more logical if:

  • either resolve just updates the manifest and succeeds
  • or at least prints a warning: Version x in in the manifest, version y in compat, please use Pkg.add to update to the new version

What do you think?

Using Julia 1.12.6

I am not 100% sure I understand the scenario you have or what “It fails” means.

I can only comment that every now and then I have a similar scenario (I think), but then I have both A and B from your description in development mode. In those the outdated manifest (I think) causes that resolve does indeed not work, since there are also no “versions to switch to” when both are in development mode.
Pkg.update() helps in my scenario at least since it updates versions and resolves.

If this is not your scenario, maybe you could provide a bit more details?

I try to avoid that if I only want to update one package, takes too much time.

And I don’t think my packages were in dev mode. One of them has a sources entry, though, because it is not registered.

Ok, I also keep my environments small, so for me updating them all is fine – but I can see the problem when this triggers too much recompilation.
The reason I mentioned development mode is, that I do not totally understand your scenario, and having two packages in development mode was the only scenario I ever encountered that. Maybe with source that is similar, sure.

You can also specify to only update certain packages, see 3. Managing Packages · Pkg.jl

So in the case here something like

] up A B

would only update those two.