Cannot Pkg.resolve the new REQUIRE of a package in development

I am developing a forked package, namely ExpmV. Recently I created a new branch and add Compat in the REQUIRE. When I try to load the package in new branch, I got the error

julia> using ExpmV
ERROR: LoadError: ArgumentError: Package ExpmV does not have Compat in its dependencies:
 - If you have ExpmV checked out for development and have
   added Compat 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 ExpmV.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:821
 [2] include at ./boot.jl:317 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1034
 [4] macro expansion at ./logging.jl:312 [inlined]
 [5] _require(::Base.PkgId) at ./loading.jl:929
 [6] require(::Base.PkgId) at ./loading.jl:838
 [7] require(::Module, ::Symbol) at ./loading.jl:833
in expression starting at /Users/po/.julia/packages/ExpmV/zrJj/src/ExpmV.jl:3

Following the error message, I run Pkg.resolve()

(v0.7) pkg> resolve
 Resolving package versions...
  Updating `~/.julia/environments/v0.7/Project.toml`
 [no changes]
  Updating `~/.julia/environments/v0.7/Manifest.toml`
 [no changes]

However, I still couldn’t load the package. I restart julia and run using ExpmV again, I keep getting the same error before

ERROR: LoadError: ArgumentError: Package ExpmV does not have Compat in its dependencies:
......

Any help I would be appreciate!

Can you link the branch where this is happening?

https://github.com/pochoi/ExpmV.jl/tree/compat

julia> versioninfo()
Julia Version 0.7.0-beta2.0
Commit b145832402* (2018-07-13 19:54 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)
Environment:
  JULIA_EDITOR = atom

Thanks a lot!

If you have a Project file, that is the one that counts so you would need Compat in Project.toml.

Thanks a lot. I didn’t realize the error is from Project.toml.

Btw, is Manifest.toml a must? Not sure how to generate it, and I see some packages doesn’t have it.

The manifest is automatically generated during the usage of the package manager. It contains the exact versions/git-tree-shas/paths that julia uses to find what packages to load.

For most libraries it does not need to be checked into version control. See also Does Manifest.toml belong in the repository?

kristoffer, I have the same issue

julia> using Filt
[ Info: Precompiling Filt [ed5e094f-ca7f-43de-b0a0-a977aa9a3271]
┌ Warning: Package Filt does not have MAT in its dependencies:
│ - If you have Filt checked out for development and have
│   added MAT 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 Filt
└ Loading MAT into Filt from project dependency, future warnings for Filt are suppressed.

My Project.toml file is

name = "Filt"
uuid = "ed5e094f-ca7f-43de-b0a0-a977aa9a3271"
authors = ["Kenneth Martin <martin@granitesemi.com>"]
version = "0.1.0"

[compat]
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]

From the Pkg.jl documentation it appears I need something like

[deps]
Example = "7876af07-990d-54b4-ab0e-23690620f79a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

for MAT, but the documentation seems to indicate this should be done automatically or by using ]resolve which didn’t work. Do I need to find the name-uuid pair for MAT and manually add it using an editor?

You need to add MAT to the Project.toml for Filt.

No, you can just activate the Filt project and then use Pkg to add it with Pkg.add("MAT") which will update the Project.