Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore building yaml-cpp #656

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ FROM --platform=$BUILDPLATFORM debian:12 AS build-base-debian

RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
build-essential \
binutils-for-host \
binutils-aarch64-linux-gnu \
binutils-arm-linux-gnueabihf \
binutils-for-host \
binutils-powerpc64le-linux-gnu \
build-essential \
ca-certificates \
clang-16 \
git \
golang \
libcurl4 \
libprotobuf-dev \
libtool \
libyaml-cpp-dev \
libz-dev \
lld \
pkg-config \
Expand Down Expand Up @@ -47,6 +48,7 @@ RUN apk add --no-cache \
libcurl \
lld \
protobuf-dev \
yaml-cpp-dev \
zlib-dev

COPY --from=xx / /
Expand Down Expand Up @@ -139,10 +141,25 @@ RUN [ "$(xx-info vendor)" = "alpine" ] && export QEMU_LD_PREFIX=/$(xx-info); \
### Build Jaeger cpp-client
FROM opentracing-cpp AS jaeger-cpp-client
ARG JAEGER_CPP_VERSION=v0.9.0
ARG YAML_CPP_VERSION=0.8.0
ARG TARGETPLATFORM

# Building yaml-cpp manually because of a bug in jaeger-client-cpp that won't install it
RUN xx-info env && git clone --depth 1 -b $YAML_CPP_VERSION https://github.com/jbeder/yaml-cpp/ && \
cd yaml-cpp && mkdir .build && cd .build && \
cmake $(xx-clang --print-cmake-defines) \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DYAML_CPP_BUILD_TESTS=OFF \
-DYAML_CPP_BUILD_TOOLS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON .. \
&& make -j$(nproc) install \
&& xx-verify /usr/local/lib/libyaml-cpp.so

RUN git clone --depth 1 -b $JAEGER_CPP_VERSION https://github.com/jaegertracing/jaeger-client-cpp \
&& cd jaeger-client-cpp \
&& sed -i 's/hunter_add_package(yaml-cpp)/#hunter_add_package(yaml-cpp)/' CMakeLists.txt \
&& sed -i 's/yaml-cpp::yaml-cpp/yaml-cpp/' CMakeLists.txt \
# Hunter doesn't read CMake variables, so we need to set them manually
&& printf "%s\n" "" "set(CMAKE_C_COMPILER clang)" "set(CMAKE_CXX_COMPILER clang++)" \
"set(CMAKE_ASM_COMPILER clang)" "set(PKG_CONFIG_EXECUTABLE $(xx-clang --print-prog-name=pkg-config))" \
Expand Down