Package compiles only after "instantiate" but after a "resolve" that apparently doesn't change anything

Ok, this happens often when I add a new dependency to a package I am developing.
My issue is that the sequence I need to go is to make an istantiate, resolve, istantiate, but the message on resolve looks like this resolve didn’t do anything, but indeed it is essential for the second “instantiate” to work. Not super clear… :

[...]
ERROR: The following 1 direct dependency failed to precompile:

GenFSM 

Failed to precompile GenFSM [652e9e7b-025e-40fa-a37d-3dffc9b6d7c7] to "/home/lobianco/.julia/compiled/v1.11/GenFSM/jl_hTmEoD".
ERROR: LoadError: ArgumentError: Package GenFSM does not have Tables in its dependencies:
- You may have a partially installed environment. Try `Pkg.instantiate()`
  to ensure all packages in the environment are installed.
- Or, if you have GenFSM checked out for development and have
  added Tables as a dependency but haven't updated your primary
  environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with GenFSM
Stacktrace:
[...]

(code) pkg> instantiate # this errors..
Precompiling project...
  ✗ GenFSM
  0 dependencies successfully precompiled in 5 seconds. 465 already precompiled.
  1 dependency errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

(code) pkg> instantiate # this continue to error..
Precompiling project...
  ✗ GenFSM
  0 dependencies successfully precompiled in 4 seconds. 465 already precompiled.
  1 dependency errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

(code) pkg> resolve # the output leads to think it didn't do anything...
  No Changes to `~/CloudFiles/beta-lorraine-sync/Documents/papers/genfsm_res1/code/Project.toml`
  No Changes to `~/CloudFiles/beta-lorraine-sync/Documents/papers/genfsm_res1/code/Manifest.toml`

(code) pkg> instantiate # but now instantiate works!
Precompiling project...
  1 dependency successfully precompiled in 13 seconds. 465 already precompiled.
  1 dependency had output during precompilation:
┌ GenFSM
│      CondaPkg Found dependencies: /home/lobianco/.julia/packages/PythonCall/WMWY0/

[...]

│  ✔ The default environment has been installed.

Are you using Revise?

yes

I suspect that’s the cause here, but unfortunately that’s all I got.

1 Like

Out of curiosity, what resolve may do other than (non) changing Manifest and Project.toml ?

Could it be that Tables, the dependency you added to GenFSM, was already part of your environment as a (potentially indirect) dependency of something else?

I’m no real expert, but I think in this case Pkg.resolve would only have to check that the Tables version, as already present in the previously resolved environment, is compatible with the bounds set by GenFSM. If it is, I think it would simply update the project_hash in Manifest.toml and do nothing else.

Could that be a plausible explanation for the situation you observe?

1 Like

Yes, this is my situation

Yes, could be, but in that case the message “No Changes” would be misleadning…

It is misleading, but the wording will be more accurate in 1.12: Tweak wording to make "no changes" message more accurate by ericphanson · Pull Request #3806 · JuliaLang/Pkg.jl · GitHub

4 Likes