-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
libintl.h file not found #470
Comments
Thanks for reporting this! Hmm... I don't currently have a freeBSD machine to reproduce this on. |
This is a bit of a drive-by, as I know almost nothing about rust, cargo, or pgx! But maybe it'll be helpful anyway ... I came across this error trying to build the databases/postgres-promscale extension on FreeBSD (https://cgit.freebsd.org/ports/tree/databases/postgresql-promscale). I've proposed a patch to "fix" it on this bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267550 . That's a patch to the promscale extension port, as it vendors in its own version of pgx. But I think the problem is a pgx problem rather than a promscale-specific problem. My best guess is that there's an assumption baked in to the pgx-pg-sys buildgen code that 'libintl.h' will be located in /usr/include. On FreeBSD it's by default in /usr/local/include because it ships as part of a package (devel/gettext-runtime) rather than as part of the base system. The location of this local include directory is included in an environment variable set by the ports make system, CPPFLAGS (you can see the full cargo command being executed by the ports make system, for the vendored pgx in the promscale extension, in this comment https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267550#c4 ). So, maybe it's possible that this flag isn't being read by the buildgen code, and so the include directory is not being flagged to clang? I did notice this commit 6aaad98 while poking around the source, which adds some extra clang flags on MacOS. Maybe something in a similar spirit is needed to support FreeBSD? Anyway, I may be off-base here - so take this with a pinch of salt - but maybe something in there helps. |
@JonyEpsilon That is not the right solution, and also it is not quite a PGX bug.
I have opened #940 to attempt to resolve this by directing bindgen to omit |
Ahh, interesting. Thanks for taking the time to write the explanation :-) If I remove the additional
(It should noted that this against the 0.7.0 release, which is what targeted by the FreeBSD port, not against HEAD.) I would speculate that something is trying to resolve the path to the file before the blocking is happening, but at this point I'm just making stuff up, as I've no idea how bindgen works! |
I'm getting this same message when trying to run |
You probably have to run Also note that we don't use the PostgreSQL you install globally except for a couple commands like package/install, so having installed it via brew doesn't really exempt you from these issues. (Also, if you don't have it set up, make sure you have XCode and the CommandLineTools package installed, and make sure you've opened XCode at least once since installing) |
I was running into the same issue on a Mac while trying to run
I was able to fix it by running |
It looks like this happens if you do Line 877 in c7b6fba
|
…1247) We should consider doing this on other targets too (I think technically we would be fine to always do this), but I'd rather not make a big change like that on the targets people use for production DBs, at least not without more testing (and possibly a escape hatch to opt out). This is for #470 and fixes it on macOS, but since the bug was reported on FreeBSD too, I'm not sure we should close it until it's done more broadly.
OS is FreeBSD. pgx is 0.4.0-beta-0. It seems to get pretty close to the end but then is missing a C header which would be in /usr/local.
cargo pgx init --pg13 pg_config
withpg_config
showing the correctINCLUDEDIR = /usr/local/include
The text was updated successfully, but these errors were encountered: