# Making my package enviroment "Evergreen"

**URL:** <https://discourse.julialang.org/t/making-my-package-enviroment-evergreen/19817>\
**Category:** General Usage\
**Tags:** pkg\
**Created:** [January 19, 2019, 2:50pm UTC](https://discourse.julialang.org/t/making-my-package-enviroment-evergreen/19817 "2019-01-19T14:50:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [January 19, 2019, 2:50pm UTC](https://discourse.julialang.org/t/making-my-package-enviroment-evergreen/19817/1 "2019-01-19T14:50:26Z")

</div>

You may have noticed that your web-browser is [ever-green](https://www.w3.org/2001/tag/doc/evergreen-web/#updates)  
If you check your _About Firefox_ today you’ll see you are running FireFox v64.0.2.  
Now that version was release on January 9, 2019.  
You might be thinking: “But I installed Firefox 6 months ago, and I never updated it?!?”.  
This is because webbrowsers install updates in the background.

I want that for my julia enviroments too `*`.  
For a while I was doing in my `startup.jl`:

```julia
using Distributed: Distributed
let
    pkg_worker = Distributed.addprocs(1)[end]
    Distributed.remotecall(pkg_worker) do
        redirect_stdout() # silence everything, only on this worker
        Pkg.update()

        # now remove this worker and say we are done
        remotecall(1) do
            eval(quote
                Distributed.rmprocs($(pkg_worker))
                printstyled("\n Pkg.update() complete \n"; color=:light_black)
            end)
        end
    end
end

```

But this has some problems. Things seem to go a bit weird.  
I think Pkg does not really like it when you have two unrelated julia instances modifying it at the same time.

What is a more elegant and polished way of doing this?

(`*` lets pretend i want that. What I actually want is probably only to background install changes that are not breaking, according to semver. But one step at a time.)

---

<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 19, 2019, 3:39pm UTC](https://discourse.julialang.org/t/making-my-package-enviroment-evergreen/19817/2 "2019-01-19T15:39:01Z")

</div>

> [@oxinabox](#):
>
> This is because webbrowsers install updates in the background.

I somehow don’t think mine does, I use `apt full-upgrade` manually.

> [@oxinabox](#):
>
> What is a more elegant and polished way of doing this?

On Linux (and perhaps OS X? I am not sure), I would consider a cron job for

```julia
julia -e 'import Pkg; Pkg.update()'

```

but that said, I don’t think it is a good idea, for the following two reason:

1. if something breaks silently because of an update, you will only find out the reason indirectly,

2. I now do most of my work in project environments, some of which I definitely don’t want to upgrade unless I have time dedicated to dealing with the consequences. That’s fine, as they of course will not be updated by the above, but then it is pretty useless.

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [January 19, 2019, 6:38pm UTC](https://discourse.julialang.org/t/making-my-package-enviroment-evergreen/19817/3 "2019-01-19T18:38:32Z")

</div>

> [@Tamas\_Papp](#):
>
> I somehow don’t think mine does, I use `apt full-upgrade` manually.

I knew someone was going to come and say that.  
I was speaking in broad strokes.

> [@Tamas\_Papp](#):
>
> 1. if something breaks silently because of an update, you will only find out the reason indirectly,

Part of what i meant by polished was a way to let you know what had happened.  
Though that gives me an ideal: use a cron job like you suggest,  
and write a log each day, which is printed the first time you start julia.

> [@Tamas\_Papp](#):
>
> I now do most of my work in project environments, some of which I definitely don’t want to upgrade unless I have time dedicated to dealing with the consequences. That’s fine, as they of course will not be updated by the above, but then it is pretty useless.

Part of the “Lets pretent I want this” was that I actually would want to do this, but filtering for which projects I actually want to do this in.

---

<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 20, 2019, 1:06pm UTC](https://discourse.julialang.org/t/making-my-package-enviroment-evergreen/19817/4 "2019-01-20T13:06:02Z")

</div>

> [@oxinabox](#):
>
> Part of the “Lets pretent I want this” was that I actually would want to do this, but filtering for which projects I actually want to do this in.

Thinking about this, I would actually like a

> hey, your packages are 30+ days behind latest releases, maybe update?

warning each time I `pkg> activate` (which implicitly includes starting up Julia).
