Newbie question regarding Travis CI

I am trying to use Travis in an Open Source project I started. I have some (very limited) experience with CI, but using C++.

My build.jl file is this: https://github.com/korowjev/ArgData.jl/blob/master/deps/build.jl

I do include HTTP in my requirements, but every time Travis tries to build I get: ERROR: LoadError: ArgumentError: Package ArgData does not have HTTP in its dependencies

The more I googled, the more confused I got since most questions I found on Stack Overflow, for example, seem to be from people with more experience than me. So, here I ask if someone can point me to documentations/comments/anything that can help me understand and fix this (I assume) very simple mistake.

Thank you very much in advance.

This isn’t really a Travis CI problem, but more an issue with what you’re trying to do in your build.jl file. The build.jl file is intended to compile non-Julia dependencies for your project. If your package just depends on other Julia packages (as is the case here), then you should not have a build.jl file at all.

Instead, you need to be use the Project.toml file, which is what Pkg uses to figure out what dependencies your project has. You can learn more about Pkg here: 1. Introduction · Pkg.jl . You list the Julia dependencies of your package in Project.toml, and then users will automatically get those dependencies installed when they install your code.

While it is possible to edit Project.toml files manually, I find that it’s much easier to let Pkg do it for you. For example, let’s create a new Project.toml and add some dependencies to it:

julia> using Pkg

# Create a new project in a new folder called ArgData
julia> Pkg.generate("ArgData")
Generating project ArgData:
    ArgData/Project.toml
    ArgData/src/ArgData.jl
UUID("0e2afcf6-a34f-11e9-3f29-13cfdb572c71")

# Tell Pkg that we want to use that new project (and its associated Project.toml)
julia> Pkg.activate("./ArgData")
"/home/BOSDYN/rdeits/Downloads/ArgData/Project.toml"

# Add a dependency to that project (this will update Project.toml)
julia> Pkg.add("HTTP")

# Add another dependency:
julia> Pkg.add("CSV")

The result will be a file which looks like this:

$ cat Downloads/ArgData/Project.toml 
name = "ArgData"
uuid = "0e2afcf6-a34f-11e9-3f29-13cfdb572c71"
authors = ["Robin Deits <rdeits@bostondynamics.com>"]
version = "0.1.0"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"

That Project.toml should go in the top level of your project’s git repository, and then Travis CI (and anyone who installs your package) will automatically get the right set of dependencies.

4 Likes

Wow! Thank you very much for your detailed reply. I will look into Pkg documentation, yet this information is very clear and explanatory on its own. Thanks again!