# Why is this Project.toml compat not enforced?

**URL:** <https://discourse.julialang.org/t/why-is-this-project-toml-compat-not-enforced/72419>\
**Category:** Package Management\
**Tags:** question, package, compatibility\
**Created:** [December 1, 2021, 11:38pm UTC](https://discourse.julialang.org/t/why-is-this-project-toml-compat-not-enforced/72419 "2021-12-01T23:38:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![diederikb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diederikb/32/22281_2.png) [@diederikb](https://discourse.julialang.org/u/diederikb)\
**Post date:** [December 1, 2021, 11:38pm UTC](https://discourse.julialang.org/t/why-is-this-project-toml-compat-not-enforced/72419/1 "2021-12-01T23:38:56Z")

</div>

Hi everyone,

I have trouble understanding the following behavior that I tested on Julia 1.6.4 and 1.7.0. If I create an empty project and `] add PotentialFlow`, this package cannot be imported because of the following error:

```julia
julia> import PotentialFlow
[Info: Precompiling PotentialFlow [73af2aaf-3f58-5b29-82a9-435ecf827f5b]
ERROR: LoadError: UndefVarError: vector_mode_dual_eval not defined
Stacktrace:
  [1] getproperty(x::Module, f::Symbol)
    @ Base ./Base.jl:35
  [2] top-level scope
    @ ~/.julia/packages/PotentialFlow/TKJBD/src/autodiff/apiutils.jl:47
  [3] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [4] include(x::String)
    @ PotentialFlow.Utils ~/.julia/packages/PotentialFlow/TKJBD/src/Utils.jl:1
  [5] top-level scope
    @ ~/.julia/packages/PotentialFlow/TKJBD/src/autodiff/forwarddiff.jl:19
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [7] include(x::String)
    @ PotentialFlow.Utils ~/.julia/packages/PotentialFlow/TKJBD/src/Utils.jl:1
  [8] top-level scope
    @ ~/.julia/packages/PotentialFlow/TKJBD/src/Utils.jl:132
  [9] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
 [10] include(x::String)
    @ PotentialFlow ~/.julia/packages/PotentialFlow/TKJBD/src/PotentialFlow.jl:3
 [11] top-level scope
    @ ~/.julia/packages/PotentialFlow/TKJBD/src/PotentialFlow.jl:8
 [12] include
    @ ./Base.jl:418 [inlined]
 [13] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1318
 [14] top-level scope
    @ none:1
 [15] eval
    @ ./boot.jl:373 [inlined]
 [16] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [17] top-level scope
    @ none:1
in expression starting at /Users/b/.julia/packages/PotentialFlow/TKJBD/src/autodiff/apiutils.jl:47
in expression starting at /Users/b/.julia/packages/PotentialFlow/TKJBD/src/autodiff/forwarddiff.jl:19
in expression starting at /Users/b/.julia/packages/PotentialFlow/TKJBD/src/Utils.jl:1
in expression starting at /Users/b/.julia/packages/PotentialFlow/TKJBD/src/PotentialFlow.jl:3
ERROR: Failed to precompile PotentialFlow [73af2aaf-3f58-5b29-82a9-435ecf827f5b] to /Users/b/.julia/compiled/v1.7/PotentialFlow/jl_Kcuiy4.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:997

```

The error appears because `vector_mode_dual_eval` of the package ForwardDiff.jl changed in version 0.10.20 to `vector_mode_dual_eval!`. However, PotentialFlow.jl has the following `[compat]` entry for ForwardDiff.jl in its Project.toml:

```julia
ForwardDiff = "0.10.12"

```

but it seems that according to the manifest for the project, the latest version (0.10.23) is used for FowardDiff.jl. Furthermore, it seems like none of the other `[compat]` entries are enforced either. Why is this the case and how should I prevent this behavior?

Any information is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [December 2, 2021, 12:07am UTC](https://discourse.julialang.org/t/why-is-this-project-toml-compat-not-enforced/72419/2 "2021-12-02T00:07:09Z")

</div>

```julia
ForwardDiff = "0.10.12"

```

means any `0.10.*` version greater or equal to `0.10.12`, see [here](https://pkgdocs.julialang.org/v1/compatibility/).

You can manually do `add ForwardDiff@0.10.12` if that’s what you want.

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [December 2, 2021, 1:36am UTC](https://discourse.julialang.org/t/why-is-this-project-toml-compat-not-enforced/72419/3 "2021-12-02T01:36:42Z")

</div>

Also, if you want a `[compat]` entry that only allows ForwardDiff 0.10.12, this is what you would put in the `[compat]` section of your `Project.toml` file:

```nohighlight
[compat]
ForwardDiff = "=0.10.12"

```
