Add BinDeps dependency to the build in julia v1

question
pkg

#1

tl;dr: In the build step of one of my packages I need to make use of BinDeps, but I get an error that the BinDeps package isn’t found in current path.

I have this file structure:

MyPackage
├── deps
│   ├── build.jl # where I have `using BinDeps`
│   ├── Manifest.toml
│   └── Project.toml
...

in that Project.toml I have

[deps]
BinDeps = "9e28174c-4ba2-5203-b857-d8d62c4213ee"

But still:

julia> using Pkg

julia> Pkg.add(PackageSpec(url = "https://github.com/yakir12/DungGUI.jl"))
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Cloning git-repo `https://github.com/yakir12/DungGUI.jl`
  Updating git-repo `https://github.com/yakir12/DungGUI.jl`
 Resolving package versions...
 Installed WebIO ─ v0.4.1
  Updating `~/.julia/environments/v1.0/Project.toml`
  [33bc2c43] + DungGUI v0.1.0 #master (https://github.com/yakir12/DungGUI.jl)
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [33bc2c43] + DungGUI v0.1.0 #master (https://github.com/yakir12/DungGUI.jl)
  [5ab0869b] ↑ KernelDensity v0.5.0 ⇒ v0.5.1
  [0f1e0344] ↑ WebIO v0.4.0 ⇒ v0.4.1
  Building WebIO ──→ `~/.julia/packages/WebIO/QjKwf/deps/build.log`
  Building DungGUI → `~/.julia/packages/DungGUI/SKidU/deps/build.log`
┌ Error: Error building `DungGUI`: 
│ ERROR: LoadError: ArgumentError: Package BinDeps not found in current path:
│ - Run `import Pkg; Pkg.add("BinDeps")` to install the BinDeps package.
│ 
│ Stacktrace:
│  [1] require(::Module, ::Symbol) at ./loading.jl:820
│  [2] include at ./boot.jl:317 [inlined]
│  [3] include_relative(::Module, ::String) at ./loading.jl:1041
│  [4] include(::Module, ::String) at ./sysimg.jl:29
│  [5] include(::String) at ./client.jl:388
│  [6] top-level scope at none:0
│ in expression starting at /home/yakir/.julia/packages/DungGUI/SKidU/deps/build.jl:1
└ @ Pkg.Operations /buildworker/worker/package_

it complains that “Package BinDeps not found in current path”…

What am I doing wrong…?

Thanks!


#2

Pkg.build is not run in a separate project, so you will have to add it to the main deps, here: https://github.com/yakir12/DungGUI.jl/blob/4ed47b71c9f709ecea67b9057334b2a588dffb35/Project.toml#L6.

Edit: Or hack your way through Pkg and do this: https://github.com/fredrikekre/Sandbox.jl


#3

Thank you!