pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

[BUG]: clang-devel: ninja needs to run twice to compile .ui file changes

Open TheTechnician27 opened this issue 3 months ago • 3 comments

Describe the Bug

When running ninja with preset=clang-devel, you need to run it twice to fully compile changes that you make in .ui files. This was consistent across files in the /pcsx2-qt/Settings directory, but I don't know if this happens elsewhere.

Reproduction Steps

  • Clone the source code for PCSX2.
  • Run cmake --preset=clang-devel.
  • In the build directory, run ninja.
  • Change something in a file like pcsx2-qt/Settings/AdvancedSettingsWidget.ui (e.g. something benign like the name parameter of a QGridLayout).
  • In the build directory, run ninja again.
  • Once it finishes compiling, immediately run ninja again without changing the source.

Expected Behavior

ninja should only need one run to compile source changes.

PCSX2 Revision

v2.5.196

Operating System

Linux (64bit) - Specify distro below

If Linux - Specify Distro

EndeavourOS

Logs & Dumps

Example of changing pcsx2-qt/Settings/AdvancedSettingsWidget.ui:

First ninja run:

[1/20] Automatic MOC and UIC for target pcsx2-qt
[2/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/CoverDownloadDialog.cpp.o
[3/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/AboutDialog.cpp.o
[4/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/GamePatchSettingsWidget.cpp.o
[5/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/DisplayWidget.cpp.o
[6/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/LogWindow.cpp.o
[7/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Debugger/DebuggerWindow.cpp.o
[8/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/AutoUpdaterDialog.cpp.o
[9/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/GameCheatSettingsWidget.cpp.o
[10/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/GameSummaryWidget.cpp.o
[11/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/GameListSettingsWidget.cpp.o
[12/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/SetupWizardDialog.cpp.o
[13/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/AchievementSettingsWidget.cpp.o
[14/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/InterfaceSettingsWidget.cpp.o
[15/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Translations.cpp.o
[16/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/SettingsWindow.cpp.o
[17/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/QtHost.cpp.o
[18/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/MainWindow.cpp.o
[19/20] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/pcsx2-qt_autogen/mocs_compilation.cpp.o
[20/20] Linking CXX executable bin/pcsx2-qt

Second ninja run:

[1/2] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/AdvancedSettingsWidget.cpp.o
[2/2] Linking CXX executable bin/pcsx2-qt

Third ninja run:

ninja: no work to do.

TheTechnician27 avatar Oct 01 '25 23:10 TheTechnician27

Does it happen with make?

F0bes avatar Oct 01 '25 23:10 F0bes

It does not happen with make. Building with make and then making the same change to the same .ui file and running make again results in:

[  0%] Built target fmt
[  3%] Built target cpuinfo
[  7%] Built target common
[  9%] Built target pcsx2-rapidyaml
[ 15%] Built target pcsx2-lzma
[ 16%] Built target libchdr
[ 18%] Built target pcsx2-soundtouch
[ 19%] Built target simpleini
[ 19%] Built target imgui
[ 32%] Built target zip
[ 35%] Built target rcheevos
[ 36%] Built target discord-rpc
[ 37%] Built target freesurround
[ 37%] Built target glad
[ 37%] Built target speex
[ 38%] Built target cubeb
[ 40%] Built target demanglegnu
[ 42%] Built target ccc
[ 46%] Built target zydis
[ 82%] Built target PCSX2
[ 87%] Built target Pcsx2_lrelease
[ 87%] Built target pcsx2-qt_autogen_timestamp_deps
[ 87%] Automatic MOC and UIC for target pcsx2-qt
[ 87%] Built target pcsx2-qt_autogen
[ 88%] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/AdvancedSettingsWidget.cpp.o
[ 88%] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/Settings/SettingsWindow.cpp.o
[ 88%] Building CXX object pcsx2-qt/CMakeFiles/pcsx2-qt.dir/pcsx2-qt_autogen/mocs_compilation.cpp.o
[ 88%] Linking CXX executable ../bin/pcsx2-qt
[ 97%] Built target pcsx2-qt
[ 98%] Built target gtest
[100%] Built target gtest_main

Running make a second time does not build anything – just reports that everything is already built.

TheTechnician27 avatar Oct 02 '25 00:10 TheTechnician27

Does this happen if you use ninja -j1 (limiting the number of ninja jobs to 1)?

TheLastRar avatar Oct 02 '25 14:10 TheLastRar