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]

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


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


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