NetBSD Problem Report #49561

From mrg@eterna.com.au  Mon Jan 12 22:43:35 2015
Return-Path: <mrg@eterna.com.au>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 926ADA6552
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 12 Jan 2015 22:43:35 +0000 (UTC)
Message-Id: <20150112224328.3A135B37E@splode.eterna.com.au>
Date: Tue, 13 Jan 2015 09:43:28 +1100 (EST)
From: mrg@eterna.com.au
Reply-To: mrg@eterna.com.au
To: gnats-bugs@gnats.NetBSD.org
Subject: PKGSRC_LOCKTYPE does not work with package-install target
X-Send-Pr-Version: 3.95

>Number:         49561
>Category:       pkg
>Synopsis:       PKGSRC_LOCKTYPE does not work with package-install target
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 12 22:45:00 +0000 2015
>Closed-Date:    
>Last-Modified:  Wed Apr 05 09:18:12 +0000 2017
>Originator:     matthew green
>Release:        pkgsrc-current
>Organization:
people's front against (bozotic) www (softwar foundation)
>Environment:
System: NetBSD phat-bass.eterna23.net 7.99.4 NetBSD 7.99.4 (_phat_) #13: Sun Jan 11 03:47:29 PST 2015  mrg@xotica.eterna23.net:/var/obj/i386/usr/src7/sys/arch/i386/compile/_phat_ i386
Architecture: i386
Machine: i386
>Description:

	pkgsrc providesa "PKGSRC_LOCKTYPE" variable that i've had set
	to "sleep" ever since it was introduced.

	there seems to be new targets that are not under this lock and
	concurrent builds can stomp on each other.  i've seen this
	failure while attempting to both create or install a binary
	package using "make package-install".

	eg, one window shows:

=> Automatic manual page handling
=> Creating binary package /var/obj/pkgsrc/devel/cmake/work.phat-bass/.packages/cmake-3.0.2.tgz
mv: rename /var/obj/pkgsrc/devel/cmake/work.phat-bass/.packages/cmake-3.0.2.tmp.tgz to /var/obj/pkgsrc/devel/cmake/work.phat-bass/.packages/cmake-3.0.2.tgz: No such file or directory
*** Error code 1

Stop.
make[3]: stopped in /usr/pkgsrc/devel/cmake


	and in another window:

===> Install binary package of cmake-3.0.2
pkg_add: Failed to read from archive for cmake-3.0.2: Damaged tar archive
original MD5 checksum failed, not deleting: /usr/pkg/bin/cpack
[ ... ]

>How-To-Repeat:

	"make package-install" in two subdirs with a common dependancy
	target.  one or both of them may fail after the package is built
	but before it is packaged or installed.

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->obache
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Sat, 24 Jan 2015 09:14:11 +0000
Responsible-Changed-Why:
Probably my fault, missing acquire-lock/release-lock for stage-package-create.


From: "OBATA Akio" <obata@lins.jp>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/49561: PKGSRC_LOCKTYPE does not work with package-install
 target
Date: Sun, 25 Jan 2015 16:56:18 +0900

 Could you try with following patch?

 Index: package/package.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/package/package.mk,v
 retrieving revision 1.24
 diff -u -r1.24 package.mk
 --- package/package.mk  23 May 2013 13:18:56 -0000      1.24
 +++ package/package.mk  25 Jan 2015 07:55:12 -0000
 @@ -17,7 +17,6 @@
   _PACKAGE_TARGETS+=     replace
   .else
   _PACKAGE_TARGETS+=     stage-install
 -_PACKAGE_TARGETS+=     stage-package-create
   .endif
   _PACKAGE_TARGETS+=     acquire-package-lock
   _PACKAGE_TARGETS+=     ${_COOKIE.package}

From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: obache@NetBSD.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: re: pkg/49561: PKGSRC_LOCKTYPE does not work with package-install target
Date: Sun, 25 Jan 2015 20:24:59 +1100

 >  Could you try with following patch?
 >  
 >  Index: package/package.mk
 >  ===================================================================
 >  RCS file: /cvsroot/pkgsrc/mk/package/package.mk,v
 >  retrieving revision 1.24
 >  diff -u -r1.24 package.mk
 >  --- package/package.mk  23 May 2013 13:18:56 -0000      1.24
 >  +++ package/package.mk  25 Jan 2015 07:55:12 -0000
 >  @@ -17,7 +17,6 @@
 >    _PACKAGE_TARGETS+=     replace
 >    .else
 >    _PACKAGE_TARGETS+=     stage-install
 >  -_PACKAGE_TARGETS+=     stage-package-create
 >    .endif
 >    _PACKAGE_TARGETS+=     acquire-package-lock
 >    _PACKAGE_TARGETS+=     ${_COOKIE.package}

 it might take me a week or two, but i will test this.  it's fairly
 easy to reproduce this problem so it should be easy to confirm it
 is a valid fix.

 thanks!


 .mrg.

Responsible-Changed-From-To: obache->pkg-manager
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Thu, 05 Feb 2015 06:06:30 +0000
Responsible-Changed-Why:
not interesting in pkgsrc framework anymore, back to roll account.


Responsible-Changed-From-To: pkg-manager->bsiegert
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Thu, 29 Oct 2015 19:52:24 +0000
Responsible-Changed-Why:


State-Changed-From-To: open->feedback
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Thu, 29 Oct 2015 19:52:24 +0000
State-Changed-Why:
Did you try the patch? Did it work?


State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 01 May 2016 05:30:22 +0000
State-Changed-Why:
mrg says it still happens. sigh


Responsible-Changed-From-To: bsiegert->pkg-manager
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Wed, 05 Apr 2017 09:18:12 +0000
Responsible-Changed-Why:
not going to work on this, realistically


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.