Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 177211

Summary: emerge says "xargs: chmod: Argument list too long"
Product: Portage Development Reporter: Björn <karge>
Component: Core - Ebuild SupportAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS, REGRESSION
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 172589    
Attachments: use chmod -R to reduce the size of the argument list

Description Björn 2007-05-05 17:30:30 UTC
emerge aborts with an error, saying "xargs: chmod: Argument list too long".
I encountered the error after `emerge /dev-lang/fpc-2.0.4`.
I am not quite sure, whether this is related to the ebuild or not, because I could fix this by patching portage_data.py (see "Additional Information").
So maybe this is related to a bug in xargs?

Reproducible: Always

Steps to Reproduce:
emerge /dev-lang/fpc-2.0.4 (indirectly requires findutils-4.3.0)



An ugly workaround is to patch Portage in /usr/lib/portage/pym/portage_data.py:
< os.environ["XARGS"]="xargs -r"
> os.environ["XARGS"]="xargs -r -s 20000"

The error is triggered by a find statement in Portage's ebuild.sh:

 find . -mindepth 1 ! -type l -print0 | ${XARGS} -0 chmod -f a+rX,u+w,g-w

though, IMHO, this looks fine. So my guess is, xargs and chmod somehow don't match anymore (dev-lang/fpc-2.0.4 forced an update to findutils-4.3.2).
Comment 1 Zac Medico gentoo-dev 2007-05-05 18:13:27 UTC
Created attachment 118268 [details, diff]
use chmod -R to reduce the size of the argument list

This is fixed in svn r6479:6481.
Comment 2 Björn 2007-05-06 11:48:51 UTC
I'm not sure, whether this patch induces a new, more severe bug, as chmod also changes the attributes of links. 

This is what the ! -type l probably was good for in the original version.

Now, the find is excluding only the links in the top level directory, giving way to chmod of links in subdirectories.
Comment 3 Zac Medico gentoo-dev 2007-05-06 15:42:10 UTC
According to the chmod man page, "chmod ignores symbolic links encountered during recursive directory traversals".  We've used that in the past without any problems, so I'm sure it's fine.  You'll get a sandbox violation if it's not.
Comment 4 Zac Medico gentoo-dev 2007-05-07 03:33:41 UTC
This has been released in 2.1.2.7.