freebsd / portmaster

FreeBSD port management script without external databases or languages
80 stars 40 forks source link

portmaster -avDBGfR fails with 'Argument list too long' #61

Closed lantw44 closed 2 years ago

lantw44 commented 5 years ago

I have more than 2000 ports installed on this system, and it seems the problem is that portmaster exports too many data into environment variables. Adding --no-confirm can help sometimes because build_l isn't set, but it still fails after building a few ports.

===>>> All >> py27-MutatorMath-2.1.1 >> print/py-defcon@py27 (1486/1486)

===>>> Port directory: /usr/ports/print/py-defcon@py27

===>>> Launching 'make checksum' for print/py-defcon@py27 in background
===>>> Gathering dependency list for print/py-defcon@py27 from ports
===>>> Starting dependency check
===>>> Checking dependency: devel/py-setuptools@py27
/usr/local/sbin/portmaster: /usr/bin/make: Argument list too long
/usr/local/sbin/portmaster: rm: Argument list too long
===>>> The update for py27-setuptools-40.6.2 is already done

===>>> Checking dependency: lang/python27
===>>> The update for python27-2.7.15 is already done

===>>> Checking dependency: ports-mgmt/pkg
===>>> Checking dependency: print/py-fonttools@py27
/usr/local/sbin/portmaster: /usr/local/sbin/pkg-static: Argument list too long
===>>> Launching child to install print/py-fonttools@py27

===>>> All >> py27-MutatorMath-2.1.1 >> print/py-defcon@py27 >> print/py-fonttools@py27 (1487/1487)
/usr/local/sbin/portmaster: /usr/local/sbin/portmaster: Argument list too long

===>>> Update for print/py-fonttools@py27 failed
===>>> Aborting update

===>>> Update for print/py-defcon@py27 failed
===>>> Aborting update

===>>> Update for py27-MutatorMath-2.1.1 failed
===>>> Aborting update
stesser commented 2 years ago

This issue is due to a system limit (maximum size of the argument list), and should occur very rarely. While it might possible to work around such issues (e.g. using xargs and post-processing of results from multiple invocations of "make"), the effort required seems to be relatively high for such a rare case. I'd consider accepting a pull request (if it does not significantly increase the portmaster run-time or correctness of other features), but I'm not going to work out a solution (and I have never been affected by this issue). (If this issue is critical, enlarging the argument size limit on the system might be a possible work-around ...)