JuliaImages / OpenCV.jl

Use OpenCV in Julia!! 🚀
https://juliaimages.org/OpenCV.jl/dev/
MIT License
40 stars 14 forks source link

FYI: Doesn't work in 1.8 (or 1.7-beta3) #2

Closed PallHaraldsson closed 1 year ago

PallHaraldsson commented 3 years ago

Is it supposed to work?

[EDIT: 1.6 actually works, just not old DEV]

I get seemingly same error in 1.7 as in 1.8:

(@v1.8) pkg> add OpenCV
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `~/.julia/environments/v1.8/Project.toml`
  [f878e3a2] ~ OpenCV v4.5.2 `https://github.com/archit120/OpenCV.jl#master` ⇒ v4.5.2
    Updating `~/.julia/environments/v1.8/Manifest.toml`
  [f878e3a2] ~ OpenCV v4.5.2 `https://github.com/archit120/OpenCV.jl#master` ⇒ v4.5.2
Precompiling project...
  ✗ OpenCV
  14 dependencies successfully precompiled in 227 seconds (157 already precompiled, 13 skipped during auto due to previous errors)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

julia> import Pkg; Pkg.precompile()
Precompiling project...
  ✗ OpenCV
  1 dependency successfully precompiled in 4 seconds (183 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

OpenCV [f878e3a2-a245-4720-8660-60795d644f2a]

Failed to precompile OpenCV [f878e3a2-a245-4720-8660-60795d644f2a] to /home/pharaldsson_sym/.julia/compiled/v1.8/OpenCV/jl_5Ud5cV.
C++ exception while wrapping module OpenCV: invalid subtyping in definition of CxxVec with supertype Any

signal (11): Segmentation fault
in expression starting at none:0
sweep_pool_page at /buildworker/worker/package_linux64/build/src/gc.c:1386 [inlined]
sweep_pool_pagetable0 at /buildworker/worker/package_linux64/build/src/gc.c:1406 [inlined]
sweep_pool_pagetable1 at /buildworker/worker/package_linux64/build/src/gc.c:1426 [inlined]
sweep_pool_pagetable at /buildworker/worker/package_linux64/build/src/gc.c:1456 [inlined]
gc_sweep_pool at /buildworker/worker/package_linux64/build/src/gc.c:1531
_jl_gc_collect at /buildworker/worker/package_linux64/build/src/gc.c:3142
jl_gc_collect at /buildworker/worker/package_linux64/build/src/gc.c:3236
maybe_collect at /buildworker/worker/package_linux64/build/src/gc.c:881 [inlined]
jl_gc_pool_alloc at /buildworker/worker/package_linux64/build/src/gc.c:1205
UseRef at ./compiler/ssair/ir.jl:338 [inlined]
UseRefIterator at ./compiler/ssair/ir.jl:344 [inlined]
userefs at ./compiler/ssair/ir.jl:460 [inlined]
renumber_ssa2! at ./compiler/ssair/ir.jl:908
process_node! at ./compiler/ssair/ir.jl:1029
iterate at ./compiler/ssair/ir.jl:1302
compact! at ./compiler/ssair/ir.jl:1451
compact! at ./compiler/ssair/ir.jl:1449 [inlined]
run_passes at ./compiler/optimize.jl:308
optimize at ./compiler/optimize.jl:295 [inlined]
_typeinf at ./compiler/typeinfer.jl:255
typeinf at ./compiler/typeinfer.jl:209
abstract_call_method_with_const_args at ./compiler/abstractinterpretation.jl:520
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:168
abstract_call_known at ./compiler/abstractinterpretation.jl:1246
abstract_call at ./compiler/abstractinterpretation.jl:1305
abstract_call at ./compiler/abstractinterpretation.jl:1285
abstract_eval_statement at ./compiler/abstractinterpretation.jl:1425
typeinf_local at ./compiler/abstractinterpretation.jl:1795
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1902
_typeinf at ./compiler/typeinfer.jl:226
typeinf at ./compiler/typeinfer.jl:209
abstract_call_method_with_const_args at ./compiler/abstractinterpretation.jl:520
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:168
abstract_call_known at ./compiler/abstractinterpretation.jl:1246
abstract_call at ./compiler/abstractinterpretation.jl:1305
abstract_call at ./compiler/abstractinterpretation.jl:1285
abstract_eval_statement at ./compiler/abstractinterpretation.jl:1425
typeinf_local at ./compiler/abstractinterpretation.jl:1795
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1902
_typeinf at ./compiler/typeinfer.jl:226
typeinf at ./compiler/typeinfer.jl:209
typeinf_edge at ./compiler/typeinfer.jl:824 [inlined]
abstract_call_method at ./compiler/abstractinterpretation.jl:473
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:160
abstract_call_known at ./compiler/abstractinterpretation.jl:1246
abstract_call at ./compiler/abstractinterpretation.jl:1305
abstract_apply at ./compiler/abstractinterpretation.jl:923
abstract_call_known at ./compiler/abstractinterpretation.jl:1165
abstract_call at ./compiler/abstractinterpretation.jl:1305
abstract_call at ./compiler/abstractinterpretation.jl:1285
abstract_eval_statement at ./compiler/abstractinterpretation.jl:1425
typeinf_local at ./compiler/abstractinterpretation.jl:1812
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1902
_typeinf at ./compiler/typeinfer.jl:226
typeinf at ./compiler/typeinfer.jl:209
typeinf_edge at ./compiler/typeinfer.jl:824 [inlined]
abstract_call_method at ./compiler/abstractinterpretation.jl:473
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:160
abstract_call_known at ./compiler/abstractinterpretation.jl:1246
abstract_call at ./compiler/abstractinterpretation.jl:1305
abstract_apply at ./compiler/abstractinterpretation.jl:923
abstract_call_known at ./compiler/abstractinterpretation.jl:1165
abstract_call at ./compiler/abstractinterpretation.jl:1305
abstract_call at ./compiler/abstractinterpretation.jl:1285
abstract_eval_statement at ./compiler/abstractinterpretation.jl:1425
typeinf_local at ./compiler/abstractinterpretation.jl:1812
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1902
_typeinf at ./compiler/typeinfer.jl:226
typeinf at ./compiler/typeinfer.jl:209
typeinf_edge at ./compiler/typeinfer.jl:824 [inlined]
abstract_call_method at ./compiler/abstractinterpretation.jl:473
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:160
abstract_call_known at ./compiler/abstractinterpretation.jl:1246
abstract_call at ./compiler/abstractinterpretation.jl:1305
abstract_apply at ./compiler/abstractinterpretation.jl:923
abstract_call_known at ./compiler/abstractinterpretation.jl:1165
abstract_call at ./compiler/abstractinterpretation.jl:1305
abstract_call at ./compiler/abstractinterpretation.jl:1285
abstract_eval_statement at ./compiler/abstractinterpretation.jl:1425
typeinf_local at ./compiler/abstractinterpretation.jl:1812
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1902
_typeinf at ./compiler/typeinfer.jl:226
typeinf at ./compiler/typeinfer.jl:209
typeinf_edge at ./compiler/typeinfer.jl:824 [inlined]
abstract_call_method at ./compiler/abstractinterpretation.jl:473
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:160
abstract_call_known at ./compiler/abstractinterpretation.jl:1246
abstract_call at ./compiler/abstractinterpretation.jl:1305
abstract_call at ./compiler/abstractinterpretation.jl:1285
abstract_eval_statement at ./compiler/abstractinterpretation.jl:1425
typeinf_local at ./compiler/abstractinterpretation.jl:1812
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1902
_typeinf at ./compiler/typeinfer.jl:226
typeinf at ./compiler/typeinfer.jl:209
typeinf_ext at ./compiler/typeinfer.jl:910
typeinf_ext_toplevel at ./compiler/typeinfer.jl:943
typeinf_ext_toplevel at ./compiler/typeinfer.jl:939
jfptr_typeinf_ext_toplevel_15450.clone_1 at /home/pharaldsson_sym/julia-1.8-DEV-7553ca13cc/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2245 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2427
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1787 [inlined]
jl_type_infer at /buildworker/worker/package_linux64/build/src/gf.c:295
jl_generate_fptr at /buildworker/worker/package_linux64/build/src/jitlayers.cpp:338
jl_compile_method_internal at /buildworker/worker/package_linux64/build/src/gf.c:1978
jl_compile_method_internal at /buildworker/worker/package_linux64/build/src/gf.c:2244 [inlined]
_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:2427
display_error at ./client.jl:107
unknown function (ip: 0x7f2cc680d282)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2245 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2427
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1787 [inlined]
jl_f__call_latest at /buildworker/worker/package_linux64/build/src/builtins.c:757
#invokelatest#2 at ./essentials.jl:716 [inlined]
invokelatest at ./essentials.jl:714 [inlined]
_start at ./client.jl:497
jfptr__start_41329.clone_1 at /home/pharaldsson_sym/julia-1.8-DEV-7553ca13cc/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2245 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2427
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1787 [inlined]
true_main at /buildworker/worker/package_linux64/build/src/jlapi.c:559
jl_repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:701
main at /buildworker/worker/package_linux64/build/cli/loader_exe.c:42
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at /home/pharaldsson_sym/julia-1.8-DEV-7553ca13cc/bin/julia (unknown line)
Allocations: 3069803 (Pool: 3069192; Big: 611); GC: 1
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.8/Pkg/src/Types.jl:68
 [2] precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.8/Pkg/src/API.jl:1357
 [3] precompile
   @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.8/Pkg/src/API.jl:1011 [inlined]
 [4] #precompile#220
   @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.8/Pkg/src/API.jl:1009 [inlined]
 [5] precompile()
   @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.8/Pkg/src/API.jl:1009
 [6] top-level scope
   @ REPL[2]:1
archit120 commented 3 years ago

This is weird. It should work. Even the last run on Github Actions shows the package built and tests passed sucesfully. Re-run the job to see if a newer 1.6 version is causing the error.

https://github.com/archit120/OpenCV.jl/runs/2921254544?check_suite_focus=true

PallHaraldsson commented 3 years ago

I don't actually need this package, I was just looking into since I noticed something weird:

Precompiling some other package (triggering more) I got a TOML error understandably for OpenCV:

[[BinaryProvider]]
deps = ["Libdl", "Pkg", "SHA", "Test"]
git-tree-sha1 = "9930c1a6cd49d9fcd7218df6be417e6ae4f1468a"
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.5.2"
<<<<<<< HEAD

[[CMakeWrapper]]
deps = ["BinDeps", "CMake", "Libdl", "Parameters", "Test"]
git-tree-sha1 = "2b43d451639984e3571951cc687b8509b0a86c6d"
uuid = "d5fb7624-851a-54ee-a528-d3f3bac0b4a0"
version = "0.2.2"
=======
>>>>>>> opencv3.4.x

I don't recall if I was messing with this package and git (doubt it), and didn't see the same here (possibly from the other OpenCV. This file is still proken, while I doubt the cause, since I decided to add the package in latest Julia.

archit120 commented 3 years ago

Why is there a opencv3.4.x? This package targets 4.5.2 only. I'm not sure I understand what you mean.

PallHaraldsson commented 3 years ago

Ignore that, that was I believe only in Julia 1.6, and only I guess for other OpenCV, not yours.

Despite trying: mv /home/pharaldsson_sym/.julia/packages/OpenCV/XvJPQ/ /home/pharaldsson_sym/.julia/packages/OpenCV/XvJPQ_invalid_manifest

I still got same error (for 1.8), and even with removing .julia folder first, so that is a problem for your package.

Note I'm using rather new (while not latest): Version 1.8.0-DEV.61 (2021-06-21) / |_'|||_'_| | Commit 7553ca13cc (22 days old master)

PallHaraldsson commented 3 years ago

I did also check 1.6, again on fresh .julia folder and now it works on v"1.6.0-rc2" (not on the older 1.6 I was using).

Still 1.8, and likely 1.7 are a problem. I don't have more time to look into that.

archit120 commented 3 years ago

I added nightly to the run config. It seems CxxWrap is failing which is a required dependency.

barche commented 2 years ago

This could be the issue here:

https://github.com/jump-dev/SDPA.jl/issues/34#issuecomment-1057457021

stemann commented 1 year ago

I guess this was fixed with #16, and https://github.com/JuliaPackaging/Yggdrasil/pull/5573.

CC: @ashwani-rathee

ashwani-rathee commented 1 year ago

Works on both 1.8 and 1.7, we can safely close this