# Understanding Pkg - add a temporary development module

**URL:** <https://discourse.julialang.org/t/understanding-pkg-add-a-temporary-development-module/84762>\
**Category:** General Usage\
**Created:** [July 25, 2022, 4:10pm UTC](https://discourse.julialang.org/t/understanding-pkg-add-a-temporary-development-module/84762 "2022-07-25T16:10:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hros](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@hros](https://discourse.julialang.org/u/hros)\
**Post date:** [July 25, 2022, 4:10pm UTC](https://discourse.julialang.org/t/understanding-pkg-add-a-temporary-development-module/84762/1 "2022-07-25T16:10:15Z")

</div>

A recent workshop (on [MLJ](https://github.com/alan-turing-institute/MLJ.jl)) began with the following instructions for adding a module for the workshop:

```julia
ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0
using Pkg
Pkg.activate(temp=true)
Pkg.develop(url="https://github.com/ablaom/HelloJulia.jl")
Pkg.activate(joinpath(Pkg.devdir(), "HelloJulia"))
Pkg.instantiate()
ENV["JULIA_PKG_PRECOMPILE_AUTO"]=1

using HelloJulia

```

Please clarify a couple of points:

1. Do the two `ENV` commands prevent precompilation of the module’s dependencies, meaning that the necessary dependencies would be compiled as needed, saving time on startup?
2. As for the double `activate` commands, is the first command used to “dump” temporary downloaded files and build artifacts in a `/tmp` directory whereas the second command makes the built module accessible for the `using` command?  
As for the second `activate` command, what is the purpose of the `devdir()`? I don’t see anything there

Lastly, if this sequence of commands is the recommended way to develop/debug a downloaded module, shouldn’t it be added as a command (or option) to `Pkg`?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [July 25, 2022, 4:19pm UTC](https://discourse.julialang.org/t/understanding-pkg-add-a-temporary-development-module/84762/2 "2022-07-25T16:19:24Z")

</div>

1 - yes. 2 - the first `activate` just activates a temp directory, so that the `HelloJulia` package doesn’t get added to the user’s global environment. Then `HelloJulia` is added via the `develop` command, which means it gets installed in the `dev` directory rather than the `packages` directory where packages which are `add`ed in the normal way get stored.

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [July 25, 2022, 6:43pm UTC](https://discourse.julialang.org/t/understanding-pkg-add-a-temporary-development-module/84762/3 "2022-07-25T18:43:59Z")

</div>

> [@hros](#):
>
> Lastly, if this sequence of commands is the recommended way to develop/debug a downloaded module, shouldn’t it be added as a command (or option) to `Pkg`?

I’d say this is not the way one would usually develop someone else’s package. Instead, the more direct approach would be to follow the [Pkg docs](https://pkgdocs.julialang.org/v1/environments/#Using-someone-else's-project) (`git clone` / `activate` / `instantiate`).  
Perhaps the tutorial tried to stay away from `git`.
