From owner-svn-ports-head@FreeBSD.ORG Fri Apr 4 08:58:11 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 6C86A966; Fri, 4 Apr 2014 08:58:11 +0000 (UTC) Date: Fri, 4 Apr 2014 08:58:11 +0000 From: Alexey Dokuchaev To: Baptiste Daroussin Subject: Stripping of binaries (Was: Re: svn commit: r350052 - head/Mk) Message-ID: <20140404085811.GA19897@FreeBSD.org> References: <201404032211.s33MBqWj021361@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404032211.s33MBqWj021361@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, ports-committers@freebsd.org X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 08:58:11 -0000 On Thu, Apr 03, 2014 at 10:11:52PM +0000, Baptiste Daroussin wrote: > New Revision: 350052 > URL: http://svnweb.freebsd.org/changeset/ports/350052 > QAT: https://qat.redports.org/buildarchive/r350052/ > > Log: > Prepend install(1) command with the STRIPBIN env defined to the proper > STRIPBIN to allow cross-installation I think it's good time to rethink our stripping policy/strategy at large, as it is kind of mess overall, and now I see the risk of it to become even more messy with introduction of cross-building. So, we have ports with their own `do-install' targets, and binaries are normally installed with INSTALL_(PROGRAM|LIB), which includes `-s' switch by default; passing STRIPBIN via env allows install(1) to call correct strip(1) in cross-case, right? Other ports deploy files through a vendor's routine, which can be anything, from install(1) to cp(1) or tar(1) or cpio(1). Some of them try to strip binaries during compilation; others do it on install, or may not do at all. I've recently started to notice that folks strip binaries in `post-install' target. Frankly, I don't understand 1) why it is being done this way, and 2) why it become so popular. It is not just ugly on its own, it is ugly on a much larger scale as it adds little, almost identical, imperative pieces of code to *a lot* of Makefiles. What makes me wonder even more, this is being done for staged ports! I propose that, instead of adding hacks for `-s' feature of install(1) we remove this switch completely from INSTALL_* knobs, and remove any manual STRIP_CMD's from ports' Makefile. Let the files in $STAGEDIR be unstripped, there is nothing wrong with it; moreover, staging allows precisely for any pre-package tuning, file cherry-picking, etc. Stripping should be done by pkg(8) when generating final package (perhaps subject to some NO_STRIP/NO_STRIP_FILES knob or something). This will also ensure that correct strip(1) binary will be called, without exposing it to install(1). It will also allow to consolidate stripping logic in one place instead of having it scattered around the whole Ports Tree. Makefiles should stay mostly declarative. Adding code there just does not look right upfront. ./danfe