Skip to content

feat(ci): add caching for CMake FetchContent in CI workflow#3448

Open
jihuayu wants to merge 3 commits intoapache:unstablefrom
jihuayu:unstable
Open

feat(ci): add caching for CMake FetchContent in CI workflow#3448
jihuayu wants to merge 3 commits intoapache:unstablefrom
jihuayu:unstable

Conversation

@jihuayu
Copy link
Copy Markdown
Member

@jihuayu jihuayu commented Apr 13, 2026

Due to the current instability of GitHub services, dependency download failures occur frequently during CI runs. I add FetchContent caching to prevent these network issues from failing the CI.

Copy link
Copy Markdown
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

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

You can use DEPS_FETCH_DIR instead of caching these _deps directories (which may bring some chaos).

@jihuayu
Copy link
Copy Markdown
Member Author

jihuayu commented Apr 13, 2026

@PragmaTwice Thanks for the reminder. I’ve made the changes.
Do you think it’s better to cache each job individually (now), or do a full cache at the beginning of the action?

@sonarqubecloud
Copy link
Copy Markdown

@PragmaTwice
Copy link
Copy Markdown
Member

env.CMAKE_JEMALLOC_VARIANT, env.CMAKE_LUA_VARIANT,

I don't think we need this. They are useless and introduce complexity.

Do you think it’s better to cache each job individually (now), or do a full cache at the beginning of the action?

I think we'd better to choose the simplest way.

@jihuayu
Copy link
Copy Markdown
Member Author

jihuayu commented Apr 14, 2026

env.CMAKE_JEMALLOC_VARIANT, env.CMAKE_LUA_VARIANT,
I don't think we need this. They are useless and introduce complexity.

This variable is just for readability; otherwise, we’d be stuck facing a very long cache key.
${{ format('cmake-fetch-archives-v1-{0}-{1}-{2}-{3}', matrix.os, startsWith(matrix.os, 'macos') && 'without-jemalloc' || matrix.without_jemalloc && 'without-jemalloc' || 'with-jemalloc' , matrix.without_luajit && 'without-luajit' || 'with-luajit' , hashFiles('CMakeLists.txt', 'cmake/**/*')) }}

As I understand it, the Lua and jemalloc options must be cached separately because they pull different source codes. Is that correct?

@PragmaTwice
Copy link
Copy Markdown
Member

As I understand it, the Lua and jemalloc options must be cached separately because they pull different source codes. Is that correct?

Nope. The dep dir can be shared. The filename is different for different deps.

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.

2 participants