File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,27 @@ RUN apt-get update && \
3535WORKDIR /parseable
3636COPY Cargo.toml Cargo.lock build.rs ./
3737
38- # Create a dummy main.rs to pre-cache dependencies
39- RUN mkdir src && echo "fn main() {}" > src/main.rs && \
40- cargo build --release --features kafka && \
38+ # Fix librdkafka CMakeLists.txt before building
39+ RUN mkdir -p src && echo "fn main() {}" > src/main.rs && \
40+ # Download the package so it's in the cargo registry
41+ cargo fetch && \
42+ # Find rdkafka-sys directory
43+ RDKAFKA_SYS_DIR=$(find /usr/local/cargo/registry/src -name "rdkafka-sys-*" -type d | head -n 1) && \
44+ echo "Found rdkafka-sys at: $RDKAFKA_SYS_DIR" && \
45+ # Find the CMakeLists.txt file
46+ CMAKE_FILE="$RDKAFKA_SYS_DIR/librdkafka/CMakeLists.txt" && \
47+ if [ -f "$CMAKE_FILE" ]; then \
48+ echo "Found CMakeLists.txt at: $CMAKE_FILE" && \
49+ # Replace the minimum required version
50+ sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE" && \
51+ echo "Modified CMakeLists.txt to use CMake 3.5 minimum version"; \
52+ else \
53+ echo "Could not find librdkafka CMakeLists.txt file!" && \
54+ exit 1; \
55+ fi
56+
57+ # Now build dependencies with the fixed CMakeLists.txt
58+ RUN cargo build --release --features kafka && \
4159 rm -rf src
4260
4361# Copy the actual source code
You can’t perform that action at this time.
0 commit comments