PostgreSQL.jl icon indicating copy to clipboard operation
PostgreSQL.jl copied to clipboard

Completely broken on v0.6

Open essenciary opened this issue 7 years ago • 5 comments

Sadly, this package is now completely broken on 0.6 :(

I started patching it but got stuck at

ERROR: LoadError: LoadError: UndefVarError: _IO_FILE not defined
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:569
 [2] include(::String) at ./sysimg.jl:14
 [3] include_from_node1(::String) at ./loading.jl:569
 [4] eval(::Module, ::Any) at ./boot.jl:235
 [5] _require(::Symbol) at ./loading.jl:483
 [6] require(::Symbol) at ./loading.jl:398
while loading /Users/adrian/.julia/v0.6/PostgreSQL/src/libpq_interface.jl, in expression starting on line 4
while loading /Users/adrian/.julia/v0.6/PostgreSQL/src/PostgreSQL.jl, in expression starting on line 10

essenciary avatar Jun 26 '17 22:06 essenciary

const _IO_FILE = Void

might work, not sure

iamed2 avatar Jun 26 '17 22:06 iamed2

Where was _IO_FILE defined before? i.e. how did this code ever work? Or did you re-run Clang or something?

This is apparently used for C FILE* arguments, which are opaque pointers, so just Void should work.

A more basic issue, however is that libpq_interface.jl (the Clang-generated file) is picking up a whole bunch of C standard-library functions (fscanf, perror, etcetera) that you almost certainly don't need or want. Probably you just want to include the PQ* functions (PQuser etcetera) and filter out everything else.

stevengj avatar Jul 03 '17 17:07 stevengj

Current master works on 0.4.

It looks like libpq-fe.h includes stdio...maybe Clang.jl has an exclude list now. I ran it a very long time ago.

iamed2 avatar Jul 03 '17 18:07 iamed2

how did this code ever work

ccall used to be oddly permissive of invalid code in parts it didn't use or call

tkelman avatar Jul 03 '17 18:07 tkelman

Probably easiest to just manually trim the unnecessary functions from that file for now. It is not very long, and the API seems small enough to maintain the wrappers manually.

stevengj avatar Jul 03 '17 20:07 stevengj