apache / arrow-nanoarrow

Helpers for Arrow C Data & Arrow C Stream interfaces
https://arrow.apache.org/nanoarrow
Apache License 2.0
149 stars 34 forks source link

fix: Fix Meson include directories #532

Closed WillAyd closed 1 week ago

WillAyd commented 2 weeks ago

Quick follow up to https://github.com/apache/arrow-nanoarrow/pull/508 - the array.c includes stopped working without this

FAILED: libnanoarrow.so.p/src_nanoarrow_array.c.o 
ccache cc -Ilibnanoarrow.so.p -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c99 -O0 -g -fPIC -MD -MQ libnanoarrow.so.p/src_nanoarrow_array.c.o -MF libnanoarrow.so.p/src_nanoarrow_array.c.o.d -o libnanoarrow.so.p/src_nanoarrow_array.c.o -c ../src/nanoarrow/array.c
../src/nanoarrow/array.c:23:10: fatal error: nanoarrow/nanoarrow.h: No such file or directory
   23 | #include "nanoarrow/nanoarrow.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
WillAyd commented 2 weeks ago

I think the current issue has to do with the bundler - is the current bundling script supposed to replace the "nanoarrow/" prefix in the include?

WillAyd commented 1 week ago

Yea we could also have Meson generated the file in src/nanoarrow instead of just src, with the downside that we would then be allowing #include <nanoarrow.h> imports again instead of always forcing #include <nanoarrow/nanoarrow.h>

paleolimbot commented 1 week ago

Got it! Generating in the source directory is fine, I was just curious 🙂

WillAyd commented 1 week ago

Ah sorry - should have been clearer in my previous comment that I mean ${CMAKE_CURRENT_BINARY_DIR}/src/nanoarrow

Meson is super strict about where files can be generated. I'm not sure it would let you ever create something in the source directory, but if it did you'd be fighting against Meson to make it work. CMake is obviously a lot more relaxed, but I think it still makes sense to avoid generating anything in the source directory