Precompilation failure

I’m encountering precompilation failures with a package that uses TextAnalysis.jl
See minimal example here: https://github.com/AsafManela/TextAnalysisUser.jl
As you can see below, whenever I call “using TextAnalysisUser” precompilation fails.
The package usually still works, but loading it is much too slow.
Any ideas?

_       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.2-pre.0 (2018-09-30)
 _/ |\__'_|_|_|\__'_|  |  release-1.0/4aea3d2b7c (fork: 174 commits, 67 days)
|__/                   |

(v1.0) pkg> activate .

(TextAnalysisUser) pkg> st
Project TextAnalysisUser v0.1.0
    Status `~/.julia/dev/TextAnalysisUser/Project.toml`
  [a2db99b7] TextAnalysis v0.5.0+ #master (https://github.com/JuliaText/TextAnalysis.jl.git)

julia> using TextAnalysisUser
[ Info: Precompiling TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]
│   exception = Required dependency TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d] failed to load from a cache file.
└ @ Base loading.jl:966
[ Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysis/5Mwet.ji for TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d]

julia> TextAnalysisUser.crps()
TextAnalysis.DocumentTermMatrix(2×0 SparseArrays.SparseMatrixCSC{Int64,Int64} with 0 stored entries, String[], Dict{String,Int64}())

julia> versioninfo()
Julia Version 1.0.2-pre.0
Commit 4aea3d2b7c (2018-09-30 15:02 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2687W v3 @ 3.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)

julia>

What happens if you just pkg> activate the environment for this package, then execute

pkg> status
# and
julia> using TextAnalysis

? In particular, are you using a non-standard/forked version of TextAnalysis? Does it otherwise load cleanly?

That is what I am doing in the code snippet above (not sure why it is in red).
As it shows, I’m using current master from the original TextAnalysis.jl:

[a2db99b7] TextAnalysis v0.5.0+ #master (https://github.com/JuliaText/TextAnalysis.jl.git)

Not quite, I am asking for using TextAnalysis.

Sorry, missed that one.
For some reason, using TextAnalysis first works, as you can see below. But new julia sessions still recompile

(TextAnalysisUser) pkg> st
Project TextAnalysisUser v0.1.0
    Status `~/.julia/dev/TextAnalysisUser/Project.toml`
  [a2db99b7] TextAnalysis v0.5.0+ #master (https://github.com/JuliaText/TextAnalysis.jl.git)

julia> using TextAnalysis
[ Info: Precompiling TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d]

julia> using TextAnalysisUser
[ Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysisUser/T6cHl.ji for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]

julia> 

New session:

(v1.0) pkg> activate .

(TextAnalysisUser) pkg> st
Project TextAnalysisUser v0.1.0
    Status `~/.julia/dev/TextAnalysisUser/Project.toml`
  [a2db99b7] TextAnalysis v0.5.0+ #master (https://github.com/JuliaText/TextAnalysis.jl.git)

julia> using TextAnalysis
[ Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysis/5Mwet.ji for TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d]

julia> using TextAnalysisUser
[ Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysisUser/T6cHl.ji for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]

julia> 

Is this how caching is supposed to work?

The first two things I would try is

  1. making sure file/directory permissions are OK,

  2. remove the whole compiled cache (for all packages).

Thanks for the tips! I removed the entire .julia/compiled/v1.0 dir.
First time everything precompiles fine. But second time I get the same failure:

julia> using TextAnalysisUser
[ Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysisUser/T6cHl.ji for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for TextAnalysisUser [ea45e52c-d080-11e8-15cd-bda03c933327]
│   exception = Required dependency TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d] failed to load from a cache file.
└ @ Base loading.jl:966
[ Info: Recompiling stale cache file /home/username/.julia/compiled/v1.0/TextAnalysis/5Mwet.ji for TextAnalysis [a2db99b7-8b79-58f8-94bf-bbc811eef33d]

File permissions:

shell> ls -l ~/.julia/compiled/v1.0
total 92
drwxr-xr-x 2 username username 4096 Oct 15 10:24 BSON
drwxr-xr-x 2 username username 4096 Oct 15 10:23 CategoricalArrays
drwxr-xr-x 2 username username 4096 Oct 15 10:24 CodecZlib
drwxr-xr-x 2 username username 4096 Oct 15 10:23 Compat
drwxr-xr-x 2 username username 4096 Oct 15 10:24 DataFrames
drwxr-xr-x 2 username username 4096 Oct 15 10:23 DataStreams
drwxr-xr-x 2 username username 4096 Oct 15 10:23 DataStructures
drwxr-xr-x 2 username username 4096 Oct 15 10:24 IteratorInterfaceExtensions
drwxr-xr-x 2 username username 4096 Oct 15 10:23 JSON
drwxr-xr-x 2 username username 4096 Oct 15 10:24 Languages
drwxr-xr-x 2 username username 4096 Oct 15 10:23 Missings
drwxr-xr-x 2 username username 4096 Oct 15 10:23 OrderedCollections
drwxr-xr-x 2 username username 4096 Oct 15 10:23 Reexport
drwxr-xr-x 2 username username 4096 Oct 15 10:24 Requires
drwxr-xr-x 2 username username 4096 Oct 15 10:23 SortingAlgorithms
drwxr-xr-x 2 username username 4096 Oct 15 10:23 StatsBase
drwxr-xr-x 2 username username 4096 Oct 15 10:24 Tables
drwxr-xr-x 2 username username 4096 Oct 15 10:24 TableTraits
drwxr-xr-x 2 username username 4096 Oct 15 10:27 TextAnalysis
drwxr-xr-x 2 username username 4096 Oct 15 10:27 TextAnalysisUser
drwxr-xr-x 2 username username 4096 Oct 15 10:24 TranscodingStreams
drwxr-xr-x 2 username username 4096 Oct 15 10:23 WeakRefStrings
drwxr-xr-x 2 username username 4096 Oct 15 10:24 WordTokenizers

shell> ls -l ~/.julia/compiled/v1.0/TextAnalysis
total 264
-rw------- 1 username username 267807 Oct 15 10:27 5Mwet.ji

julia>