# Pkg: adding private packages with private dependencies

**URL:** https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505
**Category:** General Usage
**Tags:** pkg
**Created:** [August 15, 2018, 2:53pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505 "2018-08-15T14:53:05Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![crbinz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crbinz/32/1919_2.png) [@crbinz](https://discourse.julialang.org/u/crbinz)
#### Post date: [August 15, 2018, 2:53pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/1 "2018-08-15T14:53:05Z")

</div>

I have several packages hosted on an internal Gitlab server. I have kept public dependencies in `REQUIRE` files for these packages, but I have relied on doing `Pkg.clone(...)` manually to add the internal dependencies (for v0.6 and back).

In v0.7, I can do `]add <internal package url>`, which seems to install the dependencies listed in `REQUIRE`. Then when I try to test the package, I get errors about the internal dependencies (`Package Arc does not have UKF in its dependencies ...`).

I have tried `]add <internal dependency url>`, but I get the same error message.

I have tried `]dev <internal package url>`, then `]activate <path to internal package>`, then `]add <internal dependency url>`, which generates a `Manifest.toml` and a `Project.toml`, but `Project.toml` is apparently malformed, as I get

`ERROR: expected a name entry in project file at C:\Users\cbinz\.julia\dev\Arc\Project.toml`

What is the correct way to install an internal package, with dependencies, in v0.7?

---

<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 15, 2018, 2:54pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/2 "2018-08-15T14:54:49Z")

</div>

> [@crbinz](#):
>
> What is the correct way to install an internal package, with dependencies, in v0.7?

Install the private dependencies first, then the private package that depends on them.

---

<div class="post-metadata">

### Author: ![crbinz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crbinz/32/1919_2.png) [@crbinz](https://discourse.julialang.org/u/crbinz)
#### Post date: [August 15, 2018, 3:01pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/3 "2018-08-15T15:01:20Z")

</div>

I tried this, but I still get

```julia
ERROR: LoadError: ArgumentError: Package Arc does not have UKF in its dependencies:
- If you have Arc checked out for development and have
  added UKF as a dependency but haven't updated your primary
  environment's manifest file, try Pkg.resolve().
- Otherwise you may need to report an issue with Arc

```

---

<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 15, 2018, 3:30pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/4 "2018-08-15T15:30:45Z")

</div>

Does `Arc` have `UFK` in its dependencies (REQUIRE file)?

---

<div class="post-metadata">

### Author: ![crbinz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crbinz/32/1919_2.png) [@crbinz](https://discourse.julialang.org/u/crbinz)
#### Post date: [August 15, 2018, 3:33pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/5 "2018-08-15T15:33:12Z")

</div>

It does not, because I’m not even sure how that would work – at least, in the past, `REQUIRE` relied on `METADATA`, and obviously my internally-developed package would not be there. And as far as I know, there is (was) not a way to add some custom URL to a REQUIRE entry.

---

<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 15, 2018, 3:34pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/6 "2018-08-15T15:34:24Z")

</div>

In 0.7, 1.0 every dependency needs to be listed in `REQUIRE` / `Project.toml`. So add it there and try again.

---

<div class="post-metadata">

### Author: ![crbinz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crbinz/32/1919_2.png) [@crbinz](https://discourse.julialang.org/u/crbinz)
#### Post date: [August 15, 2018, 3:40pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/7 "2018-08-15T15:40:48Z")

</div>

Hmm, ok, I suppose that shouldn’t be surprising to me. Thanks.

Separately: when I tried `dev`ing the package and adding a dependency, the initial `Project.toml` contained only the `[deps]` section (no `[name]`), so an error gets thrown. Is this expected behavior?

---

<div class="post-metadata">

### Author: ![crbinz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crbinz/32/1919_2.png) [@crbinz](https://discourse.julialang.org/u/crbinz)
#### Post date: [August 16, 2018, 12:24pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/8 "2018-08-16T12:24:24Z")

</div>

A new problem: now when I try to update, I get `ERROR: Git repository not found at 'UKF'`, because `repo-url` for `UKF` is just `"UKF"` in my `Manifest`.

---

<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 16, 2018, 12:26pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/9 "2018-08-16T12:26:32Z")

</div>

> [@crbinz](#):
>
> `ERROR: Git repository not found at 'UKF'` , because `repo-url` for `UKF` is just `"UKF"` in my `Manifest` .

How did you add `UKF`?

---

<div class="post-metadata">

### Author: ![crbinz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crbinz/32/1919_2.png) [@crbinz](https://discourse.julialang.org/u/crbinz)
#### Post date: [August 16, 2018, 12:29pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/10 "2018-08-16T12:29:09Z")

</div>

I did `]add git@<url...>/UKF.jl.git`, however I may have also just tried `]add UKF` in the `Arc` project when I was trying to figure this out.

**Edit** : I tried editing my `Manifest` directly and adding the URL, but I ran into [this issue](https://github.com/JuliaLang/Pkg.jl/issues/269) (I think).

---

<div class="post-metadata">

### Author: ![tobias.knopp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobias.knopp/32/7551_2.png) [@tobias.knopp](https://discourse.julialang.org/u/tobias.knopp)
#### Post date: [August 18, 2018, 7:00pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/11 "2018-08-18T19:00:28Z")

</div>

I need this a well and even after reading through this thread I do not get it.  
I have two Packages `A.jl` and `B.jl`. `B.jl` depends on `A.jl`. Both projects do not have a `Manifest.toml` but just a `REQUIRE`.

What exactly do I now need to do to make this work?

Adding things to REQUIRE seems to not work since REQUIRE requires the package to be registered. Should I add them to `Manifest.toml`? If yes how?

---

<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: [August 18, 2018, 7:34pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/12 "2018-08-18T19:34:13Z")

</div>

Just put `A` in `B`’s `REQUIRE`, and make sure you install `B` before `A`?

---

<div class="post-metadata">

### Author: ![tobias.knopp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobias.knopp/32/7551_2.png) [@tobias.knopp](https://discourse.julialang.org/u/tobias.knopp)
#### Post date: [August 18, 2018, 7:43pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/13 "2018-08-18T19:43:52Z")

</div>

That seems to work but I needed a `Pkg.resolve`.

Is there a way that Package `B` can clone Package `A`? Can I specify the url in the REQUIRE file or somewhere else?

---

<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: [August 18, 2018, 7:46pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/14 "2018-08-18T19:46:34Z")

</div>

> [@tobias.knopp](#):
>
> Is there a way that Package `B` can clone Package `A` ? Can I specify the url in the REQUIRE file or somewhere else?

No, but you can maybe follow [Store some location info for deps in Project.toml · Issue #492 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/492)

---

<div class="post-metadata">

### Author: ![tobias.knopp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobias.knopp/32/7551_2.png) [@tobias.knopp](https://discourse.julialang.org/u/tobias.knopp)
#### Post date: [August 18, 2018, 7:51pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505/15 "2018-08-18T19:51:04Z")

</div>

I used

```julia
if !isdir(Pkg.dir("A"))
  println("Installing A...")
  Pkg.clone("https://github.com/.../A")
end

```

In Julia 0.6 but this does not work anymore.
