Bug 237904 - devel/p5-Locale-libintl: build failure
Summary: devel/p5-Locale-libintl: build failure
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Sunpoet Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-15 07:11 UTC by oz42
Modified: 2020-03-27 16:06 UTC (History)
3 users (show)

See Also:
dinoex: maintainer-feedback+


Attachments
Failed build log without symlink (15.27 KB, text/plain)
2019-05-16 01:41 UTC, Laurence 'GreenReaper' Parry
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description oz42 2019-05-15 07:11:52 UTC
'make' stops here:

Installing /usr/ports/devel/p5-Locale-libintl/work/stage/usr/local/lib/perl5/site_perl/man/man3/Locale::RecodeData::_Encode.3
Installing /usr/ports/devel/p5-Locale-libintl/work/stage/usr/local/lib/perl5/site_perl/man/man3/Locale::libintlFAQ.3
/usr/bin/strip /usr/ports/devel/p5-Locale-libintl/work/stage/usr/local/lib/perl5/site_perl/mach/5.28/auto/Locale/gettext_xs/gettext_xs.so
strip: open /usr/ports/devel/p5-Locale-libintl/work/stage/usr/local/lib/perl5/site_perl/mach/5.28/auto/Locale/gettext_xs/gettext_xs.so failed: No such file or directory


Obviously there is something missing:

# ls -l /usr/ports/devel/p5-Locale-libintl/work/stage/usr/local/lib/perl5/site_perl/mach/5.28/auto
total 12
drwxr-xr-x  3 root  wheel  512 May 15 09:09 ./
drwxr-xr-x  3 root  wheel  512 May 15 09:09 ../
drwxr-xr-x  2 root  wheel  512 May 15 09:09 libintl-perl/
Comment 1 Laurence 'GreenReaper' Parry 2019-05-16 01:40:29 UTC
I imagine because the build of gettext_xs.o is failing?

After upgrading to Perl 5.28 on FreeBSD 11.2, I rebuilt all dependent ports:
nice portupgrade -f `pkg shlib -qR libperl.so.5.24`

The only one to fail was devel/p5-Locale-libintl as described by another person:
https://shaunc.com/blog/article/resolving-fatal-error-libintl.h-file-not-found-build-error-from-p5localelibintl-on-freebsd~qFMWw-OsTL4X

when manually updating with:
nice portupgrade -f devel/p5-Locale-libintl

I ended up with:
gettext_xs.xs:25:10: fatal error: 'libintl.h' file not found

It can be worked around with:
ln -s /usr/local/include/libintl.h /usr/include/libintl.h
Comment 2 Laurence 'GreenReaper' Parry 2019-05-16 01:41:41 UTC
Created attachment 204396 [details]
Failed build log without symlink
Comment 3 Sunpoet Po-Chuan Hsieh freebsd_committer 2019-05-25 15:38:17 UTC
I cannot reproduce this failure. The build log should looks like:

--- gettext_xs.o ---
cc -c    -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -O2 -pipe -fstack-protector -fno-strict-aliasing    -DVERSION=\"1.31\"  -DXS_VERSION=\"1.31\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.28/mach/CORE"   gettext_xs.c
--- pm_to_blib ---
cp gettext_xs.pm ../blib/lib/Locale/gettext_xs.pm
--- ../blib/arch/auto/Locale/gettext_xs/gettext_xs.bs ---
"/usr/local/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- gettext_xs.bs ../blib/arch/auto/Locale/gettext_xs/gettext_xs.bs 644
--- dynamic ---
--- linkext ---
--- subdirs ---
--- ../blib/arch/auto/Locale/gettext_xs/gettext_xs.so ---
rm -f ../blib/arch/auto/Locale/gettext_xs/gettext_xs.so
LD_RUN_PATH="/usr/local/lib" cc  -shared  -L/usr/local/lib/perl5/5.28/mach/CORE -lperl -L/usr/local/lib -fstack-protector-strong  gettext_xs.o  -o ../blib/arch/auto/Locale/gettext_xs/gettext_xs.so    -lintl -liconv
chmod 755 ../blib/arch/auto/Locale/gettext_xs/gettext_xs.so
Comment 4 Sunpoet Po-Chuan Hsieh freebsd_committer 2019-06-06 13:44:28 UTC
USES=localbase (added in r503457) should fix this PR.
Comment 5 Dirk Meyer freebsd_committer 2020-02-08 16:17:18 UTC
Still fails on a clean FreeBSD 12.1 amd64

cc -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DUSE_THREAD_SAFE_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -pthread -Wl,-E  -fstack-protector-strong -L/usr/local/lib -lpthread -lm -lcrypt -lutil -liconv -o gettest.exe gettest.c
gettest.c:4:10: fatal error: 'libintl.h' file not found
#include <libintl.h>
         ^~~~~~~~~~~

-I/usr/local/include is still missing.


1 error generated.

devel/p5-Locale-libintl# make -v CONFIGURE_ARGS
INSTALLDIRS="site" CC="cc" CCFLAGS="-O2 -pipe  -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing " LD="cc" PREFIX="/usr/local"  INSTALLPRIVLIB="/usr/local/lib" INSTALLARCHLIB="/usr/local/lib"


adding " -I/usr/local/include " to CONFIGURE_ARGS does not fix it.
btw CCFLAGS differ, are they not passed to the build?

Last successful build on FreeBSD 12.0:
Nov 21 18:09 /usr/ports/packages12-amd64/All/p5-Locale-libintl-1.31.txz
Comment 6 Sunpoet Po-Chuan Hsieh freebsd_committer 2020-02-26 14:37:40 UTC
(In reply to Dirk Meyer from comment #5)

I cannot reproduce the problem in a 12.1-RELEASE-p1 amd64 jail. See https://people.freebsd.org/~sunpoet/temp/p5-Locale-libintl-1.31.log

Did you test it in a clean poudriere jail?
Comment 7 Dirk Meyer freebsd_committer 2020-02-29 19:35:27 UTC
I cleaned out all old packages from 12.0
rebuilding all.

Tested in a clean jail with "make package"

no CCCACHE.

/etc/make.conf:
WRKDIRPREFIX?=  /data/image
PACKAGES?=      /usr/ports/packages12-amd64
USE_PACKAGE_DEPENDS?=yes
EXPLICIT_PACKAGE_DEPENDS=yes
DEPENDS_TARGET?=package install
DEPENDS_SHOW_FLAVOR?=yes

DEFAULT_VERSIONS=       ssl=openssl
OPTIONS_UNSET=PERL PYTHON ODBC CUPS
BATCH=yes

diff in Configure stage:
 ===>  Configuring for p5-Locale-libintl-1.31
 Checking whether we can compile the XS version ... no.
-  Trying again with -lintl ... yes.
-=> Building the XS version of libintl-perl.
+  Trying again with -lintl ... no.
+  Trying again with -lintl -liconv ... no.
+  Trying again with -liconv ... no.
+=> Cannot build the XS version of libintl-perl (see 'config.log' for
+=> details).  This is harmless!
 Checking if your kit is complete...
 Looks good
 Warning: NAME must be a package name
-Writing MYMETA.yml and MYMETA.json
 Generating a Unix-style Makefile
 Writing Makefile for libintl-perl
 Writing MYMETA.yml and MYMETA.json

according to:
/data/image/usr/ports/devel/p5-Locale-libintl/work/libintl-perl-1.31/config.log

the include was not found,
there is no -I/usr/localo/include passed.
Comment 8 Sunpoet Po-Chuan Hsieh freebsd_committer 2020-03-01 11:16:48 UTC
You have reported failure both in 12.1 (comment #5) and 12.0 (comment #7). I've tested 12.1 (comment #6). I'm testing 12.0 now.

Can you try again with empty make.conf? Let's test default settings first, then non-default settings, e.g. DEFAULT_VERSIONS=ssl=openssl.

BTW, why do you set non-default DEPENDS_TARGET explicitly? And EXPLICIT_PACKAGE_DEPENDS seems to be an outdated knob (for pkg_tools).
Comment 9 Sunpoet Po-Chuan Hsieh freebsd_committer 2020-03-01 11:46:22 UTC
It builds successfully in a newly-created poudriere jail.

% poudriere jail -l
JAILNAME VERSION          ARCH  METHOD TIMESTAMP           PATH
12x      12.0-RELEASE-p13 amd64 ftp    2020-03-01 18:59:04 /home/poudriere/jails/12x

% cat /usr/local/etc/poudriere.d/12x-make.conf
BATCH=yes
DEFAULT_VERSIONS=ssl=openssl
OPTIONS_UNSET=PERL PYTHON ODBC CUPS

I put the build log at https://people.freebsd.org/~sunpoet/temp/pr237904-12x-p5-Locale-libintl-1.31.log
Comment 10 Dirk Meyer freebsd_committer 2020-03-03 19:59:02 UTC
The problem is that perl5.30 fails in configure stage but continue with bad defaults.


good:
cflags.SH: ccflags  = -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H
-DUSE_THREAD_SAFE_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2

bad:
cflags.SH: ccflags  = -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DUSE_THREAD_SAFE_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2

the missing -I/usr/local/include causes this port to fail.

Thanks for looking into this. This PR can be closed again.