svn commit: r350550 - head/share/mk

Mark Millard marklmi at yahoo.com
Thu Aug 8 20:17:29 UTC 2019


Something has seemed incomplete in the descriptions
that I've seen in the posts (based on a vague memory
and observed behavior in my context). So I looked:

# grep -r -U3 REPRO_FLAG /usr/src/sys/ /usr/src/stand/ | less
/usr/src/sys/conf/kern.post.mk- ${NORMAL_CTFCONVERT}
/usr/src/sys/conf/kern.post.mk-
/usr/src/sys/conf/kern.post.mk-.if ${MK_REPRODUCIBLE_BUILD} != "no"
/usr/src/sys/conf/kern.post.mk:REPRO_FLAG="-R"
/usr/src/sys/conf/kern.post.mk-.endif
/usr/src/sys/conf/kern.post.mk-vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP}
/usr/src/sys/conf/kern.post.mk: MAKE="${MAKE}" sh $S/conf/newvers.sh ${REPRO_FLAG} ${KERN_IDENT}
/usr/src/sys/conf/kern.post.mk-
/usr/src/sys/conf/kern.post.mk-vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src
/usr/src/sys/conf/kern.post.mk- ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c
--
/usr/src/stand/loader.mk-CLEANFILES+=   vers.c
/usr/src/stand/loader.mk-VERSION_FILE?= ${.CURDIR}/version
/usr/src/stand/loader.mk-.if ${MK_REPRODUCIBLE_BUILD} != no
/usr/src/stand/loader.mk:REPRO_FLAG=    -r
/usr/src/stand/loader.mk-.endif
/usr/src/stand/loader.mk-vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE}
/usr/src/stand/loader.mk:       sh ${LDRSRC}/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \
/usr/src/stand/loader.mk-           ${NEWVERSWHAT}
/usr/src/stand/loader.mk-
/usr/src/stand/loader.mk-.if ${MK_LOADER_VERBOSE} != "no"

Then the question is the -r vs. -R distinction (for
just /usr/src/sys/conf/newvers.sh as it turns out,
/usr/src/stand/loader.mk only supports -r use):

. . .
#       -r      Reproducible build.  Do not embed directory names, user names,
#               time stamps or other dynamic information into the output file.
#               This is intended to allow two builds done at different times
#               and even by different people on different hosts to produce
#               identical output.
#
#       -R      Reproducible build if the tree represents an unmodified
#               checkout from a version control system.  Metadata is included
#               if the tree is modified.
. . .
include_metadata=yes
modified=no
while getopts crRvV: opt; do
        case "$opt" in
        c)
                echo "$COPYRIGHT"
                exit 0
                ;;
        r)
                include_metadata=no
                ;;
        R)
                include_metadata=if-modified
                ;;
. . .

As stands -r is never used for sys/conf/newvers.sh
unless one changes /usr/src/sys/conf/kern.post.mk
or some such.

So if I use WITH_REPRODUCEABLE_BUILD I still see
the varying metadata (but I do not have an
independent svn with my own checkins, just
differences with FreeBSD svnlite update -r??????
materials).

May be what some folks are asking for is some
means of control over -R vs. -r being supplied
to sys/conf/newvers.sh , without having to edit
sys/conf/kern.post.mk ?


===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-arch mailing list