-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproducible release tarballs #1550
base: main
Are you sure you want to change the base?
Changes from all commits
17b1a28
a6fbdd7
a5eb00d
6bc903d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -462,7 +462,7 @@ SUBDIR+= ${_DIR} | |
# by calling 'makedb' in share/man. This is only relevant for | ||
# install/distribute so they build the whatis file after every manpage is | ||
# installed. | ||
.if make(installworld) || make(install) | ||
.if make(installworld) || make(install) || make(distribute) | ||
SUBDIR+=.WAIT | ||
.endif | ||
SUBDIR+=etc | ||
|
@@ -1441,7 +1441,11 @@ DEBUG_DISTRIBUTIONS= | |
DEBUG_DISTRIBUTIONS+= base ${EXTRA_DISTRIBUTIONS:S,tests,,} | ||
.endif | ||
|
||
MTREE_MAGIC?= mtree 2.0 | ||
MTREE_MAGIC?= mtree 2.0 | ||
.if ${MK_REPRODUCIBLE_BUILD} == "yes" | ||
MTREE_TIME= time=${SOURCE_DATE_EPOCH}.000000000 | ||
SED_REPLACE_TIME= -e "s/ time=[[:digit:].]*/ ${MTREE_TIME}/" | ||
.endif | ||
|
||
distributeworld installworld stageworld: _installcheck_world .PHONY | ||
mkdir -p ${INSTALLTMP} | ||
|
@@ -1470,6 +1474,7 @@ distributeworld installworld stageworld: _installcheck_world .PHONY | |
.if defined(NO_ROOT) | ||
-mkdir -p ${METALOG:H} | ||
echo "#${MTREE_MAGIC}" > ${METALOG} | ||
echo "/set ${MTREE_TIME}" >> ${METALOG} | ||
.endif | ||
.if make(distributeworld) | ||
.for dist in ${EXTRA_DISTRIBUTIONS} | ||
|
@@ -1548,7 +1553,7 @@ distributeworld installworld stageworld: _installcheck_world .PHONY | |
@# the relevant mtree line. | ||
cd ${DESTDIR}/${DISTDIR}; \ | ||
find ./${dist}${path} | ${METALOG_SORT_CMD} -u ${METALOG} - | \ | ||
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}/, "."); print } }' > \ | ||
awk 'BEGIN { print "#${MTREE_MAGIC}"; print "/set ${MTREE_TIME}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}/, "."); print } }' > \ | ||
${DESTDIR}/${DISTDIR}/${dist}${suffix} | ||
.endfor | ||
.endfor | ||
|
@@ -1903,25 +1908,23 @@ distributekernel distributekernel.debug: .PHONY | |
false | ||
.endif | ||
mkdir -p ${DESTDIR}/${DISTDIR} | ||
.if defined(NO_ROOT) | ||
@echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta | ||
.endif | ||
rm -f ${DESTDIR}/${DISTDIR}/kernel.premeta | ||
${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ | ||
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \ | ||
${IMAKE_MTREE} PATH=${TMPPATH:Q} ${MAKE} KERNEL=${INSTKERNNAME} \ | ||
DISTBASE=/kernel DESTDIR=${INSTALL_DDIR}/kernel \ | ||
METALOG=${METALOG:S/METALOG/kernel.premeta/} \ | ||
${.TARGET:S/distributekernel/install/} | ||
.if defined(NO_ROOT) | ||
@sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \ | ||
${DESTDIR}/${DISTDIR}/kernel.meta | ||
echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.meta | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want to keep the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO the |
||
echo "/set ${MTREE_TIME}" >> ${DESTDIR}/${DISTDIR}/kernel.meta | ||
sed -e 's|^./kernel|.|' ${SED_REPLACE_TIME} ${DESTDIR}/${DISTDIR}/kernel.premeta | \ | ||
${METALOG_SORT_CMD} >> ${DESTDIR}/${DISTDIR}/kernel.meta | ||
.endif | ||
.endif | ||
.if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" | ||
.for _kernel in ${BUILDKERNELS:[2..-1]} | ||
.if defined(NO_ROOT) | ||
@echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta | ||
.endif | ||
rm -f ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta | ||
${_+_}cd ${KRNLOBJDIR}/${_kernel}; \ | ||
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \ | ||
${IMAKE_MTREE} PATH=${TMPPATH:Q} ${MAKE} \ | ||
|
@@ -1930,9 +1933,11 @@ distributekernel distributekernel.debug: .PHONY | |
METALOG=${METALOG:S/METALOG/kernel.${_kernel}.premeta/} \ | ||
${.TARGET:S/distributekernel/install/} | ||
.if defined(NO_ROOT) | ||
@sed -e "s|^./kernel.${_kernel}|.|" \ | ||
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \ | ||
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | ||
echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | ||
echo "/set ${MTREE_TIME}" >> ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | ||
sed -e "s|^./kernel.${_kernel}|.|" ${SED_REPLACE_TIME} \ | ||
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta | \ | ||
${METALOG_SORT_CMD} >> ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | ||
.endif | ||
.endfor | ||
.endif | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,6 +283,16 @@ This is intended for use only when | |
.Fa /usr/ports | ||
is expected to exist by alternative means. | ||
.El | ||
.Sh REPRODUCIBLE BUILDS | ||
Different builders can produce bit-identical release tarballs using | ||
.Va PKG_TIMESTAMP | ||
and | ||
.Va REVISION : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably want to differentiate I wonder if we should have newvers.sh collect the commit time (e.g. from |
||
.Bd -literal -offset indent | ||
git checkout <REVISION> | ||
make -DWITH_REPRODUCIBLE_BUILD buildworld buildkernel | ||
make -C release -DWITH_REPRODUCIBLE_BUILD PKG_TIMESTAMP=<TIMESTAMP> packagesystem | ||
.Ed | ||
.Sh EMBEDDED BUILDS | ||
The following | ||
.Fa release.conf | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
make(distributeworld)
? I'm not sure, but I don't fully understand thedistribute
pseduo-target.