This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] dtrace: Allow for reproducible .o file builds
- From: David Smith <dsmith at redhat dot com>
- To: "Bernhard M. Wiedemann" <bwiedemann at suse dot de>
- Cc: systemtap at sourceware dot org
- Date: Mon, 14 Aug 2017 16:37:39 -0500
- Subject: Re: [PATCH] dtrace: Allow for reproducible .o file builds
- Authentication-results: sourceware.org; auth=none
- References: <20170810202906.11500-1-bwiedemann@suse.de>
On Thu, Aug 10, 2017 at 3:29 PM, Bernhard M. Wiedemann
<bwiedemann@suse.de> wrote:
> 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()
I couldn't really see any downsides of not using mkstemp either, so I
added this in commit c245153ca.
Thanks for the patch.
--
David Smith
Principal Software Engineer
Red Hat