# How to update dependencies in an dev'd package

**URL:** https://discourse.julialang.org/t/how-to-update-dependencies-in-an-devd-package/61352
**Category:** New to Julia
**Tags:** package, development
**Created:** [May 18, 2021, 11:18am UTC](https://discourse.julialang.org/t/how-to-update-dependencies-in-an-devd-package/61352 "2021-05-18T11:18:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![triceert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/triceert/32/21896_2.png) [@triceert](https://discourse.julialang.org/u/triceert)
#### Post date: [May 18, 2021, 11:18am UTC](https://discourse.julialang.org/t/how-to-update-dependencies-in-an-devd-package/61352/1 "2021-05-18T11:18:59Z")

</div>

It’s not clear to me how dependencies are updated.

Let’s say I’m developing a package `MyPackage` that resides in` ~./Julia/dev/MyPackage` in which I have

```julia

module MyPackage
 using DistributionsAD
 #...code
end

```

Now I want to make changes to DistributionsAD which should be reflected in MyPackage.  
So I did:

```julia

**(@v1.6) pkg>** dev DistributionsAD

**Cloning** git-repo `https://github.com/TuringLang/DistributionsAD.jl.git`

**Resolving** package versions...

**Updating** `~/.julia/environments/v1.6/Project.toml`

[ced4e74d] + DistributionsAD v0.6.26 `~/.julia/dev/DistributionsAD`

**Updating** `~/.julia/environments/v1.6/Manifest.toml`

[ced4e74d] ~ DistributionsAD v0.6.26 ⇒ v0.6.26 `~/.julia/dev/DistributionsAD`

```

Then I do some changes in `~/.julia/dev/DistributionsAD`, e.g. I added the line `using ForwardDiff` at the top. After this I run:

```julia

**(@v1.6) pkg>** activate DistributionsAD

**Activating** environment at `~/.julia/dev/DistributionsAD/Project.toml`

**(DistributionsAD) pkg>** resolve

**Installed** Distributions ─ v0.25.1

**Updating** `~/.julia/dev/DistributionsAD/Project.toml`

[79e6a3ab] + Adapt v3.3.0

[082447d4] + ChainRules v0.7.65

...

```

but I still run into

```julia
**(DistributionsAD) pkg>** precompile

**Precompiling** project...

**Progress** [========================================>] 2/2

✗ DistributionsAD

1 dependency successfully precompiled in 9 seconds (34 already precompiled)

**ERROR:** The following 1 direct dependency failed to precompile:

DistributionsAD [ced4e74d-a319-5a8a-b0ac-84af2272839c]

**ERROR:** LoadError: ArgumentError: Package DistributionsAD does not have ForwardDiff in its dependencies:

- If you have DistributionsAD checked out for development and have

added ForwardDiff 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 DistributionsAD

Stacktrace:

[1] **require(** into::Module, mod::Symbol **)**

@ Base ./loading.jl:884

[2] **include**

@ ./Base.jl:386 [inlined]

[3] **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:1213

[4] top-level scope

@ none:1

[5] **eval**

@ ./boot.jl:360 [inlined]

[6] **eval(** x::Expr **)**

@ Base.MainInclude ./client.jl:446

[7] top-level scope

@ none:1

in expression starting at /Users/tseidler/.julia/dev/DistributionsAD/src/DistributionsAD.jl:1

```

My understanding was, that after `resolve` the dependencies/manifests should have been update.  
So what am I doing wrong? Also is it correct that by `dev`-ing `DistrbutionsAD`, the dev branch will be loaded in `MyPackage`?

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [May 18, 2021, 11:38am UTC](https://discourse.julialang.org/t/how-to-update-dependencies-in-an-devd-package/61352/2 "2021-05-18T11:38:24Z")

</div>

You have to dev the package within your package. I.e start julia with `julia --project` within `~./Julia/dev/MyPackage` then `]` & `dev DistributionsAD`.

---

<div class="post-metadata">

### Author: ![triceert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/triceert/32/21896_2.png) [@triceert](https://discourse.julialang.org/u/triceert)
#### Post date: [May 18, 2021, 11:52am UTC](https://discourse.julialang.org/t/how-to-update-dependencies-in-an-devd-package/61352/3 "2021-05-18T11:52:23Z")

</div>

This points to the same folder of the edited version of `DistributionsAD`

```julia

**(MyPackage) pkg>** dev DistributionsAD

Path `/Users/me/.julia/dev/DistributionsAD` exists and looks like the correct package. Using existing path.

**Resolving** package versions...

    Updating `~/.julia/dev/MyPackage/Project.toml`
  [ced4e74d] ~ DistributionsAD v0.6.26 `../DistributionsAD` ⇒ v0.6.26 `~/.julia/dev/DistributionsAD`
    Updating `~/.julia/dev/MyPackage/Manifest.toml`
  [ced4e74d] ~ DistributionsAD v0.6.26 `../DistributionsAD` ⇒ v0.6.26 `~/.julia/dev/DistributionsAD`
...

```

which I guess correctly updates the manifest of my package to point to the edited version of `DistributionsAD` but the problem that within `DistributionsAD` the Manifest is not updated after adding a dependency there still exists.

---

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [May 18, 2021, 11:56am UTC](https://discourse.julialang.org/t/how-to-update-dependencies-in-an-devd-package/61352/4 "2021-05-18T11:56:08Z")

</div>

Just `using ForwardDiff` is not enough, you have to add it: start julia within DistributionAD dev-folder, `]`, and 'add ForwardDiff`.

---

<div class="post-metadata">

### Author: ![triceert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/triceert/32/21896_2.png) [@triceert](https://discourse.julialang.org/u/triceert)
#### Post date: [May 18, 2021, 12:03pm UTC](https://discourse.julialang.org/t/how-to-update-dependencies-in-an-devd-package/61352/5 "2021-05-18T12:03:39Z")

</div>

Now I get it, I was assuming having it in` (@1.6)` will also make it available in there.  
Many thanks for the help.
