# Document(er) mystery

**URL:** <https://discourse.julialang.org/t/document-er-mystery/67306>\
**Category:** General Usage\
**Tags:** documenter\
**Created:** [August 29, 2021, 6:58pm UTC](https://discourse.julialang.org/t/document-er-mystery/67306 "2021-08-29T18:58:43Z")\
**Posts on this page:** 8\
**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:** [August 29, 2021, 6:58pm UTC](https://discourse.julialang.org/t/document-er-mystery/67306/1 "2021-08-29T18:58:43Z")

</div>

I use project - specific files in `docs`, Project.toml and Manifest.toml.  
I wish to run

```julia
  docs:
    name: Documentation
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: julia-actions/setup-julia@v1
        with:
          version: '1'
      - run: julia --project=docs docs/make.jl
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

```

to generate the documentation.

The command `julia --project=docs docs/make.jl` works fine when I run it with local Julia (1.6.2 and up).  
However, when run as part of CI I get this error

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/6/16956c7380de41fc3d6e154f36f88baf78343f83.png)  
I don’t know what to make of it, since the `docs/Manifest.toml` file  
clearly includes a reference to `Documenter`!? Locally I do get  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/c/dcd6146a1c439d39dc7a46a0f9a66b7802bc7a3b.png)

---

<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:** [August 29, 2021, 7:07pm UTC](https://discourse.julialang.org/t/document-er-mystery/67306/2 "2021-08-29T19:07:07Z")

</div>

It means Documenter is not downloaded. Run `Pkg.instantiate()` first (like the error message says).

---

<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:** [August 29, 2021, 7:14pm UTC](https://discourse.julialang.org/t/document-er-mystery/67306/3 "2021-08-29T19:14:09Z")

</div>

So, `--project=` actually doesn’t do any of that (activate, instantiate), I am guessing?

Edit: Verified. I wonder what the use of --project then might be?

Edit 2: Fixed the above issue with  
`- run: julia -e "using Pkg; Pkg.activate(\"docs\"); Pkg.instantiate(); include(\"docs/make.jl\")"`

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [August 29, 2021, 7:36pm UTC](https://discourse.julialang.org/t/document-er-mystery/67306/4 "2021-08-29T19:36:38Z")

</div>

The `--project` flag just tells Julia which environment to use (just like `activate` does from within a Julia session). E.g. if you start Julia with `julia --project=docs` and press `]` you will see you’re in the docs environment:

```julia
(docs) pkg>

```

It doesn’t do anything more than that though, so you still need to call `instantiate` yourself (but it tells Julia _which_ environment to instantiate!).

---

<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:** [August 29, 2021, 9:16pm UTC](https://discourse.julialang.org/t/document-er-mystery/67306/5 "2021-08-29T21:16:01Z")

</div>

Right. But if you have to do `instantiate` manually afterwards, why not make `--project` do both activate and instantiate?

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [August 29, 2021, 9:31pm UTC](https://discourse.julialang.org/t/document-er-mystery/67306/6 "2021-08-29T21:31:04Z")

</div>

Well if you’ve already done it once you don’t need to do it again. It’s just the same as `activate`, that doesn’t `instantiate` either.

I think the deeper reason though is security: just opening a Julia session shouldn’t run untrusted code. But if `—project` instantiated, that would install packages (which could be unregistered if there’s a Manifest), which would call their build step, which can execute code.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [August 29, 2021, 9:32pm UTC](https://discourse.julialang.org/t/document-er-mystery/67306/7 "2021-08-29T21:32:51Z")

</div>

It’s easier to see why this a problem if you consider a Julia session could be started by automatic tools (like the language server) or a script etc.

---

<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:** [August 29, 2021, 9:48pm UTC](https://discourse.julialang.org/t/document-er-mystery/67306/8 "2021-08-29T21:48:55Z")

</div>

Ref [https://github.com/JuliaLang/Pkg.jl/issues/1415](https://github.com/JuliaLang/Pkg.jl/issues/1415)
