When installing DuckDB.jl
on windows, precompilation fails:
The issue is caused by failing precompilation of the DuckDB_jll binary.
Stacktrace
(@v1.11) pkg> add DuckDB
Updating registry at `C:\Users\dennis.bal\.julia\registries\General.toml`
Resolving package versions...
Installed DuckDB_jll ─ v1.1.2+0
Downloaded artifact: DuckDB
Updating `C:\Users\dennis.bal\.julia\environments\v1.11\Project.toml`
[d2f5444f] + DuckDB v1.1.0
Updating `C:\Users\dennis.bal\.julia\environments\v1.11\Manifest.toml`
[c3b6d118] + BitIntegers v0.3.2
[a10d1c49] + DBInterface v2.6.1
[d2f5444f] + DuckDB v1.1.0
[fb4d412d] + FixedPointDecimals v0.5.3
[842dd82b] + InlineStrings v1.4.2
[ea10d353] + WeakRefStrings v1.4.2
[2cbbab25] + DuckDB_jll v1.1.2+0
Precompiling project...
✗ DuckDB
189 dependencies successfully precompiled in 216 seconds. 151 already precompiled.
1 dependency errored.
For a report of the errors see `julia> err`. To retry use `pkg> precompile`
(@v1.11) pkg> precompile
Precompiling project...
✗ DuckDB
0 dependencies successfully precompiled in 6 seconds. 340 already precompiled.
ERROR: The following 1 direct dependency failed to precompile:
DuckDB
Failed to precompile DuckDB [d2f5444f-75bc-4fdf-ac35-56f514c445e1] to "C:\\Users\\dennis.bal\\.julia\\compiled\\v1.11\\DuckDB\\jl_1D62.tmp".
ERROR: LoadError: could not load symbol "duckdb_vector_size":
The specified procedure could not be found.
Stacktrace:
[1] duckdb_vector_size()
@ DuckDB C:\Users\dennis.bal\.julia\packages\DuckDB\8Gvy6\src\api.jl:715
[2] top-level scope
@ C:\Users\dennis.bal\.julia\packages\DuckDB\8Gvy6\src\database.jl:100
[3] include(mod::Module, _path::String)
@ Base .\Base.jl:557
[4] include(x::String)
@ DuckDB C:\Users\dennis.bal\.julia\packages\DuckDB\8Gvy6\src\DuckDB.jl:1
[5] top-level scope
@ C:\Users\dennis.bal\.julia\packages\DuckDB\8Gvy6\src\DuckDB.jl:28
[6] include
@ .\Base.jl:557 [inlined]
[7] 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, UInt128}}, source::Nothing)
@ Base .\loading.jl:2806
[8] top-level scope
@ stdin:4
in expression starting at C:\Users\dennis.bal\.julia\packages\DuckDB\8Gvy6\src\database.jl:100
in expression starting at C:\Users\dennis.bal\.julia\packages\DuckDB\8Gvy6\src\DuckDB.jl:1
in expression starting at stdin:
This issue is reported here. In that discussion, one user stated that installing the binary from the webpage and setting
ENV["JULIA_DUCKDB_LIBRARY"] = raw"C:\path\to\duckdb.dll"
fixed the issue. I can confirm that this indeed fixes the issue.
So to my mind, this means that the binary downloaded by the website is different from the binary built by Yggdrasil, the build-script for which is found here. I am unable to see if that build importantly differs from the official DuckDB build instructions, but I have a hunch that this is where the problem lies.
Is there anyone why can sniff out where the problem is? Given that the binary as downloaded from the webpage works, I suspect that this is an easy fix, and it would be nice if the package did not stay broken in windows forever if the fix is simple.