This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] dtrace: Allow for reproducible .o file builds


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]