Travis CI for an unregistered package


#1

I’m having trouble making a basic Travis CI script for an unregistered package.

This is the .travis.yml script that I’m using:

language: julia
os:
  - linux

julia:
  - 1.0

notifications:
  email: false

script:
  - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
  - julia -e 'using Pkg; Pkg.clone("https://github.com/JuliaPOMDP/IncrementalPruning.jl"); Pkg.build("IncrementalPruning"); Pkg.test("IncrementalPruning"; coverage=true)'

after_success:
  - julia -e 'cd(Pkg.dir("IncrementalPruning")); import Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'

which gives the following error:

ERROR: Cannot develop package with the same name or uuid as the project

As far as I can tell I’m not loading the same package within the project, but maybe I’m missing something? I ran the second line of the script section of the yaml locally on a windows machine, and all the tests pass:

using Pkg; Pkg.clone("https://github.com/JuliaPOMDP/IncrementalPruning.jl"); Pkg.build("IncrementalPruning"); Pkg.test("IncrementalPruning"; coverage=true)

...[lots of notifications]...

Test Summary:              | Pass  Total
Incremental Pruning Solver |   15     15
   Testing IncrementalPruning tests passed

Is there a problem with my yaml file? I tried to work from some example yaml’s for registered packages. Here’s my project.toml and REQUIRE:

name = "IncrementalPruning"
uuid = "82ee451e-1805-57fd-b4f9-e90c19bcb3e9"
repo = "https://github.com/JuliaPOMDP/IncrementalPruning.jl"

[deps]
Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ParticleFilters = "c8b314e2-9260-5cf8-ae76-3be7461ca6d0"
POMDPModelTools = "08074719-1b2a-587c-a292-00f91cc44415"
POMDPPolicies = "182e52fb-cfd0-5e46-8c26-fd0667c990f4"
POMDPs = "a93abf59-7444-517b-a68a-c42f96afdd7d"

[extras]
BeliefUpdaters = "8bb6e9a1-7d73-552c-a44a-e5dc5634aac4"
POMDPModels = "355abbd5-f08e-5560-ac9e-8b5f2592a0ca"
POMDPSimulators = "e0d0a172-29c6-5d4e-96d0-f262df5d01fd"
POMDPTesting = "92e6a534-49c2-5324-9027-86e3c861ab81"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["BeliefUpdaters", "POMDPModels", "POMDPSimulators", "POMDPTesting", "Test"]
julia 1.0
Clp
JuMP
LinearAlgebra
ParticleFilters
POMDPModels
POMDPs
POMDPToolbox

Thanks in advance for any advice!


#2

It should work if you just use the default script, i.e. leave the script part undefined.

What happens is that you, with the Pkg.clone part, try to add the package as a dependency to itself.


#3

Thanks for the suggestion. I tried it but now I have a different error:

ERROR: MethodError: no method matching getindex(::Nothing, ::String)
Stacktrace:
 [1] #build_versions#47(::Bool, ::Function, ::Pkg.Types.Context, ::Array{Base.UUID,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1045
 [2] build_versions at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1034 [inlined]
 [3] #instantiate#59(::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:570
 [4] instantiate at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:532 [inlined]
 [5] #build#53(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:457
 [6] build at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:436 [inlined]
 [7] build at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:434 [inlined]
 [8] build() at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:431
 [9] top-level scope at none:1
The command "julia --color=yes -e "if VERSION < v\"0.7.0-DEV.5183\"; Pkg.clone(pwd()); Pkg.build(\"${JL_PKG}\"); else using Pkg; if VERSION >= v\"1.1.0-rc1\"; Pkg.build(verbose=true); else Pkg.build(); end; end"" failed and exited with 1 during .

It looks like the default script also has a clone command at Pkg.clone(pwd())? I’m not sure that the uuid in my project.toml is correct. Maybe that’s part of the problem? I just copied the uuid from a defunct branch of the same project, but I’m not sure where that branch originally got the uuid.


#4

That is an error you usually get when something in the Manifest.toml does not make sense, e.g. some package has the wrong uuid or some package is in there when it shouldn’t.

There is no “correct” uuid in general, you can just generate one. However, if you plan on registering the package I would suggest you use the output of PPkg.METADATA_compatible_uuid("IncrementalPruning").


#5

I checked your repo and indeed the problem is that you have dangling packages in your Manifest.toml file, which has no connection to your Project.toml file. This means that your Manifest.toml have not been generated by the package manager itself, and is thus not understood by the package manager. In Julia 1.1 such dangling packages will simply be ignored, so the error is not visible there.

It looks like you somehow have included the test-only dependencies in your Manifest.toml (by hand? I hope not…). The simplest fix is to just remove the Manifest.toml file, and then instantiate which should create a new correct file for you.


#6

Thanks, that worked perfectly!

I originally had all the project dependencies and the test dependencies in the [deps] section of the Project.toml and I didn’t fix the Manifest.toml after I updated the Project.toml to move the test dependencies to [extras].