Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standard Linux paths to libpq.def #211

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

matobet
Copy link

@matobet matobet commented Sep 27, 2023

Add /usr/include and /usr/lib64 to compiler and linker options respectively.

This should cover majority of x64 linux systems.

Add `/usr/include` and `/usr/lib64` to compiler and linker options
respectively. This should cover majority of x64 linux systems.
@hfhbd
Copy link
Owner

hfhbd commented Sep 27, 2023

Can you please add a reason why do you need it? These paths are for development only, afaik.

@matobet
Copy link
Author

matobet commented Oct 1, 2023

@hfhbd Without this change the project doesn't build under Linux (Fedora 38, but I assume more Linux systems will also suffer from this).

@hfhbd hfhbd enabled auto-merge (squash) October 1, 2023 14:56
auto-merge was automatically disabled October 2, 2023 21:32

Head branch was pushed to by a user without write access

@matobet
Copy link
Author

matobet commented Oct 2, 2023

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...

@hfhbd hfhbd enabled auto-merge (squash) October 2, 2023 21:59
@hfhbd
Copy link
Owner

hfhbd commented Oct 2, 2023

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.

auto-merge was automatically disabled October 6, 2023 12:54

Head branch was pushed to by a user without write access

@matobet
Copy link
Author

matobet commented Oct 6, 2023

Another shot with a more narrow headerFilter

@Myshkouski
Copy link

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.

@hfhbd
Copy link
Owner

hfhbd commented Mar 3, 2024

@matobet I added some paths, do you need more?

@matobet
Copy link
Author

matobet commented Mar 4, 2024

@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)

@hfhbd
Copy link
Owner

hfhbd commented Mar 4, 2024

Okay, can you just update the PR? Thanks.

@matobet
Copy link
Author

matobet commented Mar 11, 2024

The tricky part here is to come up with such paths that make the project build both on fedora && on ubuntu (CI)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants