Skip to content

Conversation

pestophagous
Copy link
Member

@pestophagous pestophagous commented Apr 29, 2025

Adding a very simple CMakeLists.txt, main.cpp, and Main.qml, along with some scripts so that this is compiled in a GitHub CI runner for win64_msvc2019_64 using Qt 6.5.3.

This reproduces the issue described at https://forum.qt.io/topic/146961/building-qt6-5-with-nmake-error

However, skip ahead to the very next PR in this repo (a PR that will also be marked as draft and then closed without merging it), and in the next PR (PR #121) you can see that updating from Qt 6.5.3 to Qt 6.7.3 eliminates the problem. 🎉

with nmake on win64_msvc2019_64 using Qt 6.5.3 (as in this PR), the error looks like:

[ 25%] Built target appReproducejsonbug_automoc_json_extraction
	"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HOSTx64\x64\nmake.exe"  -f CMakeFiles\appReproducejsonbug.dir\build.make /nologo -L                  CMakeFiles\appReproducejsonbug.dir\depend
[ 30%] Automatic QML type registration for target appReproducejsonbug
	call .qt\bin\qt_setup_tool_path.bat D:/a/qt-qml-project-template-with-ci/qt-qml-project-template-with-ci/dl_third_party/Qt_desktop/6.5.3/msvc2019_64/./bin/qmltyperegistrar.exe --generate-qmltypes=D:/a/qt-qml-project-template-with-ci/qt-qml-project-template-with-ci/cbuild/Reproducejsonbug/appReproducejsonbug.qmltypes --import-name=Reproducejsonbug --major-version=1 --minor-version=0 @D:/a/qt-qml-project-template-with-ci/qt-qml-project-template-with-ci/cbuild/qmltypes/appReproducejsonbug_foreign_types.txt -o D:/a/qt-qml-project-template-with-ci/qt-qml-project-template-with-ci/cbuild/appreproducejsonbug_qmltyperegistrations.cpp D:/a/qt-qml-project-template-with-ci/qt-qml-project-template-with-ci/cbuild/meta_types/qt6appreproducejsonbug_debug_metatypes.json
Error 5 while parsing D:/a/qt-qml-project-template-with-ci/qt-qml-project-template-with-ci/cbuild/meta_types/qt6appreproducejsonbug_debug_metatypes.json: illegal value
NMAKE : fatal error U1077: 'call' : return code '0x1'
Stop.

As shown in the log: https://github.com/219-design/qt-qml-project-template-with-ci/actions/runs/14743379442

(However, the log will expire after a few days. You'd want to clone or fork this repro if you have any desire to reproduce this again.)

#buggy_genfile=meta_types/qt6appreproducejsonbug_debug_metatypes.json
#if [ ! -s "$buggy_genfile" ]; then
# echo "{}" >> "$buggy_genfile"
#fi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if for any reason you have to use 6.5.3 and work around this bug, then uncomment the workaround shown here on lines 46,47,48,49

@pestophagous
Copy link
Member Author

Closing. This was always simply for testing and never intended to merge.

@pestophagous pestophagous deleted the json_bug_repro branch September 25, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant