Empty Qt program can not be build reproducable
-
wrote on 11 May 2021, 11:35 last edited by
Hi All,
I'm trying to get my Qt to build reproducible. I notice two things:
-
When an empty Qt Widgets application is build, and after a few moments is build again, the .exe file is different. It seems to be there's a timestamp in there. How can I disable that timestamp?
-
When an empty Qt Widgets application is build, and then a line is added in main.cpp (in a non-defined #ifdef construction), both main.o and the .exe file are changed. How can this be? Why does main.o change if invisible lines are added to the .cpp file?
I'm trying to make a program with 2 variants. All the changes between the variants are behind a #ifdef construction. I'm trying to prove the original program is unchanged if the define is not defined. Is there a way to do that?
To reproduce:
Start Qt creator file-new file or project Application(Qt) qt widgets application choose name: untitled6 next build system: qmake details: Mainwindow (defaults) next translation: <none> next kits: Desktop Qt 5.14.2 MinGW 32-bit next finish F5 (start debugging of startup project) Close MainWindow and close Qt creator rename the build folder open untitled6.pro again, and press F5 again. Compare the two build folders. .exe is different rename the build folder Add these lines in main.c: #ifdef NOT_DEFINED qint64 temp; #endif After a rebuild, both main.o and untitled6.exe are changed
My versions:
Qt creator 4.12.0 Based on Qt 5.14.2 (MSVC 2017, 32 bit) from revision 10fece1795
\Qt\5.14.2\mingw73_32
Windows 10 Enterprise Version 1909 OS build 18363.1440
Compile output:
13:31:54: Running steps for project untitled6... 13:31:54: Starting: "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" clean -j12 C:/Qt/Tools/mingw730_32/bin/mingw32-make -f Makefile.Debug clean C:/Qt/Tools/mingw730_32/bin/mingw32-make -f Makefile.Release clean mingw32-make[1]: Entering directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' del debug\moc_predefs.h del debug\moc_mainwindow.cpp mingw32-make[1]: Entering directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' del release\moc_predefs.h del ui_mainwindow.h del release\moc_mainwindow.cpp del ui_mainwindow.h Could Not Find O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug\release\moc_predefs.h Could Not Find O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug\release\moc_mainwindow.cpp Could Not Find O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug\ui_mainwindow.h del release\main.o release\mainwindow.o release\moc_mainwindow.o del debug\main.o debug\mainwindow.o debug\moc_mainwindow.o Could Not Find O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug\release\main.o mingw32-make[1]: Leaving directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' mingw32-make[1]: Leaving directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' 13:31:55: The process "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited normally. 13:31:55: Starting: "C:\Qt\5.14.2\mingw73_32\bin\qmake.exe" "O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\untitled6\untitled6.pro" -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" 13:31:56: The process "C:\Qt\5.14.2\mingw73_32\bin\qmake.exe" exited normally. 13:31:56: Starting: "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" -f "O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug/Makefile" qmake_all mingw32-make: Nothing to be done for 'qmake_all'. 13:31:56: The process "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited normally. 13:31:56: Starting: "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" -j12 C:/Qt/Tools/mingw730_32/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' C:\Qt\5.14.2\mingw73_32\bin\uic.exe ..\untitled6\mainwindow.ui -o ui_mainwindow.h g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\untitled6 -I. -IC:\Qt\5.14.2\mingw73_32\include -IC:\Qt\5.14.2\mingw73_32\include\QtWidgets -IC:\Qt\5.14.2\mingw73_32\include\QtGui -IC:\Qt\5.14.2\mingw73_32\include\QtANGLE -IC:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++ -o debug\main.o ..\untitled6\main.cpp g++ -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -dM -E -o debug\moc_predefs.h C:\Qt\5.14.2\mingw73_32\mkspecs\features\data\dummy.cpp g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\untitled6 -I. -IC:\Qt\5.14.2\mingw73_32\include -IC:\Qt\5.14.2\mingw73_32\include\QtWidgets -IC:\Qt\5.14.2\mingw73_32\include\QtGui -IC:\Qt\5.14.2\mingw73_32\include\QtANGLE -IC:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++ -o debug\mainwindow.o ..\untitled6\mainwindow.cpp C:\Qt\5.14.2\mingw73_32\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include "O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug/debug/moc_predefs.h" -IC:/Qt/5.14.2/mingw73_32/mkspecs/win32-g++ -I"O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/untitled6" -IC:/Qt/5.14.2/mingw73_32/include -IC:/Qt/5.14.2/mingw73_32/include/QtWidgets -IC:/Qt/5.14.2/mingw73_32/include/QtGui -IC:/Qt/5.14.2/mingw73_32/include/QtANGLE -IC:/Qt/5.14.2/mingw73_32/include/QtCore -I. -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -IC:/Qt/Tools/mingw730_32/i686-w64-mingw32/include ..\untitled6\mainwindow.h -o debug\moc_mainwindow.cpp g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\untitled6 -I. -IC:\Qt\5.14.2\mingw73_32\include -IC:\Qt\5.14.2\mingw73_32\include\QtWidgets -IC:\Qt\5.14.2\mingw73_32\include\QtGui -IC:\Qt\5.14.2\mingw73_32\include\QtANGLE -IC:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++ -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp g++ -Wl,-subsystem,windows -mthreads -o debug\untitled6.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o C:\Qt\5.14.2\mingw73_32\lib\libQt5Widgets.a C:\Qt\5.14.2\mingw73_32\lib\libQt5Gui.a C:\Qt\5.14.2\mingw73_32\lib\libQt5Core.a -lmingw32 C:\Qt\5.14.2\mingw73_32\lib\libqtmain.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-win32\lib -LC:\Utils\postgresql\pgsql\lib -lshell32 mingw32-make[1]: Leaving directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' 13:31:59: The process "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited normally. 13:31:59: Elapsed time: 00:05.
-
-
Hi All,
I'm trying to get my Qt to build reproducible. I notice two things:
-
When an empty Qt Widgets application is build, and after a few moments is build again, the .exe file is different. It seems to be there's a timestamp in there. How can I disable that timestamp?
-
When an empty Qt Widgets application is build, and then a line is added in main.cpp (in a non-defined #ifdef construction), both main.o and the .exe file are changed. How can this be? Why does main.o change if invisible lines are added to the .cpp file?
I'm trying to make a program with 2 variants. All the changes between the variants are behind a #ifdef construction. I'm trying to prove the original program is unchanged if the define is not defined. Is there a way to do that?
To reproduce:
Start Qt creator file-new file or project Application(Qt) qt widgets application choose name: untitled6 next build system: qmake details: Mainwindow (defaults) next translation: <none> next kits: Desktop Qt 5.14.2 MinGW 32-bit next finish F5 (start debugging of startup project) Close MainWindow and close Qt creator rename the build folder open untitled6.pro again, and press F5 again. Compare the two build folders. .exe is different rename the build folder Add these lines in main.c: #ifdef NOT_DEFINED qint64 temp; #endif After a rebuild, both main.o and untitled6.exe are changed
My versions:
Qt creator 4.12.0 Based on Qt 5.14.2 (MSVC 2017, 32 bit) from revision 10fece1795
\Qt\5.14.2\mingw73_32
Windows 10 Enterprise Version 1909 OS build 18363.1440
Compile output:
13:31:54: Running steps for project untitled6... 13:31:54: Starting: "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" clean -j12 C:/Qt/Tools/mingw730_32/bin/mingw32-make -f Makefile.Debug clean C:/Qt/Tools/mingw730_32/bin/mingw32-make -f Makefile.Release clean mingw32-make[1]: Entering directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' del debug\moc_predefs.h del debug\moc_mainwindow.cpp mingw32-make[1]: Entering directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' del release\moc_predefs.h del ui_mainwindow.h del release\moc_mainwindow.cpp del ui_mainwindow.h Could Not Find O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug\release\moc_predefs.h Could Not Find O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug\release\moc_mainwindow.cpp Could Not Find O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug\ui_mainwindow.h del release\main.o release\mainwindow.o release\moc_mainwindow.o del debug\main.o debug\mainwindow.o debug\moc_mainwindow.o Could Not Find O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug\release\main.o mingw32-make[1]: Leaving directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' mingw32-make[1]: Leaving directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' 13:31:55: The process "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited normally. 13:31:55: Starting: "C:\Qt\5.14.2\mingw73_32\bin\qmake.exe" "O:\Elektronica Jobs\4018401 Felle Kastverlichting\Qt\reproducable-test\untitled6\untitled6.pro" -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" 13:31:56: The process "C:\Qt\5.14.2\mingw73_32\bin\qmake.exe" exited normally. 13:31:56: Starting: "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" -f "O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug/Makefile" qmake_all mingw32-make: Nothing to be done for 'qmake_all'. 13:31:56: The process "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited normally. 13:31:56: Starting: "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" -j12 C:/Qt/Tools/mingw730_32/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' C:\Qt\5.14.2\mingw73_32\bin\uic.exe ..\untitled6\mainwindow.ui -o ui_mainwindow.h g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\untitled6 -I. -IC:\Qt\5.14.2\mingw73_32\include -IC:\Qt\5.14.2\mingw73_32\include\QtWidgets -IC:\Qt\5.14.2\mingw73_32\include\QtGui -IC:\Qt\5.14.2\mingw73_32\include\QtANGLE -IC:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++ -o debug\main.o ..\untitled6\main.cpp g++ -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -dM -E -o debug\moc_predefs.h C:\Qt\5.14.2\mingw73_32\mkspecs\features\data\dummy.cpp g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\untitled6 -I. -IC:\Qt\5.14.2\mingw73_32\include -IC:\Qt\5.14.2\mingw73_32\include\QtWidgets -IC:\Qt\5.14.2\mingw73_32\include\QtGui -IC:\Qt\5.14.2\mingw73_32\include\QtANGLE -IC:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++ -o debug\mainwindow.o ..\untitled6\mainwindow.cpp C:\Qt\5.14.2\mingw73_32\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include "O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug/debug/moc_predefs.h" -IC:/Qt/5.14.2/mingw73_32/mkspecs/win32-g++ -I"O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/untitled6" -IC:/Qt/5.14.2/mingw73_32/include -IC:/Qt/5.14.2/mingw73_32/include/QtWidgets -IC:/Qt/5.14.2/mingw73_32/include/QtGui -IC:/Qt/5.14.2/mingw73_32/include/QtANGLE -IC:/Qt/5.14.2/mingw73_32/include/QtCore -I. -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -IC:/Qt/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -IC:/Qt/Tools/mingw730_32/i686-w64-mingw32/include ..\untitled6\mainwindow.h -o debug\moc_mainwindow.cpp g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\untitled6 -I. -IC:\Qt\5.14.2\mingw73_32\include -IC:\Qt\5.14.2\mingw73_32\include\QtWidgets -IC:\Qt\5.14.2\mingw73_32\include\QtGui -IC:\Qt\5.14.2\mingw73_32\include\QtANGLE -IC:\Qt\5.14.2\mingw73_32\include\QtCore -Idebug -I. -IC:\Qt\5.14.2\mingw73_32\mkspecs\win32-g++ -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp g++ -Wl,-subsystem,windows -mthreads -o debug\untitled6.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o C:\Qt\5.14.2\mingw73_32\lib\libQt5Widgets.a C:\Qt\5.14.2\mingw73_32\lib\libQt5Gui.a C:\Qt\5.14.2\mingw73_32\lib\libQt5Core.a -lmingw32 C:\Qt\5.14.2\mingw73_32\lib\libqtmain.a -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.7.25-win32\lib -LC:\Utils\postgresql\pgsql\lib -lshell32 mingw32-make[1]: Leaving directory 'O:/Elektronica Jobs/4018401 Felle Kastverlichting/Qt/reproducable-test/build-untitled6-Desktop_Qt_5_14_2_MinGW_32_bit-Debug' 13:31:59: The process "C:\Qt\Tools\mingw730_32\bin\mingw32-make.exe" exited normally. 13:31:59: Elapsed time: 00:05.
@cdwijs What you describe is normal. Building same code two times with same tools does not yield exact same binaries (because of time stamps and what ever else).
You can read here how to solve this: https://reproducible-builds.org/docs/ -
-
@cdwijs What you describe is normal. Building same code two times with same tools does not yield exact same binaries (because of time stamps and what ever else).
You can read here how to solve this: https://reproducible-builds.org/docs/wrote on 11 May 2021, 12:01 last edited by@jsulm said in Empty Qt program can not be build reproducable:
@cdwijs What you describe is normal. Building same code two times with same tools does not yield exact same binaries (because of time stamps and what ever else).
You can read here how to solve this: https://reproducible-builds.org/docs/Thank you. I've read that site, but I couldn't figure out howto apply those lessons to this specific program. Could you give me a hint to disable time stamps?
I think I've figured out why these two snippets yield a different .o file in debug mode. The .o file contains information about line numbers. In release mode, the .o files stay the same:
int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); #ifdef NOT_DEFINED qint64 a; #endif MainWindow w; w.show(); return a.exec(); }
-
@jsulm said in Empty Qt program can not be build reproducable:
@cdwijs What you describe is normal. Building same code two times with same tools does not yield exact same binaries (because of time stamps and what ever else).
You can read here how to solve this: https://reproducible-builds.org/docs/Thank you. I've read that site, but I couldn't figure out howto apply those lessons to this specific program. Could you give me a hint to disable time stamps?
I think I've figured out why these two snippets yield a different .o file in debug mode. The .o file contains information about line numbers. In release mode, the .o files stay the same:
int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
int main(int argc, char *argv[]) { QApplication a(argc, argv); #ifdef NOT_DEFINED qint64 a; #endif MainWindow w; w.show(); return a.exec(); }
@cdwijs said in Empty Qt program can not be build reproducable:
Could you give me a hint to disable time stamps?
No, so far this topic was not on my todo list.
Is there a reason why you need reproducible builds? Usually you would simply sign a build to verify later that it is valid.
-
@cdwijs said in Empty Qt program can not be build reproducable:
Could you give me a hint to disable time stamps?
No, so far this topic was not on my todo list.
Is there a reason why you need reproducible builds? Usually you would simply sign a build to verify later that it is valid.
wrote on 11 May 2021, 12:16 last edited by@jsulm said in Empty Qt program can not be build reproducable:
Is there a reason why you need reproducible builds? Usually you would simply sign a build to verify later that it is valid.
I don't actually need reproducible builds. I however have a good working program, that I don't want to change, but my customer wants a slightly different version. I would like to guarantee that the standard version still works, while I work at the different version. In pseudocode:
#ifdef CUSTOMER_SPECIFIC specificInitialize(); #else genericInitialize(); #endif CommonCode(); #ifdef CUSTOMER_SPECIFIC doSomethingSpecific(); #else doSomething #endif moreCommonCode(); #ifdef CUSTOMER_SPECIFIC smallExtraStep() #else #endif
I am looking for a way to prove the above code stays in the following state when CUSTOMER_SPECIFIC is not defined
genericInitialize(); CommonCode(); doSomething moreCommonCode();
Reproducable builds would give that guarantee, but comparing preprocessed C++ code would also have the desired effect.
-
@jsulm said in Empty Qt program can not be build reproducable:
Is there a reason why you need reproducible builds? Usually you would simply sign a build to verify later that it is valid.
I don't actually need reproducible builds. I however have a good working program, that I don't want to change, but my customer wants a slightly different version. I would like to guarantee that the standard version still works, while I work at the different version. In pseudocode:
#ifdef CUSTOMER_SPECIFIC specificInitialize(); #else genericInitialize(); #endif CommonCode(); #ifdef CUSTOMER_SPECIFIC doSomethingSpecific(); #else doSomething #endif moreCommonCode(); #ifdef CUSTOMER_SPECIFIC smallExtraStep() #else #endif
I am looking for a way to prove the above code stays in the following state when CUSTOMER_SPECIFIC is not defined
genericInitialize(); CommonCode(); doSomething moreCommonCode();
Reproducable builds would give that guarantee, but comparing preprocessed C++ code would also have the desired effect.
@cdwijs said in Empty Qt program can not be build reproducable:
I would like to guarantee that the standard version still works
Why do you need reproducible builds for that? If you're using a code version system (like Git) you can always build a specific state of your code tree. The binaries will not be exactly same, but they will do the same (the differences are because of unrelated things like time stamps which do not change the functionality). So, I don't know why you think you need reproducible builds.
To guarantee that a version works you need tests, not reproducible builds. Because reproducible builds do not say anything about correctness of your software.
-
@jsulm said in Empty Qt program can not be build reproducable:
Is there a reason why you need reproducible builds? Usually you would simply sign a build to verify later that it is valid.
I don't actually need reproducible builds. I however have a good working program, that I don't want to change, but my customer wants a slightly different version. I would like to guarantee that the standard version still works, while I work at the different version. In pseudocode:
#ifdef CUSTOMER_SPECIFIC specificInitialize(); #else genericInitialize(); #endif CommonCode(); #ifdef CUSTOMER_SPECIFIC doSomethingSpecific(); #else doSomething #endif moreCommonCode(); #ifdef CUSTOMER_SPECIFIC smallExtraStep() #else #endif
I am looking for a way to prove the above code stays in the following state when CUSTOMER_SPECIFIC is not defined
genericInitialize(); CommonCode(); doSomething moreCommonCode();
Reproducable builds would give that guarantee, but comparing preprocessed C++ code would also have the desired effect.
@cdwijs said in Empty Qt program can not be build reproducable:
I am looking for a way to prove the above code stays in the following state when CUSTOMER_SPECIFIC is not defined
This is guaranteed by preprocessor/compiler. How would reproducible build guarantee the order of this calls in your code?
1/7