From owner-freebsd-ports@freebsd.org Mon Oct 17 03:56:35 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 325C4C11943 for ; Mon, 17 Oct 2016 03:56:35 +0000 (UTC) (envelope-from dewaynegeraghty@gmail.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0535E181D; Mon, 17 Oct 2016 03:56:34 +0000 (UTC) (envelope-from dewaynegeraghty@gmail.com) Received: by mail-io0-x231.google.com with SMTP id r30so175764796ioi.1; Sun, 16 Oct 2016 20:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2fcHyhE5lu6g4TrjTGaM37tH4wg1yX1RAUlrn1eVYyc=; b=sXoKaADNpeoZJ2xjJSnh/XjgTdjSML73zywshF9wv0QB82St3XNkRsl2wD0V5MhvCx Zcg/BXORh3yHLcOyJRxofEw0+HSSSyrVG2eG6nleXqHvZuwzzI89jZL7wxq8zlgrSuXL rQksJwddzrfoF4ZX6jKWPcHqSmrwK6Qnz2uFqsREYV3U6WDol9+0iZKTfkmcWDgblUJM WO6iG0cnwrsWcSINav9TStlAxKMI2H142NS0nd9bNv+ya8C85emBG+9Gntr7jzmwD5Ij ajsF+bkpBY1fWiLNABzkM2+uY7138rzB7JwrTwSgiZ5IYiLwyrRIQQbQA/PDzSwI8ASi H/wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2fcHyhE5lu6g4TrjTGaM37tH4wg1yX1RAUlrn1eVYyc=; b=k2o7HD5wbEFwsFoMHZmwj0Rd08Vp8uBmRjHuCDNnpOp1hLVM9o1uRj+nQ4xj1J+QBG /vhkKAd//KBxfJvQfdodmox8XL0Tz52vJFjEqC25hBwKIhZhK3jOm8uSDavYrJ9M2QdW gOWc/32eBrtfwID9nfwbQEQuWHELdCqA0WXaJb/d47OdyvL6EpDeezmlsFKSZmNH7FpR 04DHYv1MoTssvySs6xlB+6gQr8uv7UjhFgBbbh8fmKN7VYehC1R/dPOEDj4mNUyRTdHd ku8N1+EP4s9XJcK+1276aZTrQ4/N67Sg3uCDszD5+CFTWMD1AH9WIQCmfYhDVaUHnkVX 8+8Q== X-Gm-Message-State: AA6/9Rm7alt1Xs+pWjDVd4GvZ4q59o1unr517MYSC+bFBTZ3UWVunoCrNekiQP7OKlMsXxbdePkSczzKuMJQhg== X-Received: by 10.107.56.196 with SMTP id f187mr20726557ioa.105.1476676593976; Sun, 16 Oct 2016 20:56:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.27.139 with HTTP; Sun, 16 Oct 2016 20:56:03 -0700 (PDT) In-Reply-To: <053f7002-8195-c907-dfc7-c790a563da26@FreeBSD.org> References: <053f7002-8195-c907-dfc7-c790a563da26@FreeBSD.org> From: Dewayne Geraghty Date: Mon, 17 Oct 2016 14:56:03 +1100 Message-ID: Subject: Re: gcc5 dependency challenges To: Kubilay Kocak Cc: ports-list freebsd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 03:56:35 -0000 On 14 October 2016 at 21:22, Kubilay Kocak wrote: > On 14/10/2016 6:48 PM, Dewayne Geraghty wrote: > > After some rudimentary performance testing I note that we get up > > around 3% improvement in application performance when we use gcc5 for > > our package builds. > > > > However building ports with gcc results in gcc5 being a dependency. > > Examining ldd, we find that rarely does anything require gcc5's > > shared libs for their execution. Even simple things like ftp/wget > > and devel/ccache depend on gcc5 for building but NOT runtime. As we > > aren't allowed to install compilers onto production systems, what is > > the best course of action to address? (We could just install gcc5 and > > then remove it but then of course, the base pkg wants to remove > > everything (600+ packages) that depends on gcc5!) > > > > So the question is - how should we build our packages or install them > > so that gcc5 is not (unnecessarily) installed? > > > > We've added to our /etc/make.conf USE_GCC= 5 but I wonder if there's > > something like a build_depends mechanism? > > > > > > Background: Our FreeBSD 10.3 Stable uses pkg 1.8.3; whereas ports > > uses 1.8.7_3, minor point. > > > > Why gcc5? Well most ports use clang 3.4.1 to compile, some ports do > > use gcc 4.8.5; and if we move to FreeBSD11 then we also need to add > > llvm3.6 into the build/migrating equation. So to aid our migration > > effort we "think" choosing gcc5 now is a good idea; particularly as > > /usr/ports/base/gcc uses gcc 5.4.0 (rather than /usr/ports/lang/gcc > > which is 4.8.5) > > > > All production systems use local package repositories (as heimdal is > > widely used as are non-default options). > > > > Kind regards, Dewayne > > This (in progress thing) may help: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211154 > > See dependent Bugzilla issue: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211079 > > ./koobs > Kubilay, Thank-you very much for the pointers. I have appended the following to /usr/ports/Mk/bsd.port.mk .if defined(PRODUCTION_USE) # defined in make.conf :) RUN_DEPENDS:=${RUN_DEPENDS:Ngcc*} RUN_DEPENDS:=${RUN_DEPENDS:Npkg*} RUN_DEPENDS:=${RUN_DEPENDS:Nindexinfo*} .endif which has achieved the desired goal. So I've gone from a virgin system without gcc or binutils where: b1# pkg-static add /root/build/i386/portconf-1.6_1.txz [b1.hs] Installing portconf-1.6_1... [b1.hs] `-- Installing gcc5-5.4.0... [b1.hs] | `-- Installing binutils-2.27_4,1... [b1.hs] | | `-- Installing gcc5-5.4.0... [b1.hs] | | `-- Installing binutils-2.27_4,1... to b2# pkg-static add /root/build/amd64/portconf-1.6_1.txz [b2.hs] Installing portconf-1.6_1... [b2.hs] Extracting portconf-1.6_1: 100% (Note that portconf is a text script!) Julian, I agree with you. I have been using a similar approach for many years on our production boxes, essentially repackaging our packages to achieve the purpose that you require. (Note though I also use pkg 1.6.4 to install as the 1.8 series didn't work as it tried to do something to directories that didn't exist (I vaguely recall man page directories)). This is the kludge of excluded files to be repackaged by tar: cat << EOM > $EXCL man/man?/ include/* */man/man?/ share/doc/* share/examples/* */doc/html/ */doc/pdf/ /lib/edoc-* lib/erl_docgen* usr/local/share/doc/ usr/local/share/*/doc/ lib/*.a EOM Then walk through your packages and tar -cJp -X $EXCL --options='xz:compression-level=6' -f /packages-reduced/$P @${P} where P is the package (eg wget-1.18.txz) Kind regards, Dewayne.