Created attachment 237849 [details] Full build log [As a side note: thanks for making this port, as a rather odd coincidence I was just sitting down yesterday evening to do the same thing, and a commit appeared as if by magic!] I find that the port fails to build due to what looks like a gettext related error. Steps I took to try and get a clean repro: ``` poudriere jail -c -vv -j clean -v 13.1-RELEASE -a amd64 # Because my puny server chokes if it tries to build llvm and rust at the same time. poudriere bulk -v -j clean lang/rust poudriere bulk -v -j clean database/postgresql-promscale tail -n 50 /usr/local/poudriere/data/logs/bulk/latest-per-pkg/postgresql14-promscale/0.7.0/131amd64-default.log ``` Results in the following failure message: ``` Compiling color-eyre v0.6.1 Compiling toml v0.5.9 Compiling bincode v1.3.3 Compiling plist v1.3.1 Compiling serde-xml-rs v0.5.1 Compiling serde_cbor v0.11.2 Compiling syntect v5.0.0 Compiling askama_shared v0.12.2 Compiling pgx-utils v0.4.5 (/wrkdirs/usr/ports/databases/postgresql-promscale/work/pgx/pgx-utils) Compiling askama_derive v0.11.2 Compiling askama v0.11.1 Compiling promscale v0.7.0 (/wrkdirs/usr/ports/databases/postgresql-promscale/work/promscale_extension-0.7.0) Compiling pgx-pg-sys v0.4.5 (/wrkdirs/usr/ports/databases/postgresql-promscale/work/pgx/pgx-pg-sys) Compiling pgx-macros v0.4.5 (/wrkdirs/usr/ports/databases/postgresql-promscale/work/pgx/pgx-macros) error: failed to run custom build command for `pgx-pg-sys v0.4.5 (/wrkdirs/usr/ports/databases/postgresql-promscale/work/pgx/pgx-pg-sys)` Caused by: process didn't exit successfully: `/wrkdirs/usr/ports/databases/postgresql-promscale/work/promscale_extension-0.7.0/target/release/build/pgx-pg-sys-f1210100d81f0f79/build-script-build` (exit status: 101) --- stdout cargo:rerun-if-env-changed=PGX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE cargo:rerun-if-changed=/wrkdirs/usr/ports/databases/postgresql-promscale/work/.pgx/config.toml cargo:rerun-if-changed=include/pg10.h cargo:rerun-if-changed=include/pg11.h cargo:rerun-if-changed=include/pg12.h cargo:rerun-if-changed=include/pg13.h cargo:rerun-if-changed=include/pg14.h cargo:rerun-if-changed=cshim/pgx-cshim.c cargo:rerun-if-changed=cshim/Makefile --- stderr manifest_dir=/wrkdirs/usr/ports/databases/postgresql-promscale/work/pgx/pgx-pg-sys shim_src=/wrkdirs/usr/ports/databases/postgresql-promscale/work/pgx/pgx-pg-sys/cshim shim_dst=/wrkdirs/usr/ports/databases/postgresql-promscale/work/promscale_extension-0.7.0/target/release/build/pgx-pg-sys-1a211044f9af3881/out/cshim Generating bindings for pg14 /usr/local/include/postgresql/server/c.h:75:10: fatal error: 'libintl.h' file not found /usr/local/include/postgresql/server/c.h:75:10: fatal error: 'libintl.h' file not found, err: true thread 'main' panicked at 'Unable to generate bindings for pg14: ()', /wrkdirs/usr/ports/databases/postgresql-promscale/work/pgx/pgx-pg-sys/build.rs:530:13 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... gmake[1]: *** [Makefile:99: package] Error 1 gmake[1]: Leaving directory '/wrkdirs/usr/ports/databases/postgresql-promscale/work/promscale_extension-0.7.0' *** Error code 2 Stop. make: stopped in /usr/ports/databases/postgresql-promscale =>> Cleaning up wrkdir ===> Cleaning for postgresql14-promscale-0.7.0 build of databases/postgresql-promscale | postgresql14-promscale-0.7.0 ended at Thu Nov 3 14:49:38 GMT 2022 build time: 00:03:03 !!! build failure encountered !!! ``` Full log attached. I did take a look in the build jail, and the gettext-runtime package was installed, and libintl.h was where it ought to be in /usr/local/include/. This github bug looks like it might be relevant: https://github.com/timescale/promscale_extension/issues/532 . I don't know much about rust, so don't have any bright ideas for debugging further.
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(-)