Package precompiles in one environment and not another

I want to use the package ImageBinarization in a project environment but it won’t precompile. What seems odd to me, is that it will precompile in another (the global) environment. Is there some sort of cache I can clear?

Things I’ve tried so far:

  • I’ve checked that the GUIDs are the same in both registries (Project.toml)
  • I’ve tried clearing a few things in .julia/packages/ImageBinarization to no effect.
  • I did not try removing anything from the ./julia/compiled/v.1.6/ImageBinarization. Maybe I should?
  • I also tried removing all of the packages from the project environment and readding them.
  • I’ve looked at the line in the ImageBinarization source that throws the error and it is using another package ImageContrastAdjustment. Eventhough this package is added automatically, I tried adding it before adding ImageBinarization.

I’m sure that there’s more I can try but I’m completely ignorant of Julia’s packaging system.

===========================================
The happy precompile looks like:

(@v1.6) pkg> status
      Status `~/.julia/environments/v1.6/Project.toml`
  [052768ef] CUDA v3.2.1
  [31a5f54b] Debugger v0.6.7
  [e30172f5] Documenter v0.27.0
  [35a29f4d] DocumenterTools v0.1.12
  [7073ff75] IJulia v1.23.2
  [cbc4b850] ImageBinarization v0.2.6
  [295af30f] Revise v3.1.16
  [9abbd945] Profile
  [8dfed614] Test

julia> using ImageBinarization
julia> 

=================================================
And the sad local package precompile error seems focused on jfptr_include_package_for_output_31832.clone_1 at /home/rafe/bin/julia-1.6.1/lib/julia/sys.so (unknown line)

The full error is:

(DigiLeap) pkg> status
     Project DigiLeap v0.1.0
      Status `~/work/digi-leap/DigiLeap.jl/Project.toml`
  [c7e460c6] ArgParse v1.1.4
  [336ed68f] CSV v0.8.5
  [5ae59095] Colors v0.12.8
  [a93c6f00] DataFrames v1.1.1
  [864edb3b] DataStructures v0.18.9
  [5789e2e9] FileIO v1.10.1
  [cbc4b850] ImageBinarization v0.2.6
  [82e4d734] ImageIO v0.5.6
  [4e3cecfd] ImageShow v0.3.1
  [916415d5] Images v0.24.1
  [682c06a0] JSON v0.21.1
  [c3e4b0f8] Pluto v0.14.7
  [7f904dfe] PlutoUI v0.7.9
  [295af30f] Revise v3.1.17
  [11879493] Tesseract v0.3.0
  [8dfed614] Test

julia> using ImageBinarization
[ Info: Precompiling ImageBinarization [cbc4b850-ae4b-5111-9e64-df94c024a13d]

signal (11): Segmentation fault
in expression starting at /home/rafe/.julia/packages/ImageBinarization/OamS1/src/ImageBinarization.jl:9
jl_array_ptr_ref at /buildworker/worker/package_linux64/build/src/julia.h:924 [inlined]
jl_deserialize_value_module at /buildworker/worker/package_linux64/build/src/dump.c:1545 [inlined]
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:1788
jl_deserialize_value_module at /buildworker/worker/package_linux64/build/src/dump.c:1577 [inlined]
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:1788
jl_deserialize_value_module at /buildworker/worker/package_linux64/build/src/dump.c:1551 [inlined]
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:1788
jl_deserialize_value_array at /buildworker/worker/package_linux64/build/src/dump.c:1368
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:1751
_jl_restore_incremental at /buildworker/worker/package_linux64/build/src/dump.c:2535
jl_restore_incremental at /buildworker/worker/package_linux64/build/src/dump.c:2605
_include_from_serialized at ./loading.jl:658
_require_search_from_serialized at ./loading.jl:760
_require at ./loading.jl:998
require at ./loading.jl:914
require at ./loading.jl:901
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
call_require at /buildworker/worker/package_linux64/build/src/toplevel.c:421 [inlined]
eval_import_path at /buildworker/worker/package_linux64/build/src/toplevel.c:458
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:684
jl_eval_module_expr at /buildworker/worker/package_linux64/build/src/toplevel.c:195 [inlined]
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:668
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:825
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:929
eval at ./boot.jl:360 [inlined]
include_string at ./loading.jl:1094
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
_include at ./loading.jl:1148
include at ./Base.jl:386 [inlined]
include_package_for_output at ./loading.jl:1213
jfptr_include_package_for_output_31832.clone_1 at /home/rafe/bin/julia-1.6.1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:115
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:204
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:155 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:562
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:670
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:877
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:929
eval at ./boot.jl:360 [inlined]
eval at ./client.jl:446
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:115
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:204
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:155 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:562
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:670
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:877
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:825
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:929
eval at ./boot.jl:360 [inlined]
exec_options at ./client.jl:261
_start at ./client.jl:485
jfptr__start_34289.clone_1 at /home/rafe/bin/julia-1.6.1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
true_main at /buildworker/worker/package_linux64/build/src/jlapi.c:560
repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:702
main at /buildworker/worker/package_linux64/build/cli/loader_exe.c:51
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at /home/rafe/bin/julia-1.6.1/bin/julia (unknown line)
Allocations: 6588753 (Pool: 6586965; Big: 1788); GC: 3
ERROR: Failed to precompile ImageBinarization [cbc4b850-ae4b-5111-9e64-df94c024a13d] to /home/rafe/.julia/compiled/v1.6/ImageBinarization/jl_3EeHAh.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
   @ Base ./loading.jl:1360
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1306
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1021
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:914
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:901
1 Like

This is probably not the way to do it (well I’m certain really) but nuking the home/me/.julia dir fixed the issue:

  • cd /home/me
  • mv .julia .julia_old
  • cd my/project
  • julia
  • ] # Get into package mode
  • activate .
  • instantiate
  • [backspace] # Get out of package mode
  • using ImageBinarization
  • Julia seems happy so far

Now I need to figure out what I should pull from the .julia_old dir

Unless you’ve been developing packages in that source tree, then I’d say nothing.

1 Like