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

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 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.

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.

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.

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.

1 Like

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.

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

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…

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