From owner-freebsd-ports@FreeBSD.ORG Tue Aug 28 10:12:12 2012 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40FA0106566C; Tue, 28 Aug 2012 10:12:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 221708FC24; Tue, 28 Aug 2012 10:12:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7SACCs3052052; Tue, 28 Aug 2012 10:12:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7SACBUn052051; Tue, 28 Aug 2012 10:12:11 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Tue, 28 Aug 2012 12:12:09 +0200 From: Baptiste Daroussin To: Stefan Esser Message-ID: <20120828101209.GG64447@ithaqua.etoilebsd.net> References: <503BB682.5070108@freebsd.org> <503BD703.2020001@gmx.de> <20120827212331.GD64447@ithaqua.etoilebsd.net> <503C8C0F.2010302@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jt0yj30bxbg11sci" Content-Disposition: inline In-Reply-To: <503C8C0F.2010302@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: ohauer@gmx.de, freebsd-ports@FreeBSD.org Subject: Re: PKG_NG: pkg deinstall fails with "argument list too long" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 10:12:12 -0000 --jt0yj30bxbg11sci Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 28, 2012 at 11:14:55AM +0200, Stefan Esser wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > Am 27.08.2012 23:23, schrieb Baptiste Daroussin: > > On Mon, Aug 27, 2012 at 10:22:27PM +0200, olli hauer wrote: >=20 > Please do not hijack this thread, even if you are also reporting a > problem with PKG_NG. Threads are free and nobody bothered to reply > to the more urgent problem of the failed deinstallation. >=20 > >> On 2012-08-27 20:03, Stefan Esser wrote: > >>> PKG_NG seems to have introduced a limit on the size of ports > >>> that can be deinstalled: > >>>=20 > >>> # cd /usr/ports/math/lapack # make deinstall =3D=3D=3D> > >>> Deinstalling for math/lapack =3D=3D=3D> Deinstalling > >>> lapack-3.4.0_2 The following packages will be deinstalled: > >>>=20 > >>> lapack-3.4.0_2 > >>>=20 > >>> The deinstallation will free 28 MB Deinstalling > >>> lapack-3.4.0_2...lapack-3.4.0_2 is required by: qrupdate-1.1.1, > >>> deleting anyway pkg: Cannot run script(DEINSTALL): Argument > >>> list too long *** [deinstall] Error code 3 >=20 > I have located the line that is causing this error. It is the > posix_spawn on line 102 of libpkg/script.c. The argument length > is limited to KERN_ARGMAX (sysctl kern.argmax) which seems to > be a R/O value initialized to 256KB. >=20 > AFAICT this is not even a loader tuneable. A new kernel must > be built, or pkg must be modified to honor the argument length > limit. >=20 > The argument is the string argument of "sh -c ", which > can not be split in the general case. >=20 > In the specific case of math/lapack, the arguments to execve() > (called by posix_spawn()) are: >=20 > argv[0] =3D "sh" > argv[1] =3D "-c" > argv[2] =3D " set -- lapack-3.4.0_2 > rm -f /usr/local/man/cat3/INSTALL_ilaver.f.3.gz ... > /usr/local/man/cat3/zupmtr.f.3.gz.bz2" >=20 > The argument list must be broken into pieces of less than 256KB, > since rising KERN_ARGMAX to >330KB will lead to the same problem > with the next port with even longer PLIST. >=20 Thank you very much, this is already known and being worked on. btw the cat3 lines in plist do not longer exists in the ports tree, I remov= ed this ugly thing a while ago now. what will be done is keeping the currently behaviours if the script allows = it, and switch to the slower sh -s whan the script is longer. regards, Bapt --jt0yj30bxbg11sci Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlA8mXkACgkQ8kTtMUmk6EwgtwCgjBb/5dKVb5LvsYwDnrM9AY4r nPgAniF+4TVcMYdHFuQl7LGWLnVYcB7F =7Mfk -----END PGP SIGNATURE----- --jt0yj30bxbg11sci--