postgres-native-sqldelight
postgres-native-sqldelight copied to clipboard
Add standard Linux paths to libpq.def
Add /usr/include
and /usr/lib64
to compiler and linker options respectively.
This should cover majority of x64 linux systems.
Can you please add a reason why do you need it? These paths are for development only, afaik.
@hfhbd Without this change the project doesn't build under Linux (Fedora 38, but I assume more Linux systems will also suffer from this).
Not sure why the linuxArm64 build suddenly started failing (I have trouble cross-compiling linux_x64 to linux_arm64 on my system both before as well as after my change...) but perhaps moving the settings into platform-specific .linux_x64
sections will fix the CI failure...
I think the failures are caused to the fact the local usr/include
contains unrelated header files but the filter is set to *
allowing all headers.
Another shot with a more narrow headerFilter
Add
/usr/include
and/usr/lib64
to compiler and linker options respectively.
+1 and here the reasons why.
Can you please add a reason why do you need it? These paths are for development only, afaik.
These paths are also for both development of dependent projects and runtime as well because libpq-dev
provides dynamic (shared) libraries.
You might build a static native library instead, but your binary wouldn't be published with generated JARs, so other developers cannot use it as a dependency from Maven.
@matobet I added some paths, do you need more?
@hfhbd it seems on Fedora I still need to add -I/usr/include
since the libpq-devel
package installs the files there
/usr/bin/pg_config
/usr/include/libpq
/usr/include/libpq-events.h
/usr/include/libpq-fe.h
/usr/include/libpq/libpq-fs.h
/usr/include/pg_config-x86_64.h
/usr/include/pg_config.h
/usr/include/pg_config_ext-x86_64.h
/usr/include/pg_config_ext.h
/usr/include/pg_config_manual.h
/usr/include/pg_config_os.h
/usr/include/pgsql
/usr/include/pgsql/internal
/usr/include/pgsql/internal/c.h
/usr/include/pgsql/internal/fe-auth-sasl.h
/usr/include/pgsql/internal/libpq
/usr/include/pgsql/internal/libpq-int.h
/usr/include/pgsql/internal/libpq/pqcomm.h
/usr/include/pgsql/internal/port.h
/usr/include/pgsql/internal/postgres_fe.h
/usr/include/pgsql/internal/pqexpbuffer.h
/usr/include/postgres_ext.h
/usr/lib/.build-id
/usr/lib/.build-id/a8
/usr/lib/.build-id/a8/d9850aecf80d6f1207645fb9b1a67e0050cd49
/usr/lib64/libpq.so
/usr/lib64/pkgconfig/libpq.pc
(without the -I/usr/include
I get the fatal error: 'libpq-fe.h' file not found
error when executing the :postgres-native-sqldelight-driver:cinteropLibpqLinuxX64
task)
Okay, can you just update the PR? Thanks.
The tricky part here is to come up with such paths that make the project build both on fedora && on ubuntu (CI)...