mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[GH-ISSUE #542] Added caching in actions #119
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#119
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @georgemoralis on GitHub (Aug 23, 2024).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/542
Especially windows builds are slow maybe caching can be added in ci
@aidenzzz commented on GitHub (Aug 23, 2024):
Maybe something like this?
@georgemoralis commented on GitHub (Aug 24, 2024):
That could probably work somehow yes
@LeDragoX commented on GitHub (Aug 27, 2024):
I tried using your example and reading through the updated docs https://github.com/actions/cache and
I've only managed to improve the "Configure CMake" time, maybe I've done something wrong.
So, I'm thinking about switching it to https://github.com/hendrikmuhs/ccache-action and see if it helps with the build time (hoping the hash keys will match)
Is this a great option?
@Artalus commented on GitHub (Sep 16, 2024):
#622 now speeds up Linux and Mac builds, but @LeDragoX mentioned that they could not set up
ccachefor Windows builds. Speaking from my experience maintaining my company's CI,ccacheindeed does not behave when CMake is configured to use MSBuild*. The alternative for me was to build our CMake projects using Ninja** instead. Moreover, Ninja on its own is already faster than MSBuild even without compiler caching.There is a caveat though: some directives in
CMakeListsare handled differently by the two generators***. So if only Ninja were to be used in CI, a subtle bug inCMakeLists.txtcould evade the automated checks and create issues for Visual Studio users relying on the default generatorI ran some very basic experiments with Github Actions in my fork of the shadPS4 repo. Using
cmake -G Ninjaalone reduces time ofcmake --buildfrom ~20min to ~5min . Throwingccacheinto the mix boosts this to ~2min.The
shadPS4.exebinary seems to be functioning properly when built with Ninja, but I did notice at least two differences compared to the upstream Github Actions:shadps4-....zipbundle uploaded from my Actions contains more files (specifically:dxcompiler.dll,dxil.dll,vc_redist.x64.exe). Not sure where these came from, might be one of dependencies or just a quirk ofwinqtdeploywarning: argument unused during compilation: '/Zc:preprocessor'(externals/toml11does not fully support clang-cl) - at the same time, I did not see some of the warnings present in the "default" build logs. This might be due to incorrect compiler flags setup somewhere inCMakeLists, mentioned before; but to be fair, I did not delve deeply into this beyond "check if Windows CI builds with
-G Ninjaand-DCMAKE_CXX_COMPILER_LAUNCHER=ccache".If the maintainers are willing to give this a try (the changes should only affect CI, not the local developer experience), I am ready to investigate further and submit a proper PR to switch the CI to use Ninja+ccache.
Some details on buildsystems
*
MSBuildis the buildsystem used by Visual Studio itself to build "regular".vcxprojprojects - and therefore by CMake when it generates files for VS (either by default or when provided with-G Visual Studio ###configuration flag).**
Ninjais a low-level buildsystem supposed to be used by CMake and other meta-buildsystems. Modern installations of Visual Studio bundle Ninja together with CMake, so it is available on CI with minimal tinkering.*** MSBuild is what CMake calls a multi-config generator (allowing builds of both Debug and Release from a single
somelib.vcxprojfile), while Ninja is a single-config generator (somelib.ninjawould only contain info for either Debug or Release builds, depending on your CMake configuration flags). CMake internally uses different mechanisms for Ninja and VS project generation, which can lead to issues ifCMakeListswas accidentally written to work with one generator but not the other.Most notable difference - using
if(CMAKE_BUILD_TYPE STREQUAL "Debug")to change the compiler flags / definitions would only work with Ninja or Makefiles; for Visual Studio you'd have to use$<Generator:expressions>instead)@viniciuslrangel commented on GitHub (Sep 16, 2024):
@Artalus I only code using ninja + clang-cl on Windows for a while, and it works fine. It's ok to change
@LeDragoX commented on GitHub (Sep 16, 2024):
@Artalus I saw your fork's actions and the difference is extraordinary, I knew
MSBuildbuild didn't work, but I think myccacheinstallation before was missing withninja, that's why I couldn't make it work before. Even withsccacheMSBuild didn't worked.A PR with your changes would be welcome 🔥
Edit: just need to remove
vc_redist.x64.exefrom the upload... maybe deleting manually after runningwindeployqt, or with some parameter, I'm not sure why that happens tho.@LeDragoX commented on GitHub (Sep 16, 2024):
@Artalus, are you on discord? I'm willing to help or make a PR with your solution, you can find me on the shadPS4's server then tag me. Windows' CIs are really needing this upgrade.
Just telling because I may have found the answer to
vc_redist.x64.exebundling inside the artifacts.@LeDragoX commented on GitHub (Sep 17, 2024):
@Artalus If you want to try there, I can confirm adding
--no-compiler-runtimetowindeployqtonwindows-qt.ymlwill removevc_redist.x64.exefrom the artifact, so only the.dllswill remain, and should be good enough.I saw that moving the files
dxcompiler.dllanddxil.dllstill allowshadPS4.exeto initialize normally, I may need to look another parameter onwindeployqtto solve that.Edit: Adding
--no-system-d3d-compiler --no-system-dxc-compilersolves the "ignorable" DLLs.