Skip to content

Commit e6afdc5

Browse files
committed
fix: allow building more recent redis versions
Redis > 8.2 wasn't building correctly. Initially I was hitting an error about `if let`: > `let` expressions in this position are unstable in the `wildcard` transitive dependency of redisearch. I upgraded the version of alpine used to get a more recent Rust toolchain which stabilised that syntax. This caused another error because the llvm-dev package dropped the `/usr/bin/llvm-config` binary, instead only including the binary with the version attached. (issue)[https://gitlab.alpinelinux.org/alpine/aports/-/work_items/17773]. The fix for that is in, but I wasn't getting it in the package archive. So I added a check that sets the correct envvar. Signed-off-by: Daniel Goldman <danielgoldman4@gmail.com>
1 parent 728981e commit e6afdc5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.22 AS builder
1+
FROM alpine:3.23 AS builder
22

33
LABEL maintainer="Opstree Solutions"
44

@@ -25,6 +25,15 @@ WORKDIR /tmp
2525
SHELL ["bash", "-xe", "-c"]
2626

2727
RUN <<EOF
28+
# if llvm-config isn't found, it's probably at `/usr/bin/llvm-config-${llvm_version}`
29+
# see https://gitlab.alpinelinux.org/alpine/aports/-/work_items/17773 and remove once that hits the repositories
30+
if ! command -v llvm-config &> /dev/null; then
31+
LLVM_CONFIG=$(find /usr/bin -name "llvm-config*" | head -n 1)
32+
if [ -n "$LLVM_CONFIG" ]; then
33+
export LLVM_CONFIG_PATH="$LLVM_CONFIG"
34+
fi
35+
fi
36+
2837
VERSION=$(echo ${REDIS_VERSION} | sed -e "s/^v//g");
2938
case "${VERSION}" in
3039
latest | stable) REDIS_DOWNLOAD_URL="http://download.redis.io/redis-stable.tar.gz" && VERSION="stable";;

0 commit comments

Comments
 (0)