From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#25752: go incremental builds broken Date: Tue, 07 Mar 2017 22:50:00 +0100 Message-ID: <87fuiorc3b.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clN0d-0003Zf-LH for bug-guix@gnu.org; Tue, 07 Mar 2017 16:51:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clN0Z-00035a-5l for bug-guix@gnu.org; Tue, 07 Mar 2017 16:51:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:46912) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1clN0Y-00034t-NC for bug-guix@gnu.org; Tue, 07 Mar 2017 16:51:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1clN0Y-0006mA-Eo for bug-guix@gnu.org; Tue, 07 Mar 2017 16:51:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: (Hank Donnay's message of "Thu, 16 Feb 2017 10:05:27 -0500") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Hank Donnay Cc: 25752@debbugs.gnu.org Hello, Hank Donnay skribis: > The function for determining staleness is here (after the giant > comment explaining the reasoning): > https://golang.org/src/cmd/go/pkg.go#L1111 This method relies on the build ID to, which is defined like this (info "(ld) Options"): `--build-id' `--build-id=3DSTYLE' Request the creation of a `.note.gnu.build-id' ELF note section or a `.buildid' COFF section. The contents of the note are unique bits identifying this linked file. STYLE can be `uuid' to use 128 random bits, `sha1' to use a 160-bit SHA1 hash on the normative parts of the output contents, `md5' to use a 128-bit MD5 hash on the normative parts of the output contents, or `0xHEXSTRING' to use a chosen bit string specified as an even number of hexadecimal digits (`-' and `:' characters between digit pairs are ignored). If STYLE is omitted, `sha1' is used. The `md5' and `sha1' styles produces an identifier that is always the same in an identical output file, but will be unique among all nonidentical output files. It is not intended to be compared as a checksum for the file's contents. A linked file may be changed later by other tools, but the build ID bit string identifying the original linked file does not change. Passing `none' for STYLE disables the setting from any `--build-id' options earlier on the command line. I suppose Go uses one of md5 or sha1, which is a good thing since it allows for reproducible builds. However, grafting breaks this, similarly to since they change file contents without recomputing the build ID. Having Go use --build-id=3Duuid would work around the problem, but it would also prevent bit-reproducible builds. Perhaps our grafting code will have to handle .note.gnu.build-id specially. Thoughts? Thanks for reporting the issue, Ludo=E2=80=99.