# Project environment

**URL:** <https://discourse.julialang.org/t/project-environment/20133>\
**Category:** General Usage\
**Tags:** package\
**Created:** [January 26, 2019, 10:24pm UTC](https://discourse.julialang.org/t/project-environment/20133 "2019-01-26T22:24:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 26, 2019, 10:24pm UTC](https://discourse.julialang.org/t/project-environment/20133/1 "2019-01-26T22:24:22Z")

</div>

I have defined a project environment. One of the packages is listed in the Manifest file as

```julia
[[H2Libjl]]
deps = ["Arpack", "DelimitedFiles", "Distributed", "FinEtools", "JSON", "Libdl", "LinearAlgebra", "Random", "SparseArrays", "Statistics", "Test"]
git-tree-sha1 = "1678c91a081de4d0d92ad0a420c40e0147d6cccf"
repo-rev = "master"
repo-url = "https://gitlab.com/PetrKrysl/H2Libjl.jl.git"
uuid = "68c9da36-1c06-11e9-0d8d-e1acd994ec4d"
version = "0.1.0"

```

It seems to me that a particular git “state” is indicated (the `git-tree-sha1`). If that is correct, and this requests one particular state of the repo on the master, how do I always get the latest version from that git repo instead?

---

<div class="post-metadata">

**Author:** ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)\
**Post date:** [January 26, 2019, 10:57pm UTC](https://discourse.julialang.org/t/project-environment/20133/2 "2019-01-26T22:57:48Z")

</div>

As far as I understand, the Manifest.toml file does not specify the project requirements, but rather states the exact versions of packages in the project _as you have it instantiated_. Package requirements are instead listed in the Project.toml.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 26, 2019, 11:05pm UTC](https://discourse.julialang.org/t/project-environment/20133/3 "2019-01-26T23:05:01Z")

</div>

Project.toml only states `H2Libjl = "68c9da36-1c06-11e9-0d8d-e1acd994ec4d"` (uuid).

---

<div class="post-metadata">

**Author:** ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)\
**Post date:** [January 26, 2019, 11:11pm UTC](https://discourse.julialang.org/t/project-environment/20133/4 "2019-01-26T23:11:41Z")

</div>

If nothing is mentioned about that package in the `[compat]` section of Project.toml then I guess any version is admissible. In any case, if you simply invoke

```julia
] up

```

from the REPL when the environment is active, you’ll get the latest compatible (as prescribed by Project.toml) version of all packages.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 26, 2019, 11:15pm UTC](https://discourse.julialang.org/t/project-environment/20133/5 "2019-01-26T23:15:34Z")

</div>

That was really my point: The Manifest file instructs Julia to install one particular commit of the H2Libjl package. When I run ]up I do get an update from the H2Libjl library in the form of the latest commit. I would like to get that latest commit by default by specifying THAT in the Manifest file. Does it make sense?

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [January 26, 2019, 11:18pm UTC](https://discourse.julialang.org/t/project-environment/20133/6 "2019-01-26T23:18:34Z")

</div>

What do you mean by “by default”? When do you want the package to update if not on `up`?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 26, 2019, 11:21pm UTC](https://discourse.julialang.org/t/project-environment/20133/7 "2019-01-26T23:21:08Z")

</div>

I would just like to get the latest commit of H2Libjl by specifying that it is the latest commit in the Manifest file. Obviously I will not know the sha. I would like to say “get me the latest”, so that I don’t have to do “update” on that package.

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [January 26, 2019, 11:23pm UTC](https://discourse.julialang.org/t/project-environment/20133/8 "2019-01-26T23:23:53Z")

</div>

I think I am misunderstanding. Isn’t `up` the command which says “get me the latest”?

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [January 26, 2019, 11:27pm UTC](https://discourse.julialang.org/t/project-environment/20133/9 "2019-01-26T23:27:58Z")

</div>

Ah, are you looking for `pkg> add H2Libjl#commit`? i.e. specifying the commit directly instead of a branch?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 26, 2019, 11:30pm UTC](https://discourse.julialang.org/t/project-environment/20133/10 "2019-01-26T23:30:18Z")

</div>

I tried `add https://gitlab.com/PetrKrysl/H2Libjl.jl.git#commit `. That didn’t work.

---

<div class="post-metadata">

**Author:** ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)\
**Post date:** [January 26, 2019, 11:45pm UTC](https://discourse.julialang.org/t/project-environment/20133/11 "2019-01-26T23:45:45Z")

</div>

I think the Manifest is not to be touched directly, it just lists what is there. When you update a package in the environment, the corresponding lines in the Manifest will be updated.

When instantiating an environment, the package versions are taken from the Manifest (with their exact version) if present, and from the Project (latest compatible version) otherwise.

So I would say, just keep the Manifest local to your environment and don’t share it, so whoever fetches your project and instantiates it (which may be yourself too) will get the latest versions of packages.

See: [4. Working with Environments · Pkg.jl](https://julialang.github.io/Pkg.jl/v1/environments/#Using-someone-else's-project-1)

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 26, 2019, 11:48pm UTC](https://discourse.julialang.org/t/project-environment/20133/12 "2019-01-26T23:48:14Z")

</div>

My motivation really was to share the Manifest file so that everyone who collaborated on the project would get precisely the same versions of the packages as everyone else.

Except that for the library H2Libjl I would like everybody to get the latest commit, not just some particular fixed commit in the past.

---

<div class="post-metadata">

**Author:** ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)\
**Post date:** [January 26, 2019, 11:50pm UTC](https://discourse.julialang.org/t/project-environment/20133/13 "2019-01-26T23:50:20Z")

</div>

I see. Then my guess is that you should be fixing the versions in the Project files using the compat section, and leaving that particular one unbounded.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [January 26, 2019, 11:50pm UTC](https://discourse.julialang.org/t/project-environment/20133/14 "2019-01-26T23:50:32Z")

</div>

You can tell them to `pkg> up H2Libjl`.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 27, 2019, 4:09am UTC](https://discourse.julialang.org/t/project-environment/20133/15 "2019-01-27T04:09:11Z")

</div>

Oh well. It would have been nice if they could just say “]activate .; instantiate”. But I guess one can’t have EVERYTHING…

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [January 27, 2019, 7:50am UTC](https://discourse.julialang.org/t/project-environment/20133/16 "2019-01-27T07:50:11Z")

</div>

Well, the point of `pkg> activate; instantiate` is to get the _exact_ same thing, not _maybe_ the same thing.

---

<div class="post-metadata">

**Author:** ![leethargo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leethargo/32/6004_2.png) [@leethargo](https://discourse.julialang.org/u/leethargo)\
**Post date:** [January 27, 2019, 9:58am UTC](https://discourse.julialang.org/t/project-environment/20133/17 "2019-01-27T09:58:36Z")

</div>

Maybe the suggestion here is: Share the `project.toml` file with your colleagues, not the `manifest.toml`?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 27, 2019, 10:08am UTC](https://discourse.julialang.org/t/project-environment/20133/18 "2019-01-27T10:08:26Z")

</div>

I think the idea is to have the same explicit environment (except for one thing). That’s what the `Manifest.toml` is great for.

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [January 27, 2019, 4:24pm UTC](https://discourse.julialang.org/t/project-environment/20133/19 "2019-01-27T16:24:29Z")

</div>

`commit` here is supposed to be a Git commit SHA, not literally the word ‘commit’.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 27, 2019, 5:05pm UTC](https://discourse.julialang.org/t/project-environment/20133/20 "2019-01-27T17:05:42Z")

</div>

For sure. It did not work, as I found out after I posted, because I copied the wrong sha.
