NetBSD Problem Report #56597

From mlelstv@arnold.localdomain  Sat Jan  1 14:55:49 2022
Return-Path: <mlelstv@arnold.localdomain>
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 AE4781A923C
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  1 Jan 2022 14:55:49 +0000 (UTC)
Message-Id: <20220101145545.72C15BC141@arnold.localdomain>
Date: Sat,  1 Jan 2022 15:55:45 +0100 (CET)
From: mlelstv@netbsd.org
Reply-To: mlelstv@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: Deinstallation of compat90 destroys netbsd-9
X-Send-Pr-Version: 3.95

>Number:         56597
>Category:       pkg
>Synopsis:       Deinstallation of compat90 destroys netbsd-9
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    he
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 01 15:00:00 +0000 2022
>Closed-Date:    Sat Jun 10 17:37:44 +0000 2023
>Last-Modified:  Sat Jun 10 17:37:44 +0000 2023
>Originator:     mlelstv@netbsd.org
>Release:        NetBSD 9.99.85
>Organization:

>Environment:


System: NetBSD slowpoke 9.99.85 NetBSD 9.99.85 (SLOWPOKE) #13: Tue Jun 15 22:51:58 UTC 2021 mlelstv@slowpoke:/scratch2/obj.amd64/scratch/netbsd-current/src/sys/arch/amd64/compile/SLOWPOKE amd64
Architecture: x86_64
Machine: amd64
>Description:
Installation of the compat90 on netbsd-9 produces lots of errors since
netbsd-9 libraries already exist.

Deinstallation of the package then deletes the system libraries, leaving it
in a broken state.

This regularly happens when you run pbulk, the build system gets destroyed.
>How-To-Repeat:
Build or install compat90 on a netbsd-9 system.
>Fix:


>Release-Note:

>Audit-Trail:
From: "David H. Gutteridge" <david@gutteridge.ca>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56597 (Deinstallation of compat90 destroys netbsd-9)
Date: Sat, 01 Jan 2022 16:50:08 -0500

 The ONLY_FOR_PLATFORM setting includes 9.[012]; were there changes to
 the netbsd-9 branch that bumped shared library major versions? I'd be a
 bit surprised if that was the case. Seems more likely to be a copy-paste
 error from carrying over the compat80 package definitions?

 There were changes made to compat80 and then reverted because of this
 very issue of overwriting and removing content (in 9.x).

 Dave

Responsible-Changed-From-To: pkg-manager->he@NetBSD.org
Responsible-Changed-By: nia@NetBSD.org
Responsible-Changed-When: Sun, 02 Jan 2022 07:43:10 +0000
Responsible-Changed-Why:
Over to committer


From: Havard Eidnes <he@NetBSD.org>
To: gnats-bugs@netbsd.org, nia@NetBSD.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
 mlelstv@netbsd.org
Subject: Re: pkg/56597 (Deinstallation of compat90 destroys netbsd-9)
Date: Sun, 02 Jan 2022 15:34:14 +0100 (CET)

 That was .. unexpected.

 I see the submitter reports with 9.99.85.  By the looks of it,
 the compat90 package was generated against

 NetBSD 9.99.92 (GENERIC) #0: Fri Nov 12 15:12:11 UTC 2021

 Was there any major version bumps between 9.99.85 and 9.99.92?

 Hm, the package has (among others)

 ONLY_FOR_PLATFORM=3D      NetBSD-9.*-*

 but I also see (practical experience from a mistake I did earlier
 today) that the package can be installed on NetBSD 9.2.  How is
 that even possible?!?  And the above pattern doesn't match
 9.99.<x> either, I suppose?

 Perhaps the above pattern should have been NetBSD-9.99.*, but
 then again, the submitter reported 9.99.85 and still had the
 problem?  Also, 9.99.85 is not netbsd-9, so it's not entirely
 clear against which version this report is submitted.

 When I installed compat90 on NetBSD 9.2, I did notice that the
 installation noted that "target exists", perhaps unsurprisingly.

 Hm, seems like the +ROOT_ACTIONS script of the package, from
 ../compat_netbsd/INSTALL.ELF is responsible for managing the
 symlinks, it will not replace a file or preexisting symlink, but
 on de-install and the target was already a symlink, it will be
 summarily removed...  Perhaps the INSTALL.ELF script should as an
 added level of security verify that the symlink actually points
 to the intended target before removing it, instead of just
 testing whether it's a symlink, given the prevalent use of
 symlinks in shared library handling?

 So, can someone please explain what ONLY_FOR_PLATFORM should look
 like to prevent installation of this on netbsd-9, and possibly on
 any -current older than 9.99.92?

 A separate question is also why compat90 was deemed to be
 required on netbsd-9, presumably by other parts of pkgsrc?  That
 should not be needed AFAIK; there's not been any major shared lib
 bumps between 9.0 to 9.2 or even going to 9.2_STABLE.

 Regards,

 - H=E5vard

From: "Havard Eidnes" <he@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56597 CVS commit: pkgsrc/emulators/compat_netbsd
Date: Sun, 2 Jan 2022 16:15:55 +0000

 Module Name:	pkgsrc
 Committed By:	he
 Date:		Sun Jan  2 16:15:55 UTC 2022

 Modified Files:
 	pkgsrc/emulators/compat_netbsd: INSTALL.ELF

 Log Message:
 Don't just remove a symlink on removal, ensure that it points
 to an expected name before doing so.  Should prevent removal of
 required symlinks which might otherwise happen when this package
 by accident is instsalled and subsequently de-installed on
 9.0 - 9.2 or other netbsd-9 variants.
 Parts of fix for PR#56597.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/emulators/compat_netbsd/INSTALL.ELF

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

From: "Havard Eidnes" <he@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56597 CVS commit: pkgsrc/emulators/compat90
Date: Sun, 2 Jan 2022 16:22:32 +0000

 Module Name:	pkgsrc
 Committed By:	he
 Date:		Sun Jan  2 16:22:32 UTC 2022

 Modified Files:
 	pkgsrc/emulators/compat90: Makefile

 Log Message:
 Change the ONLY_FOR_PLATFORM pattern, so that it no longer matches
 against 9.0, 9.1, 9.2 or 9.x_STABLE, only 9.99.* and subsequent
 releses.  The set of libraries this is compared against is what's
 in 9.99.92, but the binaries are from 9.0, of course.

 Bump PKGREVISION so that we pick up the changes from
 compat_netbsd/INSTALL.ELF, to protect against removal of base system
 symlinks, ref. PR#56597.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/emulators/compat90/Makefile

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

From: Michael van Elst <mlelstv@serpens.de>
To: gnats-bugs@netbsd.org
Cc: he@NetBSD.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	mlelstv@netbsd.org
Subject: Re: pkg/56597 (Deinstallation of compat90 destroys netbsd-9)
Date: Sun, 2 Jan 2022 18:39:29 +0100

 On Sun, Jan 02, 2022 at 02:35:01PM +0000, Havard Eidnes wrote:

 >  I see the submitter reports with 9.99.85.  By the looks of it,
 >  the compat90 package was generated against

 The system runs 9.99.85, but the build runs in a netbsd-9 chroot
 with libkver pretending that this is a netbsd-9.0 system.

 The package Makefile also lets it build under netbsd-9.0 which
 doesn't make sense for a netbsd-9.0 compatibility package.

 I'm also confused about emulator.mk that tells:

 EMUL_DISTRO=            netbsd-9.99.82


 In any case, the package must not erase things it didn't install.
 The minimum should be to verify that the deinstallation removes
 symlinks to files installed by the package, not anything else
 under that name.


 N.B. the error doesn't occur on aarch64 and maybe other archs as
 the distfile checksum is bad.


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

From: nia <nia@NetBSD.org>
To: Havard Eidnes <he@NetBSD.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: pkg/56597 (Deinstallation of compat90 destroys netbsd-9)
Date: Sun, 2 Jan 2022 17:45:42 +0000

 On Sun, Jan 02, 2022 at 03:34:14PM +0100, Havard Eidnes wrote:
 > That was .. unexpected.
 > 
 > I see the submitter reports with 9.99.85.  By the looks of it,
 > the compat90 package was generated against
 > 
 > NetBSD 9.99.92 (GENERIC) #0: Fri Nov 12 15:12:11 UTC 2021
 > 
 > Was there any major version bumps between 9.99.85 and 9.99.92?
 > 
 > Hm, the package has (among others)
 > 
 > ONLY_FOR_PLATFORM=      NetBSD-9.*-*

 Shouldn't it be NOT_FOR_PLATFORM NetBSD-9?

 > A separate question is also why compat90 was deemed to be
 > required on netbsd-9, presumably by other parts of pkgsrc?  That
 > should not be needed AFAIK; there's not been any major shared lib
 > bumps between 9.0 to 9.2 or even going to 9.2_STABLE.

 It's built by pbulk since it's included in emulators/Makefile.
 Unfortunately builds of the pkgsrc stable branch are currently
 impossible on netbsd-9 due to this.  :/

From: "Benny Siegert" <bsiegert@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56597 CVS commit: [pkgsrc-2021Q4] pkgsrc/emulators
Date: Sun, 2 Jan 2022 17:51:08 +0000

 Module Name:	pkgsrc
 Committed By:	bsiegert
 Date:		Sun Jan  2 17:51:08 UTC 2022

 Modified Files:
 	pkgsrc/emulators/compat90 [pkgsrc-2021Q4]: Makefile distinfo
 	pkgsrc/emulators/compat_netbsd [pkgsrc-2021Q4]: INSTALL.ELF
 Added Files:
 	pkgsrc/emulators/compat90 [pkgsrc-2021Q4]: PLIST.earmeb PLIST.earmv6hf
 	    PLIST.earmv7hf PLIST.m68000
 Removed Files:
 	pkgsrc/emulators/compat90 [pkgsrc-2021Q4]: PLIST.armeb PLIST.armv6hf
 	    PLIST.armv7hf PLIST.m68010

 Log Message:
 Pullup ticket #6558 - requested by he
 emulators/compat90: fix for PR pkg/56597

 1) ensure that a symlink points the expected place before
    removing it on de-install (safety measure)
 2) change ONLY_FOR_PLATFORMS so that 9.[012] and _STABLE
    variants are excluded; insist on 9.99.* or later.

 Subsequently, adapt to pkglint warnings about EMUL_PLATFORMS
 member names.

 Revisions pulled up:
 - emulators/compat90/Makefile                                   1.2-1.3
 - emulators/compat90/PLIST.armeb                                deleted
 - emulators/compat90/PLIST.armv6hf                              deleted
 - emulators/compat90/PLIST.armv7hf                              deleted
 - emulators/compat90/PLIST.earmeb                               1.1
 - emulators/compat90/PLIST.earmv6hf                             1.1
 - emulators/compat90/PLIST.earmv7hf                             1.1
 - emulators/compat90/PLIST.m68000                               1.1
 - emulators/compat90/PLIST.m68010                               deleted
 - emulators/compat90/distinfo                                   1.3
 - emulators/compat_netbsd/INSTALL.ELF                           1.3

 ---
    Module Name:	pkgsrc
    Committed By:	he
    Date:		Sun Jan  2 16:15:55 UTC 2022

    Modified Files:
    	pkgsrc/emulators/compat_netbsd: INSTALL.ELF

    Log Message:
    Don't just remove a symlink on removal, ensure that it points
    to an expected name before doing so.  Should prevent removal of
    required symlinks which might otherwise happen when this package
    by accident is instsalled and subsequently de-installed on
    9.0 - 9.2 or other netbsd-9 variants.
    Parts of fix for PR#56597.

 ---
    Module Name:	pkgsrc
    Committed By:	he
    Date:		Sun Jan  2 16:22:32 UTC 2022

    Modified Files:
    	pkgsrc/emulators/compat90: Makefile

    Log Message:
    Change the ONLY_FOR_PLATFORM pattern, so that it no longer matches
    against 9.0, 9.1, 9.2 or 9.x_STABLE, only 9.99.* and subsequent
    releses.  The set of libraries this is compared against is what's
    in 9.99.92, but the binaries are from 9.0, of course.

    Bump PKGREVISION so that we pick up the changes from
    compat_netbsd/INSTALL.ELF, to protect against removal of base system
    symlinks, ref. PR#56597.

 ---
    Module Name:	pkgsrc
    Committed By:	he
    Date:		Sun Jan  2 16:35:12 UTC 2022

    Modified Files:
    	pkgsrc/emulators/compat90: Makefile

    Log Message:
    Adjust EMUL_PLATFORMS to pkglint's liking:
    armeb -> earmeb
    armv6hf -> earmv6hf
    armv7hf -> earmv7hf
    m68010 -> m68000
    Compat symlinks created in distfile repository.
    Riding on the quite recent PKGREVISION bump.

 ---
    Module Name:	pkgsrc
    Committed By:	he
    Date:		Sun Jan  2 16:49:29 UTC 2022

    Added Files:
    	pkgsrc/emulators/compat90: PLIST.earmeb PLIST.earmv6hf PLIST.earmv7hf
    	    PLIST.m68000
    Removed Files:
    	pkgsrc/emulators/compat90: PLIST.armeb PLIST.armv6hf PLIST.armv7hf
    	    PLIST.m68010

    Log Message:
    Rename the set lists corresponding to recent EMUL_PLATFORMS
    renaming.  Ride on recent PKG_REVISION bump.

 ---
    Module Name:	pkgsrc
    Committed By:	he
    Date:		Sun Jan  2 16:54:05 UTC 2022

    Modified Files:
    	pkgsrc/emulators/compat90: distinfo

    Log Message:
    Update distinfo as well, to complete the EMUL_PLATFORMS renaming.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.1.2.1 pkgsrc/emulators/compat90/Makefile
 cvs rdiff -u -r1.1 -r0 pkgsrc/emulators/compat90/PLIST.armeb \
     pkgsrc/emulators/compat90/PLIST.armv6hf \
     pkgsrc/emulators/compat90/PLIST.armv7hf \
     pkgsrc/emulators/compat90/PLIST.m68010
 cvs rdiff -u -r0 -r1.1.2.2 pkgsrc/emulators/compat90/PLIST.earmeb \
     pkgsrc/emulators/compat90/PLIST.earmv6hf \
     pkgsrc/emulators/compat90/PLIST.earmv7hf \
     pkgsrc/emulators/compat90/PLIST.m68000
 cvs rdiff -u -r1.2 -r1.2.2.1 pkgsrc/emulators/compat90/distinfo
 cvs rdiff -u -r1.2 -r1.2.72.1 pkgsrc/emulators/compat_netbsd/INSTALL.ELF

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

Responsible-Changed-From-To: he@NetBSD.org->he
Responsible-Changed-By: lukem@NetBSD.org
Responsible-Changed-When: Sat, 10 Jun 2023 07:35:44 +0000
Responsible-Changed-Why:
don't need @netbsd.org in field


State-Changed-From-To: open->closed
State-Changed-By: he@NetBSD.org
State-Changed-When: Sat, 10 Jun 2023 17:37:44 +0000
State-Changed-Why:
It is my beleif that this bug has been fixed by the changes
recorded in the PR and pulled up to 2021Q4.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.