fix: broken gha cache (#4951)

* fix: broken gha cache

Also fix some clang warnings.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>

* chore: comments

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2025-04-17 08:30:58 +03:00 committed by GitHub
parent eb80d576d5
commit 95147fbb59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 51 deletions

View file

@ -19,6 +19,9 @@ jobs:
with:
fetch-depth: 2
- uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true
- name: Install dependencies
run: |
python -m venv venv
@ -27,10 +30,6 @@ jobs:
lsblk -l
echo "sda rotational = $(cat /sys/block/sda/queue/rotational)"
echo "sdb rotational = $(cat /sys/block/sdb/queue/rotational)"
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit checks
run: |
source venv/bin/activate
@ -43,7 +42,8 @@ jobs:
container: ["ubuntu-dev:20", "alpine-dev:latest"]
build-type: [Debug, Release]
compiler: [{ cxx: g++, c: gcc }]
cxx_flags: ["-Werror"]
# -no-pie to disable address randomization so we could symbolize stacktraces
cxx_flags: ["-Werror -no-pie"]
sanitizers: ["NoSanitizers"]
include:
- container: "alpine-dev:latest"
@ -59,12 +59,6 @@ jobs:
sanitizers: "Sanitizers"
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: 6G
SCCACHE_ERROR_LOG: /tmp/sccache_log.txt
# SCCACHE_LOG: debug
container:
image: ghcr.io/romange/${{ matrix.container }}
# Seems that docker by default prohibits running iouring syscalls
@ -99,16 +93,6 @@ jobs:
touch /mnt/foo
ls -la /mnt/foo
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.7
- name: Configure Cache Env
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
@ -129,14 +113,12 @@ jobs:
export USAN="ON"
fi
# -no-pie to disable address randomization so we could symbolize stacktraces
cmake -B ${GITHUB_WORKSPACE}/build \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-GNinja \
-DCMAKE_C_COMPILER="${{matrix.compiler.c}}" \
-DCMAKE_CXX_COMPILER="${{matrix.compiler.cxx}}" \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}} -no-pie" -DWITH_AWS:BOOL=OFF \
-DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}}" -DWITH_AWS:BOOL=OFF \
-DWITH_ASAN="${ASAN}" \
-DWITH_USAN="${USAN}" \
-L

View file

@ -1,7 +1,6 @@
name: daily-builds
on:
# TODO: Remove this. This is for testing
schedule:
- cron: '0 6 * * *' # run at 6 AM UTC
workflow_dispatch:
@ -37,15 +36,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.7
- name: Configure Cache Env
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')
- name: Install dependencies
run: |
@ -59,8 +49,7 @@ jobs:
- name: Configure & Build
run: |
cd $GITHUB_WORKSPACE/build
cmake .. -DCMAKE_BUILD_TYPE=Debug -GNinja -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache \
${{ matrix.flags }}
cmake .. -DCMAKE_BUILD_TYPE=Debug -GNinja ${{ matrix.flags }}
ninja src/all
- name: Test
run: |
@ -74,15 +63,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.7
- name: Configure Cache Env
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')
- name: Install dependencies
run: |
@ -114,7 +94,7 @@ jobs:
echo "*************************** START BUILDING **************************************"
CC=gcc-12 CXX=g++-12 cmake .. -DCMAKE_BUILD_TYPE=Debug -GNinja -DWITH_UNWIND=OFF \
-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_FLAGS="-Wl,-ld_classic" \
-DCMAKE_CXX_FLAGS="-Wl,-ld_classic" \
-DCMAKE_C_COMPILER="gcc-12" -DCMAKE_CXX_COMPILER="g++-12"
ninja src/all

View file

@ -1579,7 +1579,7 @@ auto DbSlice::StopSampleTopK(DbIndex db_ind) -> SamplingResult {
SamplingResult result;
result.top_keys.reserve(fmap.size());
for (auto& [key, count] : fmap) {
result.top_keys.emplace_back(move(key), count);
result.top_keys.emplace_back(std::move(key), count);
}
return result;
}

View file

@ -108,8 +108,6 @@ constexpr size_t kFiberDefaultStackSize = 32_KB - 16;
constexpr size_t kFiberDefaultStackSize = 40_KB - 16;
#endif
using util::http::TlsClient;
enum class TermColor { kDefault, kRed, kGreen, kYellow };
// Returns the ANSI color code for the given color. TermColor::kDefault is
// an invalid input.
@ -170,7 +168,7 @@ string NormalizePaths(std::string_view path) {
}
template <typename... Args> unique_ptr<Listener> MakeListener(Args&&... args) {
auto res = make_unique<Listener>(forward<Args>(args)...);
auto res = make_unique<Listener>(std::forward<Args>(args)...);
res->SetConnFiberStackSize(kFiberDefaultStackSize);
return res;
}

View file

@ -246,7 +246,7 @@ bool MultiCommandSquasher::ExecuteSquashed(facade::RedisReplyBuilder* rb) {
fb2::BlockingCounter bc(num_shards);
DVLOG(1) << "Squashing " << num_shards << " " << tx->DebugId();
auto cb = [this, tx, bc, rb]() mutable {
auto cb = [this, bc, rb]() mutable {
this->SquashedHopCb(EngineShard::tlocal(), rb->GetRespVersion());
bc->Dec();
};