This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] dtrace: Allow for reproducible .o file builds
- From: "Bernhard M. Wiedemann" <bwiedemann at suse dot de>
- To: systemtap at sourceware dot org
- Cc: "Bernhard M. Wiedemann" <bwiedemann at suse dot de>
- Date: Thu, 10 Aug 2017 22:29:06 +0200
- Subject: [PATCH] dtrace: Allow for reproducible .o file builds
- Authentication-results: sourceware.org; auth=none
When building packages like libvirt on openSUSE
that link a libvirt_probes.o from dtrace
the build results differed across builds,
because the source's temporary filename was in the .o
See https://reproducible-builds.org/ for why this matters.
---
I tried to think of downsides of not using mkstemp
such as malicious symlink overwrite (unlikely in build dir)
or problems with parallel builds (make -j),
but think it should be fine
---
dtrace.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dtrace.in b/dtrace.in
index 5e1cf80..2e2e002 100644
--- a/dtrace.in
+++ b/dtrace.in
@@ -410,7 +410,7 @@ def main():
else:
print("header: " + fname)
- (ignore, fname) = mkstemp(suffix=".c")
+ fname = filename + ".dtrace-temp.c"
fdesc = open(fname, mode='w')
providers.semaphore_write(fdesc)
fdesc.close()
--
2.12.3