# Confusion about new Pkg: What happens to a package when I update the top level project?

**URL:** https://discourse.julialang.org/t/confusion-about-new-pkg-what-happens-to-a-package-when-i-update-the-top-level-project/11947
**Category:** General Usage
**Tags:** pkg
**Created:** [June 25, 2018, 7:28pm UTC](https://discourse.julialang.org/t/confusion-about-new-pkg-what-happens-to-a-package-when-i-update-the-top-level-project/11947 "2018-06-25T19:28:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [June 25, 2018, 7:28pm UTC](https://discourse.julialang.org/t/confusion-about-new-pkg-what-happens-to-a-package-when-i-update-the-top-level-project/11947/1 "2018-06-25T19:28:13Z")

</div>

Hello, I am confused about something and I’d like to read the solution to my confusion:

1. Every package is now a project.
2. Since every package is a project, every package has written down the dependent packages versions in its own Project.toml.
3. I have a project folder, for a research project. There I have installed `DynamicalBilliards`, which depends on `StaticArrays`. I find that there is a cool new version of `StaticArrays`, so in my top level project folder, I do `pkg up`. What happens?
  - Will this update the Project.toml of `DynamicalBilliards` to the new `StaticArrays`?

4. If yes, wouldn’t this totally mess up the git stuff, with new changes not done by me, the developer, showing up? This would then dissallow the next `pkg up` to actually update `DynamicalBilliards` because it will be “dirty” ?
5. If _not_, doesn’t this lead to the problem of me, the user this time, wanting to use the latest package versions but it not being possible?

If the answers to my questions are written somewhere, please point me there, and sorry if I did not search enough.  
I also want to confess that the current page of the [Pkg documentation](https://docs.julialang.org/en/latest/stdlib/Pkg/) is kind of verbose, making it hard for me to follow through. Maybe some kind of discourse post about FAQ of the new system would help many people? Or adding more “example cases” to the doc page? The example that is currently that is really the simplest possible “bare-bone” case of a package starting from scratch totally empty. But almost no developer is in this point now and most packages are operational and full of dependencies as well.

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [June 25, 2018, 8:05pm UTC](https://discourse.julialang.org/t/confusion-about-new-pkg-what-happens-to-a-package-when-i-update-the-top-level-project/11947/2 "2018-06-25T20:05:48Z")

</div>

> [@Datseris](#):
>
> I find that there is a cool new version of `StaticArrays` , so in my top level project folder, I do `pkg up` . What happens?
> 
> - Will this update the Project.toml of `DynamicalBilliards` to the new `StaticArrays` ?

The `Project.toml` file only includes the name and UUID of `StaticArrays`, no information about the version of `StaticArrays` that you’re using, so it would not change at all. The `Manifest.toml` file in `DynamicalBilliards` records the version number and git tree hash of the version of `StaticArrays` that you’re using. if you do `pkg> up StaticArrays` while the `DynamicalBilliards` project is the “active environment”, `DynamicalBilliards/Manifest.toml` will be modified to refer to the version and git tree hash of the new version.

> [@Datseris](#):
>
> If yes, wouldn’t this totally mess up the git stuff, with new changes not done by me, the developer, showing up? This would then dissallow the next `pkg up` to actually update `DynamicalBilliards` because it will be “dirty” ?

If you’re developing `DynamicalBilliards` then the package manager doesn’t update that git repo for you, that’s your responsibility. If you want to update it, you can commit whatever changes there are and do `git pull` or however you prefer to do it. You can choose to check `Manifest.toml` into the repo or ignore it depending on if you want to keep a record of exact sets of working versions in the repo or not.

> [@Datseris](#):
>
> I also want to confess that the current page of the [Pkg documentation](https://docs.julialang.org/en/latest/stdlib/Pkg/) is kind of verbose, making it hard for me to follow through.

I wrote it as clearly and simply as I could. If someone else can manage to explain in fewer words or more simply, that would be great, but I was not able to do so.

---

<div class="post-metadata">

### Author: ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)
#### Post date: [June 25, 2018, 8:17pm UTC](https://discourse.julialang.org/t/confusion-about-new-pkg-what-happens-to-a-package-when-i-update-the-top-level-project/11947/3 "2018-06-25T20:17:58Z")

</div>

It’ll be hard to satisfy everybody within the bounds of a single page. It may be worth splitting the documentation, with a usage-focused Pkg3 101 in the manual, and a developer-focused discussion in the dev docs.

---

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [June 25, 2018, 8:26pm UTC](https://discourse.julialang.org/t/confusion-about-new-pkg-what-happens-to-a-package-when-i-update-the-top-level-project/11947/4 "2018-06-25T20:26:31Z")

</div>

> [@StefanKarpinski](#):
>
> I wrote it as clearly and simply as I could. If someone else can manage to explain in fewer words or more simply, that would be great, but I was not able to do so.

I didn’t say it to blame anyone, I was just making _my own personal_ difficulty clear.

> [@stillyslalom](#):
>
> It’ll be hard to satisfy everybody within the bounds of a single page. It may be worth splitting the documentation, with a usage-focused Pkg3 101 in the manual, and a developer-focused discussion in the dev docs.

Again, no reason to be fixated on this one single thing. **No blames!** , but if people do not make their difficulties clear, it is assumed that there are no difficulties. I am simply taking care of expressing the existence of difficulties.

Thanks, the answer of Stefan covered most of the stuff. Just a final doubt:

- I am updating in the top-level project, not in the sub-level of the specific package `DynamicalBilliards`.
- The `StaticArrays` package _will_ be updated.
- Does the Manifest.toml of the top-level project also get updated? I would assume so, if I have understood everything.

Notice why I have the difficulty in my question: In my top-level project I did `add DynamicalBilliards`, but never explicitly `add StaticArrays`. I am wondering that if `StaticArrays` gets updated, is this change reflected in the Manifest? Again, I assume so, but I am not very certain…

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [June 25, 2018, 8:48pm UTC](https://discourse.julialang.org/t/confusion-about-new-pkg-what-happens-to-a-package-when-i-update-the-top-level-project/11947/5 "2018-06-25T20:48:00Z")

</div>

> [@Datseris](#):
>
> In my top-level project I did `add DynamicalBilliards` , but never explicitly `add StaticArrays` . I am wondering that if `StaticArrays` gets updated, is this change reflected in the Manifest?

Yes, the Manifest contains the version of all dependencies (including recursive dependencies).
