Github actions and C++ precompiled headers #183481
Replies: 2 comments
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
Yes, precompiled headers (PCH) can work with GitHub Actions caching, but it depends on how stable your build environment is. If the compiler version, flags, or dependencies change, the cached PCH may become invalid and force a rebuild. A common approach is to include the compiler version and build configuration in the cache key. For example:
This helps ensure the cache is only restored when the environment is compatible. However, because PCH files are sensitive to small changes, many projects still end up rebuilding them frequently. In some cases using tools like ccache or sccache with GitHub Actions can give more reliable build speed improvements than caching PCH d |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Question
What GitHub Actions topic or product is this about?
Actions Cache
Discussion Details
Anybody have any idea if precompiled headers play nicely with github-actions?
My project is becoming quite large so I started precompiling STL headers.
And I am now wondering if precompiled headers can be cached and or restored without causing a rebuild?
As I want to save time recompiling STL, library headers and or project headers that dont change often.
But it seems the only way might be to touch update my pch headers? (which seems dangerous and hacky)
Similar issue:
actions/checkout#364
Git on filetime modifications.
https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/Git_FAQ.html#Why_isn.27t_Git_preserving_modification_time_on_files.3F
Running build:
https://github.com/soerlemans/crowlang/actions/runs/20696612853/job/59412823406?pr=72
My workflow file:
https://github.com/soerlemans/crowlang/blob/feature/pointers/.github/workflows/unit-tests.yml
Beta Was this translation helpful? Give feedback.
All reactions