From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?VG9tw6HFoSDEjGVjaA==?= Subject: Re: reproducible builds and debugging information Date: Wed, 25 Mar 2015 01:33:52 +0100 Message-ID: <20150325003352.GA5247@venom> References: <20150322172632.GB3826@venom> <87zj72xftt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaZGZ-0003rg-Vj for guix-devel@gnu.org; Tue, 24 Mar 2015 20:33:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaZGW-0006Fu-Nh for guix-devel@gnu.org; Tue, 24 Mar 2015 20:33:51 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56645 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaZGW-0006Fo-E1 for guix-devel@gnu.org; Tue, 24 Mar 2015 20:33:48 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EA152ADAC for ; Wed, 25 Mar 2015 00:33:46 +0000 (UTC) Content-Disposition: inline In-Reply-To: <87zj72xftt.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 24, 2015 at 10:09:50PM +0100, Ludovic Court=C3=A8s wrote: >Tom=C3=A1=C5=A1 =C4=8Cech skribis: > >> As I was tracing curl code, I needed to rebuild the package with >> "-ggdb" in CFLAGS and enable debug among outputs. >> >> The later doesn't change the hash (and the generated code), but the >> first does. > >Both approaches change the output hash. (As soon as a bit changes in >the build process, the output hash changes.) > >Adding a =E2=80=9Cdebug=E2=80=9D output is nice because we have support to= automatically >DTRT (info "(guix) Installing Debugging Files"). For once I have read that and understood that before sending an email. Adding debug output is not nice because it changes the hash. >> So I'd like to propose to put "-ggdb" to generally applied CFLAGS for >> whole distribution. > >Packages that have an autoconf-based build system, and I suppose most >others, are built with -g. I can't confirm this statement. I added "debug" output to curl package: diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm index 821a957..996342a 100644 --- a/gnu/packages/curl.scm +++ b/gnu/packages/curl.scm @@ -74,6 +74,7 @@ ;; verbose. (zero? (system* "make" "-C" "tests" "test"))) %standard-phases))) + (outputs '("out" "debug")) (synopsis "Command line tool for transferring data with URL syntax") (description "curl is a command line tool for transferring data with URL syntax, =20 Rebuilt: /gnu/store/c2x7r38zkzf60vz02j7az7r847vy2sng-curl-7.40.0 /gnu/store/9gh88mgh68kxl38vyd42yc8i9v8fa449-curl-7.40.0-debug And GDB is complaining on the provided files: Reading symbols from /gnu/store/c2x7r38zkzf60vz02j7az7r847vy2sng-curl-7.40.= 0/bin/curl...Reading symbols from /gnu/store/9gh88mgh68kxl38vyd42yc8i9v8fa4= 49-curl-7.40.0-debug/lib/debug//gnu/store/c2x7r38zkzf60vz02j7az7r847vy2sng-= curl-7.40.0/bin/curl.debug...(no debugging symbols found)...done. (no debugging symbols found)...done. We have (hopefully) reproducible builds, you can see for yourself. After adding `-g' to CFLAGS: diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm index 821a957..d2bf4d9 100644 --- a/gnu/packages/curl.scm +++ b/gnu/packages/curl.scm @@ -60,7 +60,8 @@ ("pkg-config" ,pkg-config) ("python" ,python-2))) (arguments - `(#:configure-flags '("--with-gnutls" "--with-gssapi") + `(#:configure-flags '("--with-gnutls" "--with-gssapi" "CFLAGS=3D-g") + #:make-flags '("CFLAGS=3D-g") ;; Add a phase to patch '/bin/sh' occurances in tests/runtests.pl #:phases (alist-replace @@ -74,6 +75,7 @@ ;; verbose. (zero? (system* "make" "-C" "tests" "test"))) %standard-phases))) + (outputs '("out" "debug")) (synopsis "Command line tool for transferring data with URL syntax") (description "curl is a command line tool for transferring data with URL syntax, it worked as expected: (gdb) file /gnu/store/lz28mjhnddb91by1mq4bili35fm1dfyk-curl-7.40.0/bin/curl Reading symbols from /gnu/store/lz28mjhnddb91by1mq4bili35fm1dfyk-curl-7.40.= 0/bin/curl...Reading symbols from /gnu/store/ml1dlaqrc8kkrka6xbp7y85iwcjd3p= 6k-curl-7.40.0-debug/lib/debug///gnu/store/lz28mjhnddb91by1mq4bili35fm1dfyk= -curl-7.40.0/bin/curl.debug...done. >The binaries get stripped by default and >debugging info is lost unless the package has a =E2=80=9Cdebug=E2=80=9D ou= tput. OK, the difference -g and -ggdb is slight, but there is the problem with "debug" output. When package has output "debug" always - there is no problem. When package doesn't have "debug" output and I need it, mere adding output "debug" into package receipt will change the hash so I'll get different package. Better solution for this from my POV would be to keep information whether keep or drop debug output outside package receipt. Then `guix package -i curl:debug' could mean request to keep generated debug informations on disk. >Currently a few key packages have that, but most don=E2=80=99t (I think De= bian >does something similar, not sure about other distros.) On openSUSE you have available all the subpackage providing stripped debug informations and subpackage providing source code from the moment of build (so DWARF information in debug part can match the source). On Gentoo it's up to you. It's not in the default configuration, it's mentioned as recommended for debugging and QA purposes, but that is not exactly good example as every distribution is different so sharing corer dumps doesn't make sence. Gentoo gather all stripped files and IIRC it was posible to keep it compressed on disk and GDB still could use them... (Very nice, but yeah, it won't help hydra with disk space problem.) >We could make it opt-out rather than opt-in, but the issue is disk usage >on build machine (including end-user machines.) See >. > >Thoughts? If we have distribution of reproducible packages, we can keep it opt-in and generate debug information next time (by not dropping it). The only problematic packages will be the big ones like Webkit, Libre Office and similar because generating debug increases memory usage during the build significantly and may not be suitable for average personal computer. S_W --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlUSAm4ACgkQ37XrCapiVCOwnACfXP9tkGcRjTFP3Es/TiZ3s7QZ DpUAoM1igXjGbe6RyVIGmsWFSMoSQie4 =nxfT -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--