[Bug 294002] pkg: pkg-create is not honoring SOURCE_DATE_EPOCH

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 23 Mar 2026 17:24:43 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294002

            Bug ID: 294002
           Summary: pkg: pkg-create is not honoring SOURCE_DATE_EPOCH
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: jlduran@FreeBSD.org

Created attachment 269050
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=269050&action=edit
WORKAROUND

Makefile.inc1 contains a series of pkgbase-related targets:

- create-source-src-package
- create-source-src-sys-package
- create-world-package-${pkgname}
- create-sets-packages
- create-dtb-package
- create-kernel-packages-flavor...
- create-kernel-packages-extra-flavor...

which invoke "pkg create". According to pkg-create(8), the SOURCE_DATE_EPOCH
environment variable is used to timestamp every single file in the pkg archive.
However, this is not happening:

    % pkg info -R -x FreeBSD-\* | grep mtime: | sort -u
            mtime: <some time>
            mtime: <some time + 1>
            ...
            mtime: <some time + n>

While testing for NanoBSD + pkgbase, proper timestamping of all files was not
possible.  As a workaround, add "-t ${SOURCE_DATE_EPOCH}" to all of the above
targets' pkg create command:

    % pkg info -R -x FreeBSD-\* | grep mtime: | sort -u
            mtime: <${SOURCE_DATE_EPOCH}>

Ideally the issue should be fixed in "pkg", but reporting the issue here for
tracking and because it also affects release.

-- 
You are receiving this mail because:
You are the assignee for the bug.