Skip to content

Commit c1c3d7f

Browse files
authored
Merge pull request #3161 from jimklimov/FTY-obs
Introduce `make distcheck-completeness` to verify that our dist archives exactly reproduce themselves
2 parents c7198d5 + 61d7af0 commit c1c3d7f

3 files changed

Lines changed: 74 additions & 3 deletions

File tree

.github/workflows/01-make-dist.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,16 @@ jobs:
215215
( ${{env.compiler}} ; echo "=== CC: $CC => `command -v $CC` =>" ; $CC --version ; echo "=== CXX: $CXX => `command -v $CXX` =>" ; $CXX --version ) || true
216216
make -s -j 8 distcheck
217217
218+
- name: NUT CI Build to verify "dist" tarball build self-reproducibility
219+
env:
220+
compiler: 'CC=gcc CXX=g++'
221+
run: |
222+
PATH="/usr/lib/ccache:$PATH" ; export PATH
223+
CCACHE_COMPRESS=true; export CCACHE_COMPRESS
224+
ccache --version || true
225+
( ${{env.compiler}} ; echo "=== CC: $CC => `command -v $CC` =>" ; $CC --version ; echo "=== CXX: $CXX => `command -v $CXX` =>" ; $CXX --version ) || true
226+
make -s -j 8 distcheck-completeness
227+
218228
- name: CCache stats after distcheck
219229
run: ccache -sv || ccache -s || echo "FAILED to read ccache info, oh well"
220230

@@ -270,7 +280,7 @@ jobs:
270280
continue-on-error: true
271281
with:
272282
comment-tag: latest-tarball
273-
message: Dist and Docs [NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip}](${{ steps.upload_artifact.outputs.artifact-url }}) are available for commit ${{ github.sha }}
283+
message: Dist and Docs [NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip](${{ steps.upload_artifact.outputs.artifact-url }}) are available for commit ${{ github.sha }}
274284
#github-token: ${{ secrets.MAKE_DIST_TOKEN }}
275285

276286
# https://github.com/marocchino/sticky-pull-request-comment
@@ -280,7 +290,6 @@ jobs:
280290
continue-on-error: true
281291
with:
282292
header: latest-tarball-sticky
283-
only_create: true
284-
message: Dist and Docs [NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip}](${{ steps.upload_artifact.outputs.artifact-url }}) are available for commit ${{ github.sha }}
293+
message: Dist and Docs [NUT-tarballs-${{ steps.subst-github-ref-name.outputs.result }}.zip](${{ steps.upload_artifact.outputs.artifact-url }}) are available for commit ${{ github.sha }}
285294
#github-token: ${{ secrets.MAKE_DIST_TOKEN }}
286295
#GITHUB_TOKEN: ${{ secrets.MAKE_DIST_TOKEN }}

Makefile.am

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,65 @@ libupsclient-version.h clients/libupsclient-version.h:
10131013
tools/gitlog2changelog.py: tools/gitlog2changelog.py.in
10141014
+cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) -s $(@F)
10151015

1016+
# Partially snatched from automake generated code
1017+
distcheck-completeness: dist
1018+
@chmod -R +w $(distdir) $(distdir)-orig-* $(distdir)-derived-* || true
1019+
@rm -rf $(distdir) $(distdir)-orig-* $(distdir)-derived-* || true
1020+
@case '$(DIST_ARCHIVES)' in \
1021+
*.tar.gz*) \
1022+
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
1023+
*.tar.bz2*) \
1024+
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
1025+
*.tar.lz*) \
1026+
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
1027+
*.tar.xz*) \
1028+
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
1029+
*.tar.Z*) \
1030+
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
1031+
*.shar.gz*) \
1032+
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
1033+
*.zip*) \
1034+
unzip $(distdir).zip ;;\
1035+
*.tar.zst*) \
1036+
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
1037+
esac
1038+
+@RES=0 ; \
1039+
{ cp -rf $(distdir) $(distdir)-orig-$$$$ \
1040+
&& am__cwd="`pwd`" \
1041+
&& $(am__cd) $(distdir) \
1042+
&& ./configure \
1043+
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
1044+
$(DISTCHECK_CONFIGURE_FLAGS) \
1045+
--prefix="`pwd`/.inst" \
1046+
&& $(MAKE) $(AM_MAKEFLAGS) dist \
1047+
&& case '$(DIST_ARCHIVES)' in \
1048+
*.tar.gz*) \
1049+
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
1050+
*.tar.bz2*) \
1051+
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
1052+
*.tar.lz*) \
1053+
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
1054+
*.tar.xz*) \
1055+
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
1056+
*.tar.Z*) \
1057+
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
1058+
*.shar.gz*) \
1059+
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
1060+
*.zip*) \
1061+
unzip $(distdir).zip ;;\
1062+
*.tar.zst*) \
1063+
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
1064+
esac \
1065+
&& mv $(distdir) ../$(distdir)-derived-$$$$ \
1066+
&& $(MAKE) $(AM_MAKEFLAGS) maintainer-clean \
1067+
&& cd "$$am__cwd" \
1068+
&& echo " $@ diff $(distdir)-orig-$$$$ $(distdir)-derived-$$$$" \
1069+
&& diff $(distdir)-orig-$$$$ $(distdir)-derived-$$$$ ; \
1070+
} || RES=$?? ;
1071+
rm -rf $(distdir)-orig-$$$$ $(distdir)-derived-$$$$ $(distdir) ; \
1072+
exit $$RES
1073+
@echo "SUCCESS: $(distdir) archives are self-reproducing"
1074+
10161075
# ----------------------------------------------------------------------
10171076
# Maintainers targets: distribution signature and hashes
10181077
# Assume tools are available (and maintainer GPG keys)

NEWS.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ several `FSD` notifications into one executed action. [PR #3097]
307307
- The `configure` script should now try harder to report specifically
308308
the "purelib" location as `PYTHON*_SITE_PACKAGES`. [#1209]
309309

310+
- Introduce `make distcheck-completeness` goal to verify that our distribution
311+
archives can exactly reproduce themselves. [#2829]
312+
310313
- Upstreamed reference packaging recipes (DEB, RPM) from the 42ITy project
311314
which can be used with OBS (Open Build Service by SUSE), both to support
312315
end-user testing of NUT development, and to have a yet another NUT CI farm

0 commit comments

Comments
 (0)