[libvirt] [PATCH 0/2] spec: Make the build reproducible

Jiri Denemark (2): spec: Turn on verbose build spec: Make the build reproducible libvirt.spec.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.15.1

When building a package in a build system, such as koji or cbs, logs are the only thing which can be used to diagnose failures. Make them verbose since human friendly output of V=0 build doesn't really help when a build fails. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- libvirt.spec.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index b00689cabf..b88a977966 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1366,7 +1366,7 @@ rm -f po/stamp-po %{?enable_werror} \ --enable-expensive-tests \ %{arg_init_script} -make %{?_smp_mflags} +make %{?_smp_mflags} V=1 gzip -9 ChangeLog %install @@ -1375,9 +1375,9 @@ rm -fr %{buildroot} # Avoid using makeinstall macro as it changes prefixes rather than setting # DESTDIR. Newer make_install macro would be better but it's not available # on RHEL 5, thus we need to expand it here. -make %{?_smp_mflags} install DESTDIR=%{?buildroot} SYSTEMD_UNIT_DIR=%{_unitdir} +make %{?_smp_mflags} install DESTDIR=%{?buildroot} SYSTEMD_UNIT_DIR=%{_unitdir} V=1 -make %{?_smp_mflags} -C examples distclean +make %{?_smp_mflags} -C examples distclean V=1 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a -- 2.15.1

If the spec file applies a patch which touches any file in the API XMLs dependency tree, we need to regenerate the XMLs and consequently recreate hvsupport.html. The file will contain a time stamp in a comment which means it will be different every time the package is built. The commit a54c9622860 which added the time stamp also added support for SOURCE_DATE_EPOCH environment variable. Let's set it to the time stamp of the spec file itself to make the build reproducible. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- libvirt.spec.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index b88a977966..7e1b6a27d3 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1300,6 +1300,8 @@ exit 1 # place macros above and build commands below this comment +export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) + %if 0%{?enable_autotools} autoreconf -if %endif @@ -1372,6 +1374,8 @@ gzip -9 ChangeLog %install rm -fr %{buildroot} +export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) + # Avoid using makeinstall macro as it changes prefixes rather than setting # DESTDIR. Newer make_install macro would be better but it's not available # on RHEL 5, thus we need to expand it here. -- 2.15.1

On Wednesday, 29 November 2017 14:58:31 CET Jiri Denemark wrote:
Jiri Denemark (2): spec: Turn on verbose build spec: Make the build reproducible
libvirt.spec.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
The whole series: Reviewed-by: Pino Toscano <ptoscano@redhat.com> -- Pino Toscano
participants (2)
-
Jiri Denemark
-
Pino Toscano