Bug 267526 - pkgbase: Conflict between runtime and runtime-dev on /usr/include/dev/wg/if_wg.h
Summary: pkgbase: Conflict between runtime and runtime-dev on /usr/include/dev/wg/if_wg.h
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Kyle Evans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-02 16:06 UTC by Guido Falsi
Modified: 2023-05-05 19:03 UTC (History)
6 users (show)

See Also:
kevans: mfc-stable13+
kevans: mfc-stable12-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Falsi freebsd_committer freebsd_triage 2022-11-02 16:06:28 UTC
Hi,

When updating to head 93381ae06bb043a85d6b26459b511ccacc2045e2 using package base (packages built using poudriere) I'm getting the following error from `pkg upgrade`:

pkg: FreeBSD-runtime-dev-14.snap20221102095743 conflicts with
FreeBSD-runtime-14.snap20221102095743 (installs files into the same
place).  Problematic file: /usr/include/dev/wg/if_wg.h


Looks like if_wg.h is getting included multiple times. There is some analysis on this from Doug Rabson here:

https://lists.freebsd.org/archives/freebsd-pkgbase/2022-November/000034.html


Thanks in advance!
Comment 1 Kyle Evans freebsd_committer freebsd_triage 2022-11-02 19:16:02 UTC
I think this will fix the immediate problem: https://people.freebsd.org/~kevans/incs.diff

Long-term we need a more carefully considered approach, because some of these headers shouldn't be in runtime-dev and they actually have their appropriate *PACKAGE set.
Comment 2 Guido Falsi freebsd_committer freebsd_triage 2022-11-02 22:53:41 UTC
(In reply to Kyle Evans from comment #1)
Thanks a lot for our patch.

Yes it is working here, allowing me to install the packages now without conflict.

For some reason the update this time overwrote the password database and other system files, luckily I had ZFS snapshots.
Comment 3 Kyle Evans freebsd_committer freebsd_triage 2022-11-03 00:03:50 UTC
(In reply to Guido Falsi from comment #2)

This happens at times when files move between packages; markj has some WIP to deal with it better. Thanks for confirming! I'll put this into review tonight.
Comment 4 Mark Johnston freebsd_committer freebsd_triage 2022-11-03 13:39:43 UTC
(In reply to Kyle Evans from comment #3)
A partial solution was merged and is in pkg-devel now: https://github.com/freebsd/pkg/pull/2080
Comment 5 Kyle Evans freebsd_committer freebsd_triage 2022-11-03 19:30:49 UTC
I note that the previous link was for the tangentially related problem that some config files ended up not being merged forward; adding a link for the problem at hand instead
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-11-10 04:22:11 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8b8babf044ca8e8f0d49894c3a41d429146ffc5a

commit 8b8babf044ca8e8f0d49894c3a41d429146ffc5a
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-11-10 04:20:34 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-11-10 04:20:38 +0000

    include: put includes into -dev packages

    The includes build is kind of funky, as we support either copying or
    symlinking files into /usr/include.  For `copies`, we were supplying
    the include/ ${TAG_ARGS}, which puts packages into `FreeBSD-runtime`,
    without any consideration to the fact that we're installing headers.

    Let's copy the approach that the `symlinks` target uses for now, and
    add ",dev" to the TAG_ARGS so that headers at least end up in
    FreeBSD-runtime-dev, which is more appropriate.  Some of these includes
    are actually technically supposed to be in *other* packages and their
    INCSGROUP's PACKAGE setting is actually correct, but this is less
    trivial to solve.  This is a bandaid to fix the immediate problem of
    some headers ending up in two different packages.

    PR:             267526
    Reviewed by:    dfr, manu
    Differential Revision:  https://reviews.freebsd.org/D37256

 include/Makefile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-11-13 05:40:48 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2b20cade1ecaf587520ddbdd8792977bedd3569d

commit 2b20cade1ecaf587520ddbdd8792977bedd3569d
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2022-11-10 04:20:34 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2022-11-13 05:38:22 +0000

    include: put includes into -dev packages

    The includes build is kind of funky, as we support either copying or
    symlinking files into /usr/include.  For `copies`, we were supplying
    the include/ ${TAG_ARGS}, which puts packages into `FreeBSD-runtime`,
    without any consideration to the fact that we're installing headers.

    Let's copy the approach that the `symlinks` target uses for now, and
    add ",dev" to the TAG_ARGS so that headers at least end up in
    FreeBSD-runtime-dev, which is more appropriate.  Some of these includes
    are actually technically supposed to be in *other* packages and their
    INCSGROUP's PACKAGE setting is actually correct, but this is less
    trivial to solve.  This is a bandaid to fix the immediate problem of
    some headers ending up in two different packages.

    PR:             267526
    Reviewed by:    dfr, manu
    Differential Revision:  https://reviews.freebsd.org/D37256

    (cherry picked from commit 8b8babf044ca8e8f0d49894c3a41d429146ffc5a)

 include/Makefile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Comment 8 Kyle Evans freebsd_committer freebsd_triage 2022-11-13 05:42:07 UTC
Thanks!
Comment 9 Ed Maste freebsd_committer freebsd_triage 2023-05-05 18:57:17 UTC
This is happening again -- from a recent Cirrus-CI run on main,

> pkg: duplicate file listing: /usr/include/dev/wg/if_wg.h, ignoring

It has the same metadata on both entries:

https://cirrus-ci.com/task/6262656709951488
error: ./usr/include/dev/wg/if_wg.h file repeated with same meta: line 13367,14164