Bug 175561

Summary: [patch] [bsd.pkgng.mk] Enhancement to avoid pkgng "/bin/sh: Argument list too long"
Product: Ports & Packages Reporter: Romain Tartière <romain>
Component: Ports FrameworkAssignee: Baptiste Daroussin <bapt>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: cs
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
bsd.pkgng.mk.diff none

Description Romain Tartière freebsd_committer freebsd_triage 2013-01-25 14:40:00 UTC
When trying to register a port with many dependencies (2141 ports in my case)
using pkgng, it fails with error:

===>   Registering installation for texlive-scheme-full-20110217,1
/bin/sh: Argument list too long
pkg: Invalid manifest format
*** [fake-pkg] Error code 74

Stop in /usr/ports/print/texlive-scheme-full.


The ${ACTUAL-PACKAGE-DEPENDS} generated snippet is too long and this result in
an invalid metadata file to be generated, thus making pkg fail a bit later.

In my case, ${_LIB_RUN_DEPENDS} is 204172 bytes long while the max commandline
length is 262144 bytes, there is therefore no much room for the rest of the
arguments.  However, the " " argument passed to `pkg query` prevent it from
failing if ${_LIB_RUN_DEPENDS} where empty, so the test to "protect" it against
that is useless.

Fix: The following patch helps avoiding this situation.
How-To-Repeat: 
One can get the TeXLive ports from
http://code.google.com/p/freebsd-texlive/

and try to install print/texlive-scheme-full with WITH_PKGNG=yes in
/etc/make.conf.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-01-25 14:40:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

bsd.pkgng.mk is portmgr territory (via the GNATS Auto Assign Tool)
Comment 2 Romain Tartière freebsd_committer freebsd_triage 2013-01-25 14:49:58 UTC
Responsible Changed
From-To: portmgr->bapt

I guess bapt will be interested in this.  Please reassign to somebody 
else if I am wrong. 

Thanks!
Comment 3 Carlo Strub freebsd_committer freebsd_triage 2014-09-11 20:06:59 UTC
Is this PR still relevant?
Comment 4 Baptiste Daroussin freebsd_committer freebsd_triage 2014-11-13 22:57:17 UTC
In theory it is but I never encounter the case when it can happen