# Project that depends on unreleased packages: Unsatisfiable requirements

**URL:** <https://discourse.julialang.org/t/project-that-depends-on-unreleased-packages-unsatisfiable-requirements/22764>\
**Category:** General Usage\
**Tags:** pkg\
**Created:** [April 4, 2019, 6:47pm UTC](https://discourse.julialang.org/t/project-that-depends-on-unreleased-packages-unsatisfiable-requirements/22764 "2019-04-04T18:47:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [April 4, 2019, 6:47pm UTC](https://discourse.julialang.org/t/project-that-depends-on-unreleased-packages-unsatisfiable-requirements/22764/1 "2019-04-04T18:47:11Z")

</div>

I’m trying to figure out how to instantiate a project that depends on unreleased but registered packages with properly set-up version numbers and compatibility requirements in Project.toml (for use on CI; preparing for JuliaRegistrator). For example:

```julia
$ git clone https://github.com/JuliaGPU/CUDAnative.jl
$ cd CUDAnative.jl

# directly instantiating doesn't work,
# because CUDAnative depends on an unreleased CUDAdrv.

$ julia --project -e 'using Pkg; Pkg.add([PackageSpec(name=pkg; rev="master")
                                          for pkg in ("CuArrays", "CUDAdrv")])'
   Cloning default registries into `~/.julia`
   Cloning registry from "https://github.com/JuliaRegistries/General.git"
     Added registry `General` to `~/.julia/registries/General`
   Cloning git-repo `https://github.com/JuliaGPU/CuArrays.jl.git`
  Updating git-repo `https://github.com/JuliaGPU/CuArrays.jl.git`
   Cloning git-repo `https://github.com/JuliaGPU/CUDAdrv.jl.git`
  Updating git-repo `https://github.com/JuliaGPU/CUDAdrv.jl.git`
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CUDAdrv [c5f51814]:
 CUDAdrv [c5f51814] log:
 ├─possible versions are: 2.1.0 or uninstalled
 ├─restricted to versions 2.0.0-2 by CuArrays [3a865a2d], leaving only versions 2.1.0
 │ └─CuArrays [3a865a2d] log:
 │ ├─possible versions are: 1.0.2 or uninstalled
 │ └─CuArrays [3a865a2d] is fixed to version 1.0.2
 ├─CUDAdrv [c5f51814] is fixed to version 2.1.0
 └─found to have no compatible versions left with CUDAnative [be33ccc6] 
   └─CUDAnative [be33ccc6] log:
     ├─possible versions are: [0.1.0-0.1.3, 0.2.0, 0.3.0-0.3.1, 0.4.0-0.4.2, 0.5.0-0.5.5, 0.6.0-0.6.3, 0.7.0, 0.8.0-0.8.10, 0.9.0-0.9.1, 0.10.0-0.10.1, 1.0.0-1.0.1, 2.0.0-2.0.1] or uninstalled
     └─restricted to versions 2.0.0-2 by CuArrays [3a865a2d], leaving only versions 2.0.0-2.0.1
       └─CuArrays [3a865a2d] log: see above

```

For some reason, the resolver isn’t happy and I don’t understand why. Version requirements seem to be OK, this is (the relevant pieces of) what’s in the package’s Project.toml files on the master branches:

```julia
$ cat CUDAdrv/Project.toml
version = "2.1.0"

$ cat CUDAnative/Project.toml
version = "2.1.0"
[compat]
CUDAdrv = "2.1"

$ cat CuArrays/Project.toml
version = "1.0.2"
[compat]
CUDAnative = "2.0"
CUDAdrv = "2.0"

```

Neither CUDAnative or CUDAdrv 2.1 have been released, but the master branches provide those versions which should be compatible with CuArrays. It works when only adding CUDAdrv#master, so it must have something to do with CuArrays’ compatibility requirements.

---

<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:** [April 4, 2019, 7:23pm UTC](https://discourse.julialang.org/t/project-that-depends-on-unreleased-packages-unsatisfiable-requirements/22764/2 "2019-04-04T19:23:16Z")

</div>

Adding `CUDAnative` to `#master` as well seems to make it go through. Not sure why yet.

---

<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:** [April 4, 2019, 7:26pm UTC](https://discourse.julialang.org/t/project-that-depends-on-unreleased-packages-unsatisfiable-requirements/22764/3 "2019-04-04T19:26:52Z")

</div>

Hmm, it feels like this should work, but it looks like it doesn’t when you’re working in the project of one of the dependencies of a package you’re trying to add. I typically use a separate project, as in

```bash
julia --project=. #in some directory

```

then

```julia
] add CUDAdrv#master
] add https://github.com/JuliaGPU/CUDAnative.jl
] add CuArrays#master

```

But I think this is a valid use case that should be supported.

---

<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:** [April 4, 2019, 7:31pm UTC](https://discourse.julialang.org/t/project-that-depends-on-unreleased-packages-unsatisfiable-requirements/22764/4 "2019-04-04T19:31:19Z")

</div>

What do you mean exactly? I interpreted it as trying to add `CUDAnative#master` as a dependency to itself, which fails (as expected):

```julia
(CUDAnative) pkg> add CUDAnative#master
  Updating git-repo `ssh://git@github.com/JuliaGPU/CUDAnative.jl.git`
ERROR: Cannot add package with the same name or uuid as the project

```

---

<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:** [April 4, 2019, 7:32pm UTC](https://discourse.julialang.org/t/project-that-depends-on-unreleased-packages-unsatisfiable-requirements/22764/5 "2019-04-04T19:32:46Z")

</div>

I just meant in a “naked” environment, adding `CUDAnative` to the list in the first post. Perhaps I misunderstood something.

---

<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:** [April 5, 2019, 3:01am UTC](https://discourse.julialang.org/t/project-that-depends-on-unreleased-packages-unsatisfiable-requirements/22764/6 "2019-04-05T03:01:56Z")

</div>

In the OP, CUDANative doesn’t actually appear as a dependency in the active project, it _is_ the active project.

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [April 5, 2019, 5:32am UTC](https://discourse.julialang.org/t/project-that-depends-on-unreleased-packages-unsatisfiable-requirements/22764/7 "2019-04-05T05:32:13Z")

</div>

Yeah, adding `CUDAnative#master` would check-out the master branch of package, while this is intended to test whatever branch has been checked-out in that folder (again, for CI purposes).

A workaround I’ve found (but complicates other commands) is to add the current directory:

```julia
$ julia -e 'using Pkg; Pkg.add([PackageSpec(path=pwd());
                                [PackageSpec(name=pkg; rev="master")
                                 for pkg in ("CuArrays", "CUDAdrv")]])'

```

The problem with this is that you can’t just `Pkg.test()` anymore, which fails with `cannot test an unnamed project` (so the CI user would need to provide the name of the project under test).
