Skip to content

Commit

Permalink
CI: add cross compilation test
Browse files Browse the repository at this point in the history
Signed-off-by: Björn Svensson <[email protected]>
  • Loading branch information
bjosv committed Oct 10, 2024
1 parent 21b0827 commit 96a5cf1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,34 @@ jobs:
REDIS_DOCKER: redis:alpine
TEST_PREFIX: ${{matrix.emulator}} -L /usr/${{matrix.toolset}}/
run: make check

build-cross:
name: Cross-compile ${{ matrix.config.target }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
config:
- {target: arm, host: arm-linux-gnueabi, qemu: arm, gccver: 12 }
- {target: armhf, host: arm-linux-gnueabihf, qemu: arm, gccver: 12 }
- {target: aarch64, host: aarch64-linux-gnu, qemu: aarch64, gccver: 12 }
- {target: riscv64, host: riscv64-linux-gnu, qemu: riscv64, gccver: 12 }
- {target: ppc, host: powerpc-linux-gnu, qemu: ppc, gccver: 12 }
- {target: ppc64, host: powerpc64-linux-gnu, qemu: ppc64, gccver: 12 }
- {target: ppc64le, host: powerpc64le-linux-gnu, qemu: ppc64le, gccver: 12 }
- {target: s390x, host: s390x-linux-gnu, qemu: s390x, gccver: 12 }
- {target: mips, host: mips-linux-gnu, qemu: mips, gccver: 10 }
- {target: mips64, host: mips64-linux-gnuabi64, qemu: mips64, gccver: 10 }
- {target: mipsel, host: mipsel-linux-gnu, qemu: mipsel, gccver: 10 }
- {target: mips64el, host: mips64el-linux-gnuabi64, qemu: mips64el, gccver: 10 }
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Install toolchain
run: |
sudo apt install -y g++-${{ matrix.config.gccver }}-${{ matrix.config.host }}
- name: Build
env:
CC: ${{ matrix.config.host }}-gcc-${{ matrix.config.gccver }}
AR: ${{ matrix.config.host }}-ar
run: |
make
4 changes: 2 additions & 2 deletions include/valkey/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ typedef struct valkeyClusterAsyncContext {

#if UINTPTR_MAX == UINT64_MAX
#define VALKEY_NODE_ITERATOR_SIZE 56
#elif defined(__arm__)
#define VALKEY_NODE_ITERATOR_SIZE 40
#elif defined(__arm__) || defined(__mips__) || defined(__powerpc__)
#define VALKEY_NODE_ITERATOR_SIZE 32
#else
#define VALKEY_NODE_ITERATOR_SIZE 32
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -3542,8 +3542,8 @@ void valkeyClusterAsyncFree(valkeyClusterAsyncContext *acc) {
}

struct nodeIterator {
valkeyClusterContext *cc;
uint64_t route_version;
valkeyClusterContext *cc;
int retries_left;
dictIterator di;
};
Expand Down

0 comments on commit 96a5cf1

Please sign in to comment.