• pkg-2.4.1 broken?

    From Jan Henrik Sylvester@me@janh.de to muc.lists.freebsd.ports on Tue Nov 4 15:18:36 2025
    From Newsgroup: muc.lists.freebsd.ports

    # pkg delete -f pkg
    ...
    # ../pkg-static add pkg-2.4.1.pkg
    pkg-static: pkg-2.4.1.pkg is not a valid package: no manifest found

    This is on 14.3-RELEASE/amd64. pkg-2.4.1.pkg was created on a different machine using 'pkg create pkg-2.4.1' after upgrading pkg from 2.3.1_1 to
    2.4.1 using portmaster. pkg-static is also copied from that machine.

    I can still install pkg-2.3.1_1.pkg with the same pkg-static. I only get:

    pkg: warning: database version 37 is newer than libpkg(3) version 36,
    but still compatible

    Besides that warning, everything seems to work with pkg-2.3.1_1.

    I know that portmaster is not really recommended anymore and using
    pkg-static to install pkg is probably not the best way, either. Anyhow,
    it used to work and it should work from my understanding.

    Best,
    Jan Henrik


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Baptiste Daroussin@bapt@FreeBSD.org to muc.lists.freebsd.ports on Tue Nov 4 15:23:10 2025
    From Newsgroup: muc.lists.freebsd.ports

    On Tue 04 Nov 15:18, Jan Henrik Sylvester wrote:
    # pkg delete -f pkg
    ...
    # ../pkg-static add pkg-2.4.1.pkg
    pkg-static: pkg-2.4.1.pkg is not a valid package: no manifest found

    This is on 14.3-RELEASE/amd64. pkg-2.4.1.pkg was created on a different machine using 'pkg create pkg-2.4.1' after upgrading pkg from 2.3.1_1 to 2.4.1 using portmaster. pkg-static is also copied from that machine.

    I can still install pkg-2.3.1_1.pkg with the same pkg-static. I only get:

    pkg: warning: database version 37 is newer than libpkg(3) version 36, but still compatible

    Besides that warning, everything seems to work with pkg-2.3.1_1.

    I know that portmaster is not really recommended anymore and using
    pkg-static to install pkg is probably not the best way, either. Anyhow, it used to work and it should work from my understanding.

    Best,
    Jan Henrik


    I would need more output that what you show.

    How was your pkg-2.4.1.pkg created? can you host it somewhere to I can analyse.

    Best regards,
    Bapt


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jan Henrik Sylvester@me@janh.de to muc.lists.freebsd.ports on Tue Nov 4 15:59:07 2025
    From Newsgroup: muc.lists.freebsd.ports

    On 11/4/25 3:23 PM, Baptiste Daroussin wrote:
    On Tue 04 Nov 15:18, Jan Henrik Sylvester wrote:
    # pkg delete -f pkg
    ...
    # ../pkg-static add pkg-2.4.1.pkg
    pkg-static: pkg-2.4.1.pkg is not a valid package: no manifest found

    This is on 14.3-RELEASE/amd64. pkg-2.4.1.pkg was created on a different
    machine using 'pkg create pkg-2.4.1' after upgrading pkg from 2.3.1_1 to
    2.4.1 using portmaster. pkg-static is also copied from that machine.

    I can still install pkg-2.3.1_1.pkg with the same pkg-static. I only get:

    pkg: warning: database version 37 is newer than libpkg(3) version 36, but
    still compatible

    Besides that warning, everything seems to work with pkg-2.3.1_1.

    I know that portmaster is not really recommended anymore and using
    pkg-static to install pkg is probably not the best way, either. Anyhow, it >> used to work and it should work from my understanding.

    Best,
    Jan Henrik


    I would need more output that what you show.

    How was your pkg-2.4.1.pkg created? can you host it somewhere to I can analyse.

    Thanks for your quick reply.

    As I said, it was created on another machine using 'pkg create
    pkg-2.4.1', but you made me recheck the log. Previously, I failed to
    spot the following. Sorry.

    pkg: dir '/usr/local/lib/compat/pkg' is missing
    pkg: package creation failed

    Hence, I could have known that the package is broken before I copied it
    to another machine.

    I think it is simply an empty tar archive: https://janh.de/tmp/pkg-2.4.1.pkg

    After creating /usr/local/lib/compat/pkg manually, I was able to
    recreate a working package.

    That /usr/local/lib/compat/pkg was missing seems to be a bug in
    portmaster, which was used to upgrade pkg-2.3.1_1 to pkg-2.4.1, because
    when I do 'pkg delete -f pkg' and 'make -C /usr/ports/ports-mgmt/pkg
    install clean' the directory is created correctly. I guess I should
    learn that portmaster really is an outdated method to upgrade.

    Best,
    Jan Henrik


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Baptiste Daroussin@bapt@FreeBSD.org to muc.lists.freebsd.ports on Tue Nov 4 16:03:29 2025
    From Newsgroup: muc.lists.freebsd.ports

    On Tue 04 Nov 15:59, Jan Henrik Sylvester wrote:
    On 11/4/25 3:23 PM, Baptiste Daroussin wrote:
    On Tue 04 Nov 15:18, Jan Henrik Sylvester wrote:
    # pkg delete -f pkg
    ...
    # ../pkg-static add pkg-2.4.1.pkg
    pkg-static: pkg-2.4.1.pkg is not a valid package: no manifest found

    This is on 14.3-RELEASE/amd64. pkg-2.4.1.pkg was created on a different machine using 'pkg create pkg-2.4.1' after upgrading pkg from 2.3.1_1 to 2.4.1 using portmaster. pkg-static is also copied from that machine.

    I can still install pkg-2.3.1_1.pkg with the same pkg-static. I only get:

    pkg: warning: database version 37 is newer than libpkg(3) version 36, but still compatible

    Besides that warning, everything seems to work with pkg-2.3.1_1.

    I know that portmaster is not really recommended anymore and using pkg-static to install pkg is probably not the best way, either. Anyhow, it
    used to work and it should work from my understanding.

    Best,
    Jan Henrik


    I would need more output that what you show.

    How was your pkg-2.4.1.pkg created? can you host it somewhere to I can analyse.

    Thanks for your quick reply.

    As I said, it was created on another machine using 'pkg create pkg-2.4.1', but you made me recheck the log. Previously, I failed to spot the following. Sorry.

    pkg: dir '/usr/local/lib/compat/pkg' is missing
    pkg: package creation failed

    Hence, I could have known that the package is broken before I copied it to another machine.

    I think it is simply an empty tar archive: https://janh.de/tmp/pkg-2.4.1.pkg

    After creating /usr/local/lib/compat/pkg manually, I was able to recreate a working package.

    That /usr/local/lib/compat/pkg was missing seems to be a bug in portmaster, which was used to upgrade pkg-2.3.1_1 to pkg-2.4.1, because when I do 'pkg delete -f pkg' and 'make -C /usr/ports/ports-mgmt/pkg install clean' the directory is created correctly. I guess I should learn that portmaster
    really is an outdated method to upgrade.


    Noted, in anycase pkg should not have left an empty file it should have been removed so there is still a bug for me to fix there :D

    Best regards,
    Bapt


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Janky Jay, III@jankyj@unfs.us to muc.lists.freebsd.ports on Tue Nov 4 19:01:30 2025
    From Newsgroup: muc.lists.freebsd.ports

    Hi All,

    On 11/4/25 05:23PM, Tatsuki Makino wrote:
    Hello.

    On 2025/11/04 23:59, Jan Henrik Sylvester wrote:
    That /usr/local/lib/compat/pkg was missing seems to be a bug in
    portmaster, which was used to upgrade pkg-2.3.1_1 to pkg-2.4.1,
    because when I do 'pkg delete -f pkg' and 'make -C
    /usr/ports/ports-mgmt/pkg install clean' the directory is created
    correctly. I guess I should learn that portmaster really is an
    outdated method to upgrade.
    When the port is installed using make, ${LOCALBASE}/lib/compat/pkg may
    be removed by /usr/ports/Templates/BSD.local.dist if the directory is
    empty.
    portmaster is merely one of the entities through which that operation
    is carried out.

    Also, just a quick FYI, I tested the upgrade of pkg-2.3.1_1 to pkg-2.4.1
    today using portmaster on both FreeBSD-14.3-R-p5 and FreeBSD-15.0-STABLE (latest 15-n281026-e2a87c08171a) and I didn't have any issues or errors
    at all. The "pkg" command continued to work as expected afterwards.

    I haven't tried copying any "pkg" packages to another system to test,
    but everything seems to be in order for the way portmaster is building
    and installing the port.

    Regards,
    Janky Jay, III



    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Stefan Esser@se@FreeBSD.org to muc.lists.freebsd.ports on Wed Nov 5 10:10:20 2025
    From Newsgroup: muc.lists.freebsd.ports

    Am 05.11.25 um 03:01 schrieb Janky Jay, III:
    Hi All,

    On 11/4/25 05:23PM, Tatsuki Makino wrote:
    Hello.

    On 2025/11/04 23:59, Jan Henrik Sylvester wrote:
    That /usr/local/lib/compat/pkg was missing seems to be a bug in portmaster,
    which was used to upgrade pkg-2.3.1_1 to pkg-2.4.1, because when I do 'pkg >>> delete -f pkg' and 'make -C /usr/ports/ports-mgmt/pkg install clean' the >>> directory is created correctly. I guess I should learn that portmaster
    really is an outdated method to upgrade.
    When the port is installed using make, ${LOCALBASE}/lib/compat/pkg may be >> removed by /usr/ports/Templates/BSD.local.dist if the directory is empty.
    portmaster is merely one of the entities through which that operation is
    carried out.

    Also, just a quick FYI, I tested the upgrade of pkg-2.3.1_1 to pkg-2.4.1 today
    using portmaster on both FreeBSD-14.3-R-p5 and FreeBSD-15.0-STABLE (latest 15-
    n281026-e2a87c08171a) and I didn't have any issues or errors at all. The "pkg"
    command continued to work as expected afterwards.

    I haven't tried copying any "pkg" packages to another system to test, but everything seems to be in order for the way portmaster is building and installing the port.

    I cannot reproduce the issue, and do not understand why the package
    creation may have failed for the OP.

    My test build ended thus:

    Creating a package for new version pkg-2.3.1_1
    Package saved to yes/All

    Installation of ports-mgmt/pkg (pkg-2.3.1_1) complete

    # ls -l /usr/packages/All/pkg-2.3.1_1.pkg
    -rw-r--r-- 1 root wheel 14128264 Nov 5 09:21 /usr/packages/All/pkg-2.3.1_1.pkg
    # tar tvf /usr/packages/All/pkg-2.3.1_1.pkg +MANIFEST
    -rw-r--r-- 0 root wheel 9862 Jan 1 1970 +MANIFEST

    Portmaster invokes just the same commands used to manually build packages,
    and it depends on the port system to create the stage directory.

    When building packages with "portmaster -g", "make package" is used, as
    would be the case in a "manual" package build.

    The pkg command noticed the missing directory in the reported issue:

    pkg: dir '/usr/local/lib/compat/pkg' is missing
    pkg: package creation failed

    That message indicates that this directory was missing in the stage
    directory, which is created by the post-install target in pkg/Makefile:

    post-install:
    @${MKDIR} ${STAGEDIR}${PREFIX}/lib/compat/pkg

    Since the post-install target is invoked during "make stage", which is a pre-requisite for "make package", I do not see how this could have failed
    when building the package with portmaster.

    None of these build steps is special when building with portmaster and
    none of the build steps depends on the pkg command (well, creation of the package obviously does, but creation of the missing compat/pkg directory
    does not).

    Regards, STefan


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Herbert J. Skuhra@herbert@gojira.at to muc.lists.freebsd.ports on Wed Nov 5 11:13:14 2025
    From Newsgroup: muc.lists.freebsd.ports

    On Wed, 05 Nov 2025 10:10:20 +0100, Stefan Esser wrote:

    Am 05.11.25 um 03:01 schrieb Janky Jay, III:
    Hi All,

    On 11/4/25 05:23PM, Tatsuki Makino wrote:
    Hello.

    On 2025/11/04 23:59, Jan Henrik Sylvester wrote:
    That /usr/local/lib/compat/pkg was missing seems to be a bug in
    portmaster, which was used to upgrade pkg-2.3.1_1 to pkg-2.4.1,
    because when I do 'pkg delete -f pkg' and 'make -C
    /usr/ports/ports-mgmt/pkg install clean' the directory is created
    correctly. I guess I should learn that portmaster really is an
    outdated method to upgrade.
    When the port is installed using make, ${LOCALBASE}/lib/compat/pkg
    may be removed by /usr/ports/Templates/BSD.local.dist if the
    directory is empty.
    portmaster is merely one of the entities through which that
    operation is carried out.

    Also, just a quick FYI, I tested the upgrade of pkg-2.3.1_1 to
    pkg-2.4.1 today using portmaster on both FreeBSD-14.3-R-p5 and FreeBSD-15.0-STABLE (latest 15- n281026-e2a87c08171a) and I didn't
    have any issues or errors at all. The "pkg" command continued to
    work as expected afterwards.

    I haven't tried copying any "pkg" packages to another system to
    test, but everything seems to be in order for the way portmaster is building and installing the port.

    I cannot reproduce the issue, and do not understand why the package
    creation may have failed for the OP.

    I am using portmaster and /usr/local/lib/compat/pkg does not exist on
    any of my systems. It's only created when I run 'make reinstall' in ports-mgmt/pkg:

    # cd /usr/ports/ports-mgmt/pkg
    # make clean
    # ls -l /usr/local/lib/compat
    total 0
    # make reinstall clean
    [...]
    pkg-static: unlinkat(usr/local/lib/compat/pkg/): No such file or directory [...]
    # ls -l /usr/local/lib/compat
    total 4
    drwxr-xr-x 2 root wheel 512 Nov 5 10:52 pkg
    # portmaster pkg-
    # ls -l /usr/local/lib/compat/
    total 0
    # pkg create pkg
    Creating package for pkg-2.3.1_1
    pkg: lstat(/usr/local/lib/compat/pkg): No such file or directory



    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Jan Henrik Sylvester@me@janh.de to muc.lists.freebsd.ports on Wed Nov 5 12:35:18 2025
    From Newsgroup: muc.lists.freebsd.ports

    On 11/5/25 1:23 AM, Tatsuki Makino wrote:
    portmaster is merely one of the entities through which that operation is carried out.

    I do not think so. Line 3913 and following of portmaster explicitly
    removes /usr/local/lib/compat/pkg (in many cases):

    [ -z "$temp" ] && temp=`find $LOCALBASE_COMPAT -type d -empty 2>/dev/null`
    if pm_isdir "$temp"; then
    pm_sv Deleting the empty $LOCALBASE_COMPAT
    pm_rmdir_s $temp
    fi
    unset temp

    After that, you cannot create a package of pkg anymore. (If you let
    portmaster itself create a package in the same run, it happens before
    that line.)

    BTW: I was trying to output the verbose message to see when it happens,
    but pm_sv needs PM_SU_VERBOSE to be set, which is never set by
    portmaster, but unset at the beginning if you are root. (And I should
    stop looking here, because the find command should probably have a depth
    0 check...)

    Best,
    Jan Henrik


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2