How to disable precompilation on Travis-CI?


#1

I’m using TensorOperations.jl and TensorDecompositions.jl to test my package. All tests passed on my machine, but on travis, I got the following errors:

WARNING: Module TensorOperations with uuid 5174435575737 is missing from the cache.
This may mean module TensorOperations does not support precompilation but is imported by a module that does.
ERROR: LoadError: Declaring __precompile__(false) is not allowed in files that are being precompiled.
 in require(::Symbol) at ./loading.jl:385
 in include_from_node1(::String) at ./loading.jl:488
 in macro expansion; at ./none:2 [inlined]
 in anonymous at ./<missing>:?
 in eval(::Module, ::Any) at ./boot.jl:234
 in process_options(::Base.JLOptions) at ./client.jl:239
 in _start() at ./client.jl:318
while loading /home/travis/.julia/v0.5/TensorDecompositions/src/TensorDecompositions.jl, in expression starting on line 5
ERROR: LoadError: LoadError: Failed to precompile TensorDecompositions to /home/travis/.julia/lib/v0.5/TensorDecompositions.ji.
 in compilecache(::String) at ./loading.jl:593
 in require(::Symbol) at ./loading.jl:422
 in include_from_node1(::String) at ./loading.jl:488 (repeats 2 times)
 in process_options(::Base.JLOptions) at ./client.jl:262
 in _start() at ./client.jl:318
while loading /home/travis/.julia/v0.5/NRIRHOPM/test/hopm.jl, in expression starting on line 1
while loading /home/travis/.julia/v0.5/NRIRHOPM/test/runtests.jl, in expression starting on line 10
==============================[ ERROR: NRIRHOPM ]===============================
failed process: Process(`/home/travis/julia/bin/julia -Cx86-64 -J/home/travis/julia/lib/julia/sys.so --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=user --inline=no --color=no --compilecache=yes /home/travis/.julia/v0.5/NRIRHOPM/test/runtests.jl`, ProcessExited(1)) [1]
================================================================================

I’ve already read this thread, but I don’t know how to fix it on travis. I guess the problem is due to these two lines? is there a general way to completely disable precompilation on travis?


#2

It looks like you have __precompile__ enabled while you depend on TensorOperations which does not have it. This is a bug in your package.


#3

But it works well on my machine, I’ve just found using julia --compilecache=no -e ... fixes the bug on travis CI.


#4

Even if it works on some machines or with some flags, you must not have __precompile__() in your package if one of its dependencies doesn’t have it: http://docs.julialang.org/en/release-0.5/manual/modules/#module-initialization-and-precompilation


#5

Thanks for the info, but precompile() is not used in my code. Neither tensordecomposition.jl nor tensoroperation.jl is the dependency of my code, I just use them for testing. The error occurs when running ‘using TensorDecompositions’. Although TensorDecompositions depends on TensorOperations, precompile(false) is not marked in TensorOperation, so the above errors are unexpected.


#6

Oh, I see. You are right. I misunderstood the doc, there is no need to explicitly use precompile(false) to trigger a precompile failure.