NetBSD Problem Report #55900

From mlelstv@hoppa.1st.de  Thu Dec 31 14:28:28 2020
Return-Path: <mlelstv@hoppa.1st.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C51231A921F
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 31 Dec 2020 14:28:28 +0000 (UTC)
Message-Id: <20201231142747.08E30E@hoppa.1st.de>
Date: Thu, 31 Dec 2020 15:27:46 +0100 (CET)
From: mlelstv@serpens.de
Reply-To: mlelstv@serpens.de
To: gnats-bugs@NetBSD.org
Subject: go14 bootstrap timestamp issues
X-Send-Pr-Version: 3.95

>Number:         55900
>Category:       pkg
>Synopsis:       go14 bootstrap timestamp issues
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bsiegert
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 31 14:30:01 +0000 2020
>Closed-Date:    Sat Feb 20 13:55:18 +0000 2021
>Last-Modified:  Sat Feb 20 14:00:02 +0000 2021
>Originator:     Michael van Elst
>Release:        NetBSD 9.0_STABLE
>Organization:

>Environment:


System: NetBSD victory.netbsd.org 9.0_STABLE NetBSD 9.0_STABLE (GENERIC64) #5: Tue Oct 6 21:07:14 CEST 2020 mlelstv@gossam:/home/netbsd9/obj.evbarm64-el/home/netbsd9/src/sys/arch/evbarm/compile/GENERIC64 evbarm
Architecture: aarch64
Machine: evbarm
>Description:
Building go115 with the go14 bootstrap package fails when the
go14 bootstrap was installed from a binary package.

In that case go14 may try to partially rebuild itself, e.g.:

  go install runtime/pprof: open /usr/pkg/go14/pkg/netbsd_arm/runtime/pprof.a: permission denied

go determines if a library (.a file) is stale in relation to another
library by checking the timestamp of the file. The files need timestamps
that correspond to the dependencies of the libraries.

This works fine if go14 is installed from source as the files are built
and written in the correct order.

But installing go14 from a binary package fails because files aren't
extracted from the package in built order.

>How-To-Repeat:
Build go115 but install go14 from a binary package.
>Fix:
Teach go to either evaluate dependencies against sources or to
skip the self-rebuilding completely, in particular when it is
effectively installed read-only.

>Release-Note:

>Audit-Trail:
From: Michael van Elst <mlelstv@serpens.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/55900 go14 bootstrap timestamp issues
Date: Sun, 24 Jan 2021 12:27:03 +0100

 This patch seems to avoid the issue:

 RCS file: /cvsroot/pkgsrc/lang/go14/Makefile,v
 retrieving revision 1.23
 diff -p -u -r1.23 Makefile
 --- lang/go14/Makefile  20 Oct 2020 11:22:27 -0000      1.23
 +++ lang/go14/Makefile  24 Jan 2021 11:24:21 -0000
 @@ -15,7 +15,7 @@ COMMENT=      The Go programming language
  LICENSE=       modified-bsd

  WRKSRC=                ${WRKDIR}/go
 -USE_TOOLS+=    bash:run perl:run pax
 +USE_TOOLS+=    bash:run perl:run pax touch

  # uses ulimit -T
  BUILD_DEPENDS+=        bash>=4.2nb3:../../shells/bash
 @@ -88,5 +88,6 @@ do-install:
  	cd ${WRKSRC} && rm -rf .hgignore .hgtags pkg/obj
  	cd ${WRKDIR}/go && pax -rw * ${DESTDIR}${GOROOT_FINAL}
  	find ${DESTDIR}${GOROOT_FINAL} -name \*.orig -exec rm {} \;
 +	find ${DESTDIR}${GOROOT_FINAL} -type f -exec ${TOUCH} -r ${DESTDIR}${GOROOT_FINAL} {} \;

  .include "../../mk/bsd.pkg.mk"


 -- 
                                 Michael van Elst
 Internet: mlelstv@serpens.de
                                 "A potential Snark may lurk in every tree."

Responsible-Changed-From-To: pkg-manager->bsiegert
Responsible-Changed-By: nia@NetBSD.org
Responsible-Changed-When: Fri, 29 Jan 2021 08:59:53 +0000
Responsible-Changed-Why:
Over to maintainer


State-Changed-From-To: open->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sat, 20 Feb 2021 13:55:18 +0000
State-Changed-Why:
Patch applied, thank you!


From: "Benny Siegert" <bsiegert@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55900 CVS commit: pkgsrc/lang/go14
Date: Sat, 20 Feb 2021 13:54:46 +0000

 Module Name:	pkgsrc
 Committed By:	bsiegert
 Date:		Sat Feb 20 13:54:46 UTC 2021

 Modified Files:
 	pkgsrc/lang/go14: Makefile

 Log Message:
 go14: prevent spurious recompiles of standard library packages

 This touches all compiled std library files after installation, to avoid
 extra recompilations when a dependent package (most likely a newer Go
 release) is being built.

 Patch from mlelstv@ in PR pkg/55900.


 To generate a diff of this commit:
 cvs rdiff -u -r1.23 -r1.24 pkgsrc/lang/go14/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.