Summary: | databases/postgresql-promscale: Fails to build with "'libintl.h' file not found" | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Jony Hudson <bsd> | ||||||||||
Component: | Individual Port(s) | Assignee: | Mark Felder <feld> | ||||||||||
Status: | Closed FIXED | ||||||||||||
Severity: | Affects Some People | CC: | bsd, felix | ||||||||||
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(feld) |
||||||||||
Version: | Latest | ||||||||||||
Hardware: | Any | ||||||||||||
OS: | Any | ||||||||||||
Attachments: |
|
Description
Jony Hudson
2022-11-03 18:09:20 UTC
Oops, excuse me, quoted and attached the wrong log which is from a previous run building against pg14. The correct log looks much the same, and is attached. Created attachment 237850 [details]
Full build log against pg13
Created attachment 237852 [details]
Full build log against pg13
Apologies for the noise. This is really the correct log now, against pg13 in the "clean" jail, (I think they all have the same content though).
Stepping through the make and gmake steps with `-n` indicates that this is the command that generates the error: ``` /usr/bin/env MAKE=gmake PATH=/usr/local/libexec/ccache:/wrkdirs/usr/ports/databases/postgresql-promscale/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin:/wrkdirs/usr/ports/databases/postgresql-promscale/work/.cargo/bin XDG_DATA_HOME=/wrkdirs/usr/ports/databases/postgresql-promscale/work XDG_CONFIG_HOME=/wrkdirs/usr/ports/databases/postgresql-promscale/work XDG_CACHE_HOME=/wrkdirs/usr/ports/databases/postgresql-promscale/work/.cache HOME=/wrkdirs/usr/ports/databases/postgresql-promscale/work TMPDIR="/wrkdirs/usr/ports/databases/postgresql-promscale/work" PKG_CONFIG_LIBDIR=/wrkdirs/usr/ports/databases/postgresql-promscale/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local LOCALBASE=/usr/local CC="cc" CFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " CPP="cpp" CPPFLAGS="-I/usr/local/include" LDFLAGS=" -L/usr/local/lib -fstack-protector-strong " LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " MANPREFIX="/usr/local" CCACHE_DIR="/root/.ccache" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 0644" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" cargo pgx schema pg13 --force-create-or-replace --release > /dev/null ``` Perhaps the `CPPFLAGS="-I/usr/local/include"` somehow doesn't make its way through cargo? Thanks for reporting! I suspect I may have NLS disabled on the tree I built this against and forgot about it. Also, the real credit goes to the person who ported this to pkgsrc... they saved me a lot of headaches when I was going to give up tricking this thing into building without network access I'll see if I can get this error reproduced It looks like more credit is due to our colleague on pkgsrc! This patch looks relevant: https://github.com/NetBSD/pkgsrc/blob/trunk/databases/postgresql-promscale_extension/patches/patch-pgx_pgx-pg-sys_build.rs . If I manually edit /wrkdirs/usr/ports/databases/postgresql-promscale/work/pgx/pgx-pg-sys/build.rs in the middle of the broken build (in an interactive poudriere jail, that is), and add a line .clang_arg("-I/usr/local/include") below the existing .clang_arg(&format!("-I{}", includedir_server.display())) then it seems to build :-) It's well above my rust pay-grade to know whether that's a reasonable thing to do, but it seems to work. Created attachment 237910 [details]
Proposed patch
Here's a patch that fixes the error. I had to do some Makefile gymnastics to get the patch to apply to pgx. It's quite possible that there's a cleaner way to do that that I'm not aware of!
Just making the connection here that there's an upstream bug on pgx about this already. I've added a comment there with some thoughts: https://github.com/tcdi/pgx/issues/470#issuecomment-1304901237 tested, verified, and applied! Thanks! A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=2735159edc4ead9807d366b856ef26e546df849b commit 2735159edc4ead9807d366b856ef26e546df849b Author: Mark Felder <feld@FreeBSD.org> AuthorDate: 2022-11-08 15:47:47 +0000 Commit: Mark Felder <feld@FreeBSD.org> CommitDate: 2022-11-08 15:47:47 +0000 databases/postgresql-promscale: Fix build with NLS PR: 267550 databases/postgresql-promscale/Makefile | 6 +++++- databases/postgresql-promscale/files/pgx-include-patch (new) | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) |