yeesian / ArchGDAL.jl

A high level API for GDAL - Geospatial Data Abstraction Library
https://yeesian.github.io/ArchGDAL.jl/stable/
Other
137 stars 25 forks source link

Precompile error in v0.10.3 #425

Closed evandjpl closed 1 month ago

evandjpl commented 1 month ago

My CI pipeline hit an error today while trying to precompile Julia libraries. Let me know if you need more info than this:

#17 6.069 ERROR: LoadError: UndefVarError: GDT_Int8 not defined
#17 6.743 Stacktrace:
#17 6.743   [1] eval
#17 6.743     @ ./boot.jl:368 [inlined]
#17 6.743   [2] eval
#17 6.743     @ ~/.julia/packages/ArchGDAL/SiT9o/src/ArchGDAL.jl:1 [inlined]
#17 6.743   [3] _broadcast_getindex_evalf
#17 6.743     @ ./broadcast.jl:670 [inlined]
#17 6.743   [4] _broadcast_getindex
#17 6.743     @ ./broadcast.jl:643 [inlined]
#17 6.743   [5] getindex
#17 6.743     @ ./broadcast.jl:597 [inlined]
#17 6.743   [6] copyto_nonleaf!(dest::Vector{ArchGDAL.GDALDataType}, bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, typeof(ArchGDAL.eval), Tuple{Base.Broadcast.Extruded{Vector{Any}, Tuple{Bool}, Tuple{Int64}}}}, iter::Base.OneTo{Int64}, state::Int64, count::Int64)
#17 6.765     @ Base.Broadcast ./broadcast.jl:1055
#17 6.765   [7] copy
#17 6.765     @ ./broadcast.jl:907 [inlined]
#17 6.765   [8] materialize
#17 6.765     @ ./broadcast.jl:860 [inlined]
#17 6.765   [9] (::ArchGDAL.var"#1#5")(a::Expr)
#17 6.771     @ ArchGDAL ./none:0
#17 6.771  [10] iterate(g::Base.Generator{NTuple{16, Expr}, ArchGDAL.var"#1#5"}, s::Int64)
#17 6.772     @ Base ./generator.jl:47
#17 6.772  [11] var"@convert"(__source__::LineNumberNode, __module__::Module, args::Vararg{Any})
#17 6.807     @ ArchGDAL ~/.julia/packages/ArchGDAL/SiT9o/src/utils.jl:102
#17 6.807  [12] include(mod::Module, _path::String)
#17 6.807     @ Base ./Base.jl:419
#17 6.807  [13] include(x::String)
#17 6.808     @ ArchGDAL ~/.julia/packages/ArchGDAL/SiT9o/src/ArchGDAL.jl:1
#17 6.808  [14] top-level scope
#17 6.808     @ ~/.julia/packages/ArchGDAL/SiT9o/src/ArchGDAL.jl:17
#17 6.808  [15] include
#17 6.808     @ ./Base.jl:419 [inlined]
#17 6.808  [16] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
#17 6.820     @ Base ./loading.jl:1554
#17 6.820  [17] top-level scope
#17 6.820     @ stdin:1
#17 6.820 in expression starting at /root/.julia/packages/ArchGDAL/SiT9o/src/types.jl:279
#17 6.820 in expression starting at /root/.julia/packages/ArchGDAL/SiT9o/src/types.jl:279
#17 6.820 in expression starting at /root/.julia/packages/ArchGDAL/SiT9o/src/ArchGDAL.jl:1
#17 6.820 in expression starting at stdin:1
#17 7.046 ERROR: LoadError: Failed to precompile ArchGDAL [c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3] to /root/.julia/compiled/v1.8/ArchGDAL/jl_9J4XYe.

This is on Julia v1.8.

rafaqz commented 1 month ago

Ok looks like there should have been a lower bound on GDAL.jl /GDAL_jll to make sure we get the version where GDT_Int8 exists.

This may be annoying to fix, it needs a version yank but they're hard to get merged. If you really need this I suggest tracking down when Int8 support was added to GDAL.jl, fixing the versions to that and making a PR.

But it might easier to drop 1.8 instead.

visr commented 1 month ago

Instead of a yank I'd suggest just fixing the compat in the registry, and then also here. That isn't hard to get merged, but needs a manual merge request in the JuliaLang Slack in #pkg-registration. Had to do it recently for GDAL as well: https://github.com/JuliaRegistries/General/pull/105696

https://github.com/JuliaRegistries/General/?tab=readme-ov-file#who-can-approve-an-early-merge https://pkgdocs.julialang.org/v1/registries/#Registry-Compat.toml

Why do you think this is Julia 1.8 related?

rafaqz commented 1 month ago

It could be 1.8 related if some other dep lower bounds to 1.9 and forces older versions.

(Yes, compat bounds are probably the thing to change, although theres a lot of disagreement, e.g. the registry readme says to yank)

Anyway, main part is finding the GDAL/GDAL_jll version to pin

CNOT commented 1 month ago

So, tracking it down I found that GDAL 3.7 is where support for GDT_Int8 was added. https://gdal.org/development/rfc/rfc87_signed_int8.html https://github.com/OSGeo/gdal/issues/4002 And this is the commit that added support for GDAL 3.7 in GDAL.jl:

https://github.com/JuliaGeo/GDAL.jl/commit/cacab1aecb0fc5fd07e2c79ba0faebe7e0ebc2ec

Ronneesley commented 1 month ago

Same error here.

rafaqz commented 1 month ago

someone just needs to fix the GDAL versions in the registry for ArchGDAL

rafaqz commented 1 month ago

https://github.com/JuliaRegistries/General/pull/107486

Also note we are now likely to have conflicts with ImageMagick due to libgeotiff_jll deps.

Thats likely why running update is not removing this problem - mostly we cant install the latest GDAL. Not having ImageMagick in your environment should help.

visr commented 1 month ago

Should be fixed now https://github.com/JuliaRegistries/General/pull/107490 is merged.