https://bugs.winehq.org/show_bug.cgi?id=41342
Bug ID: 41342 Summary: Build with winegcc is not reproducible Product: Wine Version: 1.9.19 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: javier--fqu3sqxsVIm7PkQvPySPMwTV4r0Nxk@jasp.net Distribution: ---
Building with winegcc is not reproducible because the name of a temporary file is included.[1] The function that creates this file should try
char* tmp = strmake("%s%s", prefix, suffix); fd = open(tmp, O_CREAT | O_EXCL, 0600);
before mkstemps().[2]
About reproducible builds: https://reproducible-builds.org/
[1] https://tests.reproducible-builds.org/debian/dbd/unstable/i386/lmms_1.1.3-5.... , look for "spec.". [2] http://source.winehq.org/git/wine.git/blob/HEAD:/tools/winegcc/winegcc.c#l26...
https://bugs.winehq.org/show_bug.cgi?id=41342
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com Component|-unknown |tools Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Keywords| |download, source
--- Comment #1 from Austin English austinenglish@gmail.com --- If you've got the problem debugged, could you go ahead and send a patch?
See https://wiki.winehq.org/SubmittingPatches
https://bugs.winehq.org/show_bug.cgi?id=41342
Jens Reyer jre.winesim@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jre.winesim@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=41342
Detlef Riekenberg wine.dev@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wine.dev@web.de
https://bugs.winehq.org/show_bug.cgi?id=41342
--- Comment #2 from Artem S. Tashkinov aros@gmx.com --- This is still the case with Wine 10.0-rc1.
This affects the following libraries: * http.sys.so * mountmgr.sys.so * nsiproxy.sys.so * winebth.sys.so * winebus.sys.so * winehid.sys.so * winexinput.sys.so
Alexandre, is there any chance to solve it for Wine 10?
https://bugs.winehq.org/show_bug.cgi?id=41342
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #3 from Fabian Maurer dark.shadow4@web.de --- Stupid question, but how exactly did you test that? Do you know what the issue is?
https://bugs.winehq.org/show_bug.cgi?id=41342
--- Comment #4 from Austin English austinenglish@gmail.com --- (In reply to Fabian Maurer from comment #3)
Stupid question, but how exactly did you test that?
austin@debian:~/wine-git/dlls/http.sys$ sha1sum x86_64-windows/http.sys a3fa44dd810fbc13cdd53cd86e12ec9ea73ef129 x86_64-windows/http.sys
austin@debian:~/wine-git/dlls/http.sys$ make clean ; make ; sha1sum x86_64-windows/http.sys ... 05b75ec12c694afb1507c3549f7b2e0a7a3d79ad x86_64-windows/http.sys
austin@debian:~/wine-git/dlls/http.sys$ make clean ; make ; sha1sum x86_64-windows/http.sys ... 64dcf391bb59fcd8b25b34ee3e4e6b4f08313f1a x86_64-windows/http.sys
https://bugs.winehq.org/show_bug.cgi?id=41342
--- Comment #5 from Fabian Maurer dark.shadow4@web.de --- @Austin Yes, but that is the case for everything, even kernel32.dll, which is not on this list. I assume there is more you need to do for reproducible builds
https://bugs.winehq.org/show_bug.cgi?id=41342
--- Comment #6 from Fabian Maurer dark.shadow4@web.de --- Created attachment 77640 --> https://bugs.winehq.org/attachment.cgi?id=77640 Patch
The problem for those sys files is that they don't have a spec file defined, so the spec file defaults to the output file name:
static void init_dll_name( DLLSPEC *spec ) { if (!spec->file_name && output_file_name) ... spec->file_name = xstrdup( output_file_name );
This file comes from "make_temp_file":
unsigned int value = time(NULL) + getpid();
so the file is like
tmp67665c79/http-00000000.spec.o
This breaks reproducible builds.
Attached patch should help.
https://bugs.winehq.org/show_bug.cgi?id=41342
--- Comment #7 from Fabian Maurer dark.shadow4@web.de --- FWIW, for a PE build you need (at least)
export CROSSLDFLAGS="-Wl,--no-insert-timestamp"
for it to be reproducible. Not sure if that is something for upstream?