Skip to content

Commit 1fd290f

Browse files
committed
parameterize helio flags
1 parent 3c505b4 commit 1fd290f

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
BUILD_ARCH := $(shell uname -m)
22
RELEASE_NAME := "dragonfly-${BUILD_ARCH}"
33

4+
HELIO_RELEASE := $(if $(HELIO_RELEASE),y,)
5+
HELIO_RELEASE_FLAGS = -DHELIO_RELEASE_FLAGS="-flto"
6+
HELIO_USE_STATIC_LIBS = ON
7+
HELIO_OPENSSL_USE_STATIC_LIBS = ON
8+
HELIO_ENABLE_GIT_VERSION = ON
9+
HELIO_WITH_UNWIND = OFF
10+
11+
HELIO_FLAGS = $(if $(HELIO_RELEASE),-release $(HELIO_RELEASE_FLAGS),) \
12+
-DBoost_USE_STATIC_LIBS=$(HELIO_USE_STATIC_LIBS) \
13+
-DOPENSSL_USE_STATIC_LIBS=$(HELIO_OPENSSL_USE_STATIC_LIBS) \
14+
-DENABLE_GIT_VERSION=$(HELIO_ENABLE_GIT_VERSION) \
15+
-DWITH_UNWIND=$(HELIO_WITH_UNWIND) \
16+
417
.PHONY: default
518

619
configure:
7-
./helio/blaze.sh -release -DBoost_USE_STATIC_LIBS=ON -DOPENSSL_USE_STATIC_LIBS=ON \
8-
-DENABLE_GIT_VERSION=ON -DWITH_UNWIND=OFF -DHELIO_RELEASE_FLAGS="-flto"
20+
./helio/blaze.sh $(HELIO_FLAGS)
921

1022
build:
1123
cd build-opt; \

tools/docker/Dockerfile.alpine-dev

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
# syntax=docker/dockerfile:1
22
FROM gcr.io/cadvisor/cadvisor:v0.46.0 as libpfm_donor
33

4-
FROM alpine:3.17.0 as build
5-
6-
WORKDIR /build
7-
8-
COPY . ./
4+
FROM alpine:3.17.0 as builder
95

106
# "openssl-libs-static" fixes "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the"
117
RUN apk add autoconf-archive automake bash bison boost-dev cmake coreutils \
128
curl ccache git gcc gdb g++ libunwind-dev libtool libxml2-dev make ninja \
139
openssl-dev openssl-libs-static patch zip zstd-dev
1410

11+
# This is required to make static linking work
12+
RUN ls -1 /usr/lib/libboost_*.so | while read -r _file; do ln -sfv ${_file} ${_file//.so/.a}; done
13+
1514
# Borrow libpfm from cadvisor, so we don't have to build it ourselves
1615
# https://github.com/google/cadvisor/blob/master/deploy/Dockerfile
1716
COPY --from=libpfm_donor /usr/local/lib/libpfm.so* /usr/local/lib/
1817

19-
RUN make HELIO_USE_STATIC_LIBS=OFF release
18+
WORKDIR /build
19+
20+
COPY . ./
21+
22+
RUN make HELIO_RELEASE=y release
2023

2124
RUN build-opt/dragonfly --version
2225

2326
FROM alpine:3.17.0
2427

25-
RUN apk --no-cache add libgcc libstdc++ libunwind boost1.77-fiber \
26-
'su-exec>=0.2' netcat-openbsd
28+
RUN apk --no-cache add libgcc libstdc++ libunwind boost1.80-fiber zstd-dev su-exec netcat-openbsd
2729

2830
RUN addgroup -S -g 1000 dfly && adduser -S -G dfly -u 999 dfly
2931
RUN mkdir /data && chown dfly:dfly /data

tools/docker/Dockerfile.ubuntu-dev

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# syntax=docker/dockerfile:1
22
FROM ubuntu:20.04 as builder
33

4-
WORKDIR /build
5-
6-
COPY . ./
7-
84
RUN \
95
rm -f /etc/apt/apt.conf.d/docker-clean; \
106
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
@@ -21,7 +17,11 @@ RUN \
2117
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40 \
2218
--slave /usr/bin/g++ g++ /usr/bin/g++-9
2319

24-
RUN make release
20+
WORKDIR /build
21+
22+
COPY . ./
23+
24+
RUN make HELIO_RELEASE=y release
2525

2626
RUN build-opt/dragonfly --version
2727

tools/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fi
1212

1313
pwd
1414

15-
make release
15+
make HELIO_RELEASE=y release
1616

1717
build-opt/dragonfly --version
1818

0 commit comments

Comments
 (0)