Skip to contentSkip to conversation

rt-tests: make manpages builds reproducible

PATCH In review Jeremy A. Puhlman 2 participants 4 messages Feb 25, 2020 – Feb 27, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt-tests: make manpages builds reproducible

From: Jeremy Puhlman <[email protected]>

Add -n to gzip call to make the build output
of the manpages reproducible.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 8747971..1b37ba7 100644
@@ -181,7 +181,7 @@ ssdd: $(OBJDIR)/ssdd.o $(OBJDIR)/librttest.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
 
 %.8.gz: %.8
-	gzip -c $< > $@
+	gzip -nc $< > $@
 
 %.8.bz2: %.8
 	bzip2 -c $< > $@
Signature · 1 line
2.20.1
#1 lore raw
Quoted 27 lines · Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

Add -n to gzip call to make the build output
of the manpages reproducible.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 8747971..1b37ba7 100644
@@ -181,7 +181,7 @@ ssdd: $(OBJDIR)/ssdd.o $(OBJDIR)/librttest.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
 
 %.8.gz: %.8
-	gzip -c $< > $@
+	gzip -nc $< > $@
 
 %.8.bz2: %.8
 	bzip2 -c $< > $@
Signature · 1 line
2.20.1

Could you explain to me how this makes the build output of manpages more reproducible?

Thanks

John

#2 lore raw
Quoted 24 lines · John Kacur
Quoted 21 lines · Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

Add -n to gzip call to make the build output
of the manpages reproducible.

---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 8747971..1b37ba7 100644
@@ -181,7 +181,7 @@ ssdd: $(OBJDIR)/ssdd.o $(OBJDIR)/librttest.a
  	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
 
  %.8.gz: %.8
-	gzip -c $< > $@
+	gzip -nc $< > $@
 
Quoted 8 lines
Quoted 6 lines
Makefile +0 -0
  %.8.bz2: %.8
  	bzip2 -c $< > $@
Signature · 1 line
2.20.1

Could you explain to me how this makes the build output of manpages more reproducible?

gzip adds the name of the file(not really an issue) and the modification time into the header of the gzipped archive.  Different modification times can cause the archives to have different md5sums even though the content is identical.  Adding -n causes the archives to always be identical regardless of when they are built so long as the content is identical. Its less of an issue(provided the build system in question doesn't touch or modify the man pages) when you are building from released tarballs, but if you build from git, the modification time of the file is when the file was checked out.

Tools like rpm will object to the files being installed(like say multilib versions of the same packages) together due different md5sums and the fact that they are not elf binaries, even though the files are the same.

Signature · 2 lines
Jeremy A. Puhlman
[email protected]
#3 lore raw
Quoted 48 lines · Jeremy A. Puhlman
Quoted 24 lines · John Kacur
Quoted 21 lines · Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

Add -n to gzip call to make the build output
of the manpages reproducible.

---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 8747971..1b37ba7 100644
@@ -181,7 +181,7 @@ ssdd: $(OBJDIR)/ssdd.o $(OBJDIR)/librttest.a
   $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
 
  %.8.gz: %.8
-	gzip -c $< > $@
+	gzip -nc $< > $@
 
Quoted 8 lines
Quoted 6 lines
Makefile +0 -0
  %.8.bz2: %.8
  	bzip2 -c $< > $@
Signature · 1 line
2.20.1

Could you explain to me how this makes the build output of manpages more reproducible?

gzip adds the name of the file(not really an issue) and the modification time into the header of the
gzipped archive.  Different modification times can cause the archives to have different md5sums even
though the content is identical.  Adding -n causes the archives to always be identical regardless of when
they are built so long as the content is identical. Its less of an issue(provided the build system in question
doesn't touch or modify the man pages) when you are building from released tarballs, but if you build
from git, the modification time of the file is when the file was checked out.

Quoted 11 lines

Tools like rpm will object to the files being installed(like say multilib versions of the same packages) together
due different md5sums and the fact that they are not elf binaries, even though the files are the same.

Signature · 2 lines
Jeremy A. Puhlman
[email protected]