From b2f4d9cdec2de2af7200e321ac84e27b04a4d058 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 9 Aug 2023 00:40:19 +0200 Subject: [PATCH 1/4] fixed #8659 - aligned contents of all install packages --- .github/workflows/release-windows.yml | 19 +++++++++++++++++++ CMakeLists.txt | 4 +++- Makefile | 1 + cli/CMakeLists.txt | 10 +++++++++- lib/cppcheck.vcxproj | 12 ++++++++---- tools/dmake/dmake.cpp | 1 + win_installer/cppcheck.wxs | 3 ++- 7 files changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 2da689c3529..51599477986 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -114,11 +114,21 @@ jobs: run: | @echo on move build\bin\Release win_installer\files || exit /b !errorlevel! + copy AUTHORS win_installer\files\authors.txt || exit /b !errorlevel! + copy readme.txt win_installer\files\ || exit /b !errorlevel! + copy win_installer\GPLv3.txt win_installer\files\ || exit /b !errorlevel! + copy externals\picojson\LICENSE win_installer\files\picojson-license.txt || exit /b !errorlevel! + copy externals\simplecpp\LICENSE win_installer\files\simplecpp-license.txt || exit /b !errorlevel! + copy externals\tinyxml2\LICENSE win_installer\files\tinyxml2-license.txt || exit /b !errorlevel! copy addons\dist\misra\*.* win_installer\files\addons || exit /b !errorlevel! copy bin\cppcheck.exe win_installer\files || exit /b !errorlevel! copy bin\cppcheck-core.dll win_installer\files || exit /b !errorlevel! :: mkdir win_installer\files\help || exit /b !errorlevel! xcopy /s gui\help win_installer\files\help || exit /b !errorlevel! + copy gui\help\online-help.qhc win_installer\files\ || exit /b !errorlevel! + copy gui\help\online-help.qch win_installer\files\ || exit /b !errorlevel! + del win_installer\files\cfg\*.rng || exit /b !errorlevel! + del win_installer\files\platforms\*.rng || exit /b !errorlevel! del win_installer\files\translations\*.qm || exit /b !errorlevel! move build\gui\*.qm win_installer\files\translations || exit /b !errorlevel! :: copy libcrypto-3-x64.dll and libssl-3-x64.dll @@ -148,16 +158,25 @@ jobs: run: | @echo on :: del win_installer\files\addons\*.dll || exit /b !errorlevel! + del win_installer\files\addons\*.doxyfile || exit /b !errorlevel! + del win_installer\files\addons\*.md || exit /b !errorlevel! :: del win_installer\files\addons\*.pyd || exit /b !errorlevel! :: del win_installer\files\addons\base_library.zip || exit /b !errorlevel! + rmdir /s /q win_installer\files\addons\test || exit /b !errorlevel! + rmdir /s /q win_installer\files\addons\doc || exit /b !errorlevel! :: rmdir /s /q win_installer\files\bearer || exit /b !errorlevel! + rmdir /s /q win_installer\files\generic || exit /b !errorlevel! rmdir /s /q win_installer\files\help || exit /b !errorlevel! rmdir /s /q win_installer\files\iconengines || exit /b !errorlevel! rmdir /s /q win_installer\files\imageformats || exit /b !errorlevel! + rmdir /s /q win_installer\files\networkinformation || exit /b !errorlevel! :: rmdir /s /q win_installer\files\printsupport || exit /b !errorlevel! rmdir /s /q win_installer\files\sqldrivers || exit /b !errorlevel! + rmdir /s /q win_installer\files\tls || exit /b !errorlevel! ren win_installer\files\translations lang || exit /b !errorlevel! del win_installer\files\d3dcompiler_47.dll || exit /b !errorlevel! + del win_installer\files\dxcompiler.dll || exit /b !errorlevel! + del win_installer\files\dxil.dll || exit /b !errorlevel! del win_installer\files\dmake.exe || exit /b !errorlevel! del win_installer\files\dmake.pdb || exit /b !errorlevel! :: del win_installer\files\libEGL.dll || exit /b !errorlevel! diff --git a/CMakeLists.txt b/CMakeLists.txt index a3b6da6b440..18b0d0c94fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,8 @@ endif() include(cmake/printInfo.cmake) -file(GLOB addons "addons/*.py") +file(GLOB addons_py "addons/*.py") +file(GLOB addons_json "addons/*.json") file(GLOB cfgs "cfg/*.cfg") file(GLOB platforms "platforms/*.xml") @@ -85,6 +86,7 @@ add_custom_target(copy_cfg ALL "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/cfg" COMMENT "Copying cfg files to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}") +# TODO: copy *.py and *.json only add_custom_target(copy_addons ALL ${CMAKE_COMMAND} -E copy_directory "${PROJECT_SOURCE_DIR}/addons" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/addons" diff --git a/Makefile b/Makefile index b19f746feae..bc13248e979 100644 --- a/Makefile +++ b/Makefile @@ -395,6 +395,7 @@ install: cppcheck ifdef FILESDIR install -d ${DESTDIR}${FILESDIR} install -d ${DESTDIR}${FILESDIR}/addons + install -m 644 addons/*.json ${DESTDIR}${FILESDIR}/addons install -m 644 addons/*.py ${DESTDIR}${FILESDIR}/addons install -d ${DESTDIR}${FILESDIR}/cfg install -m 644 cfg/*.cfg ${DESTDIR}${FILESDIR}/cfg diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index c05743becb3..22f17dda390 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -75,7 +75,15 @@ if (BUILD_CLI) RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) - install(FILES ${addons} + install(PROGRAMS ${CMAKE_SOURCE_DIR}/htmlreport/cppcheck-htmlreport + RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + COMPONENT applications) + + install(FILES ${addons_py} + DESTINATION ${FILESDIR_DEF}/addons + COMPONENT headers) + + install(FILES ${addons_json} DESTINATION ${FILESDIR_DEF}/addons COMPONENT headers) diff --git a/lib/cppcheck.vcxproj b/lib/cppcheck.vcxproj index ad00b1d8c0b..6074eb664cb 100644 --- a/lib/cppcheck.vcxproj +++ b/lib/cppcheck.vcxproj @@ -278,7 +278,8 @@ true - xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y + xcopy "$(SolutionDir)addons/*.py" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)addons/*.json" "$(OutDir)addons" /E /I /D /Y xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -310,7 +311,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true - xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y + xcopy "$(SolutionDir)addons/*.py" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)addons/*.json" "$(OutDir)addons" /E /I /D /Y xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -350,7 +352,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true - xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y + xcopy "$(SolutionDir)addons/*.py" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)addons/*.json" "$(OutDir)addons" /E /I /D /Y xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -391,7 +394,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true - xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y + xcopy "$(SolutionDir)addons/*.py" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)addons/*.json" "$(OutDir)addons" /E /I /D /Y xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y diff --git a/tools/dmake/dmake.cpp b/tools/dmake/dmake.cpp index 356979895b5..b43e9da29eb 100644 --- a/tools/dmake/dmake.cpp +++ b/tools/dmake/dmake.cpp @@ -773,6 +773,7 @@ int main(int argc, char **argv) fout << "ifdef FILESDIR\n"; fout << "\tinstall -d ${DESTDIR}${FILESDIR}\n"; fout << "\tinstall -d ${DESTDIR}${FILESDIR}/addons\n"; + fout << "\tinstall -m 644 addons/*.json ${DESTDIR}${FILESDIR}/addons\n"; fout << "\tinstall -m 644 addons/*.py ${DESTDIR}${FILESDIR}/addons\n"; fout << "\tinstall -d ${DESTDIR}${FILESDIR}/cfg\n"; fout << "\tinstall -m 644 cfg/*.cfg ${DESTDIR}${FILESDIR}/cfg\n"; diff --git a/win_installer/cppcheck.wxs b/win_installer/cppcheck.wxs index 984003eb6e8..703e340ec9b 100644 --- a/win_installer/cppcheck.wxs +++ b/win_installer/cppcheck.wxs @@ -155,15 +155,16 @@ + + - From 37368a4763f0d6cd65cd4e3b7db6d5c2ee650d40 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 16 Oct 2024 13:12:42 +0200 Subject: [PATCH 2/4] .gitignore: added `pyinstaller` output files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 432ecf71808..82da0fdf893 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,7 @@ compile_commands.json # GDB configuration .gdbinit + +# pyinstaller output +/addons/dist +/addons/misra.spec From 764c1a5b8ff7fb6aa30c96db4a85d44e50e10fcb Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 11 Oct 2024 19:12:20 +0200 Subject: [PATCH 3/4] release-windows.yml: generate `cppcheck-htmlreport` binary --- .github/workflows/release-windows.yml | 12 +++++++++++- .gitignore | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 51599477986..381e525525c 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -103,13 +103,22 @@ jobs: name: bin path: bin - - name: Compile misra.py executable + - name: Install missing Python packages run: | pip install -U pyinstaller || exit /b !errorlevel! + + - name: Compile misra.py executable + run: | cd addons || exit /b !errorlevel! pyinstaller --hidden-import xml --hidden-import xml.etree --hidden-import xml.etree.ElementTree misra.py || exit /b !errorlevel! del *.spec || exit /b !errorlevel! + - name: Compile cppcheck-htmlreport executable + run: | + cd htmlreport || exit /b !errorlevel! + pyinstaller cppcheck-htmlreport || exit /b !errorlevel! + del *.spec || exit /b !errorlevel! + - name: Collect files run: | @echo on @@ -131,6 +140,7 @@ jobs: del win_installer\files\platforms\*.rng || exit /b !errorlevel! del win_installer\files\translations\*.qm || exit /b !errorlevel! move build\gui\*.qm win_installer\files\translations || exit /b !errorlevel! + copy htmlreport\dist\cppcheck-htmlreport\*.* win_installer\files || exit /b !errorlevel! :: copy libcrypto-3-x64.dll and libssl-3-x64.dll copy %RUNNER_WORKSPACE%\Qt\Tools\OpenSSLv3\Win_x64\bin\lib*.dll win_installer\files || exit /b !errorlevel! diff --git a/.gitignore b/.gitignore index 82da0fdf893..bcc91b69fcb 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,5 @@ compile_commands.json # pyinstaller output /addons/dist /addons/misra.spec +/htmlreport/cppcheck-htmlreport.spec +/htmlreport/dist From 3e5f7caa860b091d4c2221abb3c3e442154c53b5 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 18 Oct 2024 17:27:37 +0200 Subject: [PATCH 4/4] release-windows.yml: some TODOs and cleanups --- .github/workflows/release-windows.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 381e525525c..dc5cca2955c 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -79,6 +79,7 @@ jobs: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On || exit /b !errorlevel! cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel! + # TODO: package PDBs - name: Deploy app run: | windeployqt build\bin\Release || exit /b !errorlevel! @@ -107,18 +108,22 @@ jobs: run: | pip install -U pyinstaller || exit /b !errorlevel! + # TODO: include in installer? - name: Compile misra.py executable run: | cd addons || exit /b !errorlevel! pyinstaller --hidden-import xml --hidden-import xml.etree --hidden-import xml.etree.ElementTree misra.py || exit /b !errorlevel! del *.spec || exit /b !errorlevel! + # TODO: include in installer? - name: Compile cppcheck-htmlreport executable run: | cd htmlreport || exit /b !errorlevel! pyinstaller cppcheck-htmlreport || exit /b !errorlevel! del *.spec || exit /b !errorlevel! + # TODO: test the compiled Python files + - name: Collect files run: | @echo on