openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
4.01k stars 3.49k forks source link

Perl package breaks compile #6844

Closed symgryph closed 4 years ago

symgryph commented 6 years ago

Compiling openwrt 18.06.01 with updated package feeds causes:

BAIL on perl package Can't load module List::Util, dynamic loading not available in this perl.
  (You may need to build a new perl executable which either supports
  dynamic loading or has the List::Util module statically linked into it.)
 at files/perlconfig.pl line 229.
Compilation failed in require at files/perlconfig.pl line 229.
BEGIN failed--compilation aborted at files/perlconfig.pl line 229.

Performing a 'perlectomy' in the packages directory fixes the problem, but I rather suspect that this isn't the solution most people want.

pprindeville commented 6 years ago

I'm going to need more information than this to reproduce.

symgryph commented 6 years ago

What info would you like? Happy to send.

symgryph commented 6 years ago

Here is os info: Darwin BattleStar.munnster.com 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

Using openwrt 18.06.01 (git checked out this version). I am attaching my config for your reference.

config.txt

ian700518 commented 6 years ago

@symgryph Hi~ I got the same problem, may you tell me how do you type 'perlectomy' to fixes this problem? Thanks~ But, I used openwrt lede version~

emotile commented 6 years ago

I do get the same error building on Darwin. The command in the build giving the problem is the following:

make[3]: Entering directory `/Volumes/OpenWrt/openwrt/feeds/packages/lang/perl'
make[3]: Leaving directory `/Volumes/OpenWrt/openwrt/feeds/packages/lang/perl'
time: package/feeds/packages/perl/host-compile#0.40#0.38#0.81
make[3]: Entering directory `/Volumes/OpenWrt/openwrt/feeds/packages/lang/perl'
rm -f /Volumes/OpenWrt/openwrt/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/perl/perl-5.28.0/.configured_*
rm -f /Volumes/OpenWrt/openwrt/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/stamp/.perl_installed
/Volumes/OpenWrt/openwrt/staging_dir/hostpkg/usr/bin/perl5.28.0 files/perlconfig.pl -Dowrt:target_cc='arm-openwrt-linux-muslgnueabi-gcc' -Dowrt:gccversion="7.3.0" -Dowrt:target_cross='arm-openwrt-linux-muslgnueabi-' -Dowrt:cflags='-Os -pipe -mcpu=cortex-a9 -mfpu=vfpv3-d16 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -I/Volumes/OpenWrt/openwrt/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/usr/include -I/Volumes/OpenWrt/openwrt/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/include -I/Volumes/OpenWrt/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-7.3.0_musl_eabi/usr/include -I/Volumes/OpenWrt/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-7.3.0_musl_eabi/include/fortify -I/Volumes/OpenWrt/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-7.3.0_musl_eabi/include' -Dowrt:ldflags='-L/Volumes/OpenWrt/openwrt/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/usr/lib -L/Volumes/OpenWrt/openwrt/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/lib -L/Volumes/OpenWrt/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-7.3.0_musl_eabi/usr/lib -L/Volumes/OpenWrt/openwrt/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-7.3.0_musl_eabi/lib -znow -zrelro' -Dowrt:libc="musl" -Dowrt:ipv6=undef -Dowrt:threads=yes -Dowrt:staging_dir='/Volumes/OpenWrt/openwrt/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi' -Dowrt:host_perl_prefix='/Volumes/OpenWrt/openwrt/staging_dir/hostpkg/usr' files/version.config files/base.config files/arm.config files/architecture.config files/signal.config files/threads.config files/libc.config files/misc.config > /Volumes/OpenWrt/openwrt/build_dir/target-arm_cortex-a9+vfpv3_musl_eabi/perl/perl-5.28.0/config.sh
emotile commented 6 years ago

And /Volumes/OpenWrt/openwrt/build_dir/hostpkg/perl/perl-5.28.0/config.sh contains an instruction that compiles perl statically.

pprindeville commented 6 years ago

@symgryph I just built openwrt-18.06 (also for x86_64/generic) and didn't have any problems.

I also note that the .config file that you've linked ends with:

# CONFIG_PACKAGE_perl is not set

so I'm confused that you're building it at all.

Also, packages is not tagged, so I'm not sure how you're matching that to base.

What happens when you build openwrt-18.06/MASTER against packages?

avrhack commented 6 years ago

I have exactly this issue too on macOS and CONFIG_PACKAGE_perl is not set but it still comes up with this error. Clearly something is broken in the build settings.

danielfdickinson commented 6 years ago

@pprindeville This can happen if there is a host build dependency on Perl but not a DEPENDS.

pprindeville commented 6 years ago

What would that look like?

danielfdickinson commented 6 years ago

I think either HOST_BUILD_DEPENDS:= or maybe HOST_DEPENDS:= ... not sure if BUILD_DEPENDS:= could be a factor too

danielfdickinson commented 6 years ago
$ grep -r HOST_BUILD_DEPENDS ../..
../../ola/Makefile:HOST_BUILD_DEPENDS:=protobuf/host
../../nfs-kernel-server/Makefile:HOST_BUILD_DEPENDS:=libtirpc/host
danielfdickinson commented 6 years ago
../../openvswitch/Makefile:PKG_BUILD_DEPENDS:=python/host python-six/host
../../ola/Makefile:PKG_BUILD_DEPENDS:=ola/host
../../seafile-ccnet/Makefile:PKG_BUILD_DEPENDS:=vala/host
../../lcdringer/Makefile:PKG_BUILD_DEPENDS:=vala
../../xtables-addons/Makefile:PKG_BUILD_DEPENDS:=iptables
../../apcupsd/Makefile:PKG_BUILD_DEPENDS:=libgd
../../linknx/Makefile:PKG_BUILD_DEPENDS:=argp-standalone
../../softethervpn/Makefile:PKG_BUILD_DEPENDS:=softethervpn/host
../../subversion/Makefile:PKG_BUILD_DEPENDS:=apr-util
../../jool/Makefile:PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
../../seafile-server/Makefile:PKG_BUILD_DEPENDS:=vala/host libevhtp
../../addrwatch/Makefile:PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
../../geth/Makefile:PKG_BUILD_DEPENDS:=golang/host
../../mdnsresponder/Makefile:PKG_BUILD_DEPENDS:=libcap
../../nbd/Makefile:PKG_BUILD_DEPENDS:=glib2 gettext
../../nfs-kernel-server/Makefile:PKG_BUILD_DEPENDS:=$(PKG_NAME)/host
../../sysrepo/Makefile:PKG_BUILD_DEPENDS:=+SYSREPO_BINDINGS:swig/host
../../fastd/Makefile:PKG_BUILD_DEPENDS:=nacl
../../xl2tpd/Makefile:PKG_BUILD_DEPENDS:=libpcap
../../vnstat/Makefile:PKG_BUILD_DEPENDS:=libgd
../../ulogd/Makefile:PKG_BUILD_DEPENDS:=libnetfilter-acct libnetfilter-conntrack libnetfilter-log
../../bind/Makefile:  PKG_BUILD_DEPENDS += libxml2
../../bind/Makefile:  PKG_BUILD_DEPENDS += libjson-c
../../snort/Makefile:PKG_BUILD_DEPENDS:=libtirpc
../../chrony/Makefile:PKG_BUILD_DEPENDS:=pps-tools
../../rp-pppoe/Makefile:PKG_BUILD_DEPENDS:=ppp
../../iotivity/Makefile:PKG_BUILD_DEPENDS:=boost
../../ncp/Makefile:PKG_BUILD_DEPENDS:=libowfat
../../opentracker/Makefile:PKG_BUILD_DEPENDS:=libowfat
../../samba4/Makefile:PKG_BUILD_DEPENDS:=SAMBA4_SERVER_AD_DC:python-crypto nfs-kernel-server/host
../../knxd/Makefile:PKG_BUILD_DEPENDS:=argp-standalone

That's just the 'net' dir

danielfdickinson commented 6 years ago

so net doesn't seem to have that problem for perl....let's see what does...

Hmmm.... so far only things in perl dir (unless you count stuff in base that has conditional dependencies on Perl for if you build with extra features).

Doesn't look like there's anything in the packages repo that fits the bill....wonder if Freeswitch in telephony is one of them.

danielfdickinson commented 6 years ago

xtables-addons has some kind of perl dependency if you look at tmp/.packagedeps

danielfdickinson commented 6 years ago

Ah! yeah if a package DEPENDS on another package for a subpackage (in this case iptgeoip depends on perl) the dependency gets built even if the subpackage is not selected and the dependency is not actually active in .config. It's because buildroot doesn't know if a dependency is need to build even if the binary package is not being created or not.

danielfdickinson commented 6 years ago

That is one of those discoveries that I keep fogetting about....

danielfdickinson commented 6 years ago

Oh, and just found this:

./repos/feeds/packages/net/samba4/Makefile:PKG_BUILD_DEPENDS:=perl/host python/host qemu-userspace/host SAMBA4_SERVER_AD_DC:python-crypto
danielfdickinson commented 6 years ago

Upshot; you can't depend on CONFIG_perl and friends to know if you need to do something or not.

symgryph commented 6 years ago

Dumb question: How do I fix? I am trying 'master' now to see. I am relatively new to openwrt. I would even make a 'faq' on how to 'fix' perl problems!

symgryph commented 6 years ago

I did find a less permanaent option that seems to make openwrt compile, just go in to package/feeds/packages/xtables-addons edit the makefile and remove the -depends perl stuff. Seems to compile, still doesn't fix the perl things though!

pprindeville commented 6 years ago

Upshot; you can't depend on CONFIG_perl and friends to know if you need to do something or not.

@cshoredaniel So what's the fix?

pprindeville commented 6 years ago

Try this PR https://github.com/openwrt/packages/pull/6984 and let me know if that fixes your problem.

judepereira commented 6 years ago

@pprindeville No, that doesn't fix it. I applied the patch locally to test.

jpc commented 6 years ago

The update to perl 5.28 (commit c875de62b36cb0ae6458ff1b2f094a869170d12c) broke building on mac OS.

pprindeville commented 6 years ago

I’ll need someone to come up with a fix. I don’t have OS X set up to build OpenWrt.

judepereira commented 6 years ago

@pprindeville Could you describe the problem? I can try to fix it.

pprindeville commented 6 years ago

@judepereira I'm not experiencing the problem, as I don't build under OS X. I'd ask @symgryph, @emotile, or @ian700518.

ian700518 commented 6 years ago

BAIL on perl package Can't load module List::Util, dynamic loading not available in this perl. (You may need to build a new perl executable which either supports dynamic loading or has the List::Util module statically linked into it.) at files/perlconfig.pl line 229. Compilation failed in require at files/perlconfig.pl line 229. BEGIN failed--compilation aborted at files/perlconfig.pl line 229.

my problem like this, I compiled on openwrt lede and openwrt 18.06, and got the same problem. my Mac OS X version is 10.13.6 and Xcode-select version is 2349

locojohn commented 6 years ago

I have exactly the same issue as the above poster. And I am pretty certain this error is related with collectd stuff. Please could anyone look into this and provide a fix?

/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/hostpkg/usr/bin/perl5.28.0 files/perlconfig.pl -Dowrt:target_cc='arm-openwrt-linux-muslgnueabi-gcc' -Dowrt:gccversion="7.3.0" -Dowrt:target_cross='arm-openwrt-linux-muslgnueabi-' -Dowrt:cflags='-O2 -pipe -mcpu=cortex-a9 -mfpu=vfp3 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -I/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/include -I/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/usr/include -I/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/include/fortify -I/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/include' -Dowrt:ldflags='-L/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib -L/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lib -L/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/usr/lib -L/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-7.3.0_musl_eabi/lib -znow -zrelro' -Dowrt:libc="musl" -Dowrt:ipv6=undef -Dowrt:threads=no -Dowrt:staging_dir='/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi' -Dowrt:host_perl_prefix='/Volumes/OpenWrt/NETGEAR_R7800/staging_dir/hostpkg/usr' files/version.config files/base.config files/arm.config files/architecture.config files/signal.config files/threads.config files/libc.config files/misc.config > /Volumes/OpenWrt/NETGEAR_R7800/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/perl/perl-5.28.0/config.sh Can't load module List::Util, dynamic loading not available in this perl. (You may need to build a new perl executable which either supports dynamic loading or has the List::Util module statically linked into it.) at files/perlconfig.pl line 229. Compilation failed in require at files/perlconfig.pl line 229. BEGIN failed--compilation aborted at files/perlconfig.pl line 229. make[3]: *** [/Volumes/OpenWrt/NETGEAR_R7800/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/perl/perl-5.28.0/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 255 make[3]: Leaving directory/Volumes/OpenWrt/NETGEAR_R7800/feeds/packages/lang/perl' `

tony-gutierrez commented 5 years ago

same prob.

tony-gutierrez commented 5 years ago

https://metacpan.org/pod/distribution/perl/pod/perlembed.pod#Using-Perl-modules,-which-themselves-use-C-libraries,-from-your-C-program

jpc commented 5 years ago

I managed to isolate the bug and fix it. It was an upstream regression in Perl 5.28 so I hope to get it merged upstream as well (see #9791 in the mean time).

royujjal commented 2 years ago

Sub-package compiling dependent package can be stopped by using this change in net/xtables-addons/Makefile under sub-package DEPENDS: define Package/iptgeoip: - +perl + +PACKAGE_iptgeoip:perl