1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00

chore(webfuse): add debugging configurations and launch support (#21)

* fixes verbosity option when set through command line

* adds support for build type and allows to run gdb in container

* adds missing toolchain headers to project

* renames container macros

* adds gdbserver

* fixes verbosity option when set through command line

* adds support for build type and allows to run gdb in container

* adds missing toolchain headers to project

* renames container macros

* adds gdbserver

* removes language settings, which contains alternating values

* adds wrapper script to launch gdbserver

* fix docker command in wrapper script

* fixes run in dind setup

* replaces docker's init through dump-init
This commit is contained in:
nosamad 2019-04-02 22:21:02 +02:00 committed by Falk Werner
parent 87f34fa768
commit b1527d5581
8 changed files with 203 additions and 79 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.vscode .vscode
.build .build
.deps .deps
.settings/language.settings.xml

View File

@ -15,9 +15,11 @@ env:
- PARALLELMFLAGS="-j2" - PARALLELMFLAGS="-j2"
- PORTABLE_WORSPACE=1 - PORTABLE_WORSPACE=1
matrix: matrix:
- MARCH=amd64 CHECK_TARGET=memcheck - BUILDTYPE=Debug MARCH=amd64 CHECK_TARGET=memcheck
- MARCH=arm32v7 CHECK_TARGET=check - BUILDTYPE=Release MARCH=amd64 CHECK_TARGET=memcheck
- BUILDTYPE=Debug MARCH=arm32v7 CHECK_TARGET=check
- BUILDTYPE=MinSizeRel MARCH=arm32v7 CHECK_TARGET=check
before_script: before_script:
- make MARCH=$MARCH - make BUILDTYPE=$BUILDTYPE MARCH=$MARCH
script: script:
- make MARCH=$MARCH $CHECK_TARGET - make BUILDTYPE=$BUILDTYPE MARCH=$MARCH $CHECK_TARGET

View File

@ -15,6 +15,7 @@ DOCKER_BUILDKIT ?=
VERBOSE ?= VERBOSE ?=
BUILDVERBOSE ?= BUILDVERBOSE ?=
BUILDTARGET ?= BUILDTARGET ?=
BUILDTYPE ?= Debug
MARCH ?= $(call march,$(BUILDTARGET)) MARCH ?= $(call march,$(BUILDTARGET))
PROJECT_NAME ?= webfuse PROJECT_NAME ?= webfuse
@ -24,8 +25,8 @@ OUT ?= $(PROJECT_ROOT)/.build
UID ?= $(shell id -u) UID ?= $(shell id -u)
CONTAINER_USER ?= $(UID) CONTAINER_USER ?= user
CONTAINER_GROUP ?= $(shell id -g) CONTAINER_GROUP ?= user
CONTAINER_CGROUP_PARENT ?= CONTAINER_CGROUP_PARENT ?=
HOST_CONTAINER ?= $(shell $(PROJECT_ROOT)/build/get_container_id.sh) HOST_CONTAINER ?= $(shell $(PROJECT_ROOT)/build/get_container_id.sh)
@ -41,6 +42,11 @@ UBUNTU_CODENAME ?= bionic
# Dependencies # Dependencies
DUMB_INIT_VERISON ?= 1.2.2
DOCKER_BUILDARGS += DUMB_INIT_VERISON=$(DUMB_INIT_VERISON)
FETCH_TARGETS += $(OUT)/dumb-init-$(DUMB_INIT_VERISON).tar.gz
$(OUT)/dumb-init-$(DUMB_INIT_VERISON).tar.gz: URL := https://github.com/Yelp/dumb-init/archive/v${DUMB_INIT_VERISON}.tar.gz
GTEST_VERSION ?= 1.8.1 GTEST_VERSION ?= 1.8.1
DOCKER_BUILDARGS += GTEST_VERSION=$(GTEST_VERSION) DOCKER_BUILDARGS += GTEST_VERSION=$(GTEST_VERSION)
FETCH_TARGETS += $(OUT)/googletest-release-$(GTEST_VERSION).tar.gz FETCH_TARGETS += $(OUT)/googletest-release-$(GTEST_VERSION).tar.gz
@ -93,21 +99,24 @@ $(addprefix $(OUT)/docker/,$(UBUNTU_TARGETS)): CODENAME := $(UBUNTU_CODENAME)
# Common rule target configuration # Common rule target configuration
CMAKEFLAGS += '-GNinja' CMAKEFLAGS += '-GNinja'
CMAKEFLAGS += '-DCMAKE_BUILD_TYPE=$(BUILDTYPE)'
BUILDSILENT := $(if $(BUILDVERBOSE),,1) BUILDSILENT := $(if $(BUILDVERBOSE),,1)
$(BUILDSILENT)NINJAFLAGS += -v $(BUILDSILENT)NINJAFLAGS += -v
DOCKER_RUNFLAGS += --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined DOCKER_RUNFLAGS += --device /dev/fuse
DOCKER_RUNFLAGS += --cap-add SYS_ADMIN
DOCKER_RUNFLAGS += --security-opt apparmor:unconfined
DOCKER_RUNFLAGS += --cap-add SYS_PTRACE
DOCKER_RUNFLAGS += --security-opt seccomp=unconfined
DOCKER_RUNFLAGS += --interactive DOCKER_RUNFLAGS += --interactive
DOCKER_RUNFLAGS += --rm DOCKER_RUNFLAGS += --rm
DOCKER_RUNFLAGS += --init
DOCKER_RUNFLAGS += --user $(CONTAINER_USER):$(CONTAINER_GROUP) DOCKER_RUNFLAGS += --user $(CONTAINER_USER):$(CONTAINER_GROUP)
DOCKER_RUNFLAGS += --env SOURCE_DATE_EPOCH DOCKER_RUNFLAGS += --env SOURCE_DATE_EPOCH
DOCKER_RUNFLAGS += --env BUILDTIME DOCKER_RUNFLAGS += --env BUILDTIME
DOCKER_RUNFLAGS += --env NINJA_STATUS DOCKER_RUNFLAGS += --env NINJA_STATUS
DOCKER_RUNFLAGS += $(addprefix --volumes-from ,$(HOST_CONTAINER))
DOCKER_RUNFLAGS += $(addprefix --cgroup-parent ,$(CONTAINER_CGROUP_PARENT))
DOCKER_BUILDARGS += CODENAME=$(CODENAME) DOCKER_BUILDARGS += CODENAME=$(CODENAME)
DOCKER_BUILDARGS += PARALLELMFLAGS=$(PARALLELMFLAGS) DOCKER_BUILDARGS += PARALLELMFLAGS=$(PARALLELMFLAGS)
@ -118,10 +127,12 @@ DOCKER_BUILDARGS += OUT=$(CONTAINER_OUT)
DOCKER_BUILDFLAGS += --rm DOCKER_BUILDFLAGS += --rm
DOCKER_BUILDFLAGS += $(addprefix --build-arg ,$(DOCKER_BUILDARGS)) DOCKER_BUILDFLAGS += $(addprefix --build-arg ,$(DOCKER_BUILDARGS))
OUT_TARGETS += $(addprefix $(OUT)/,$(TARGETS))
OUT_DIRS += $(OUT) OUT_DIRS += $(OUT)
OUT_DIRS += $(OUT)/docker OUT_DIRS += $(OUT)/docker
OUT_DIRS += $(OUT)/src OUT_DIRS += $(OUT)/src
OUT_DIRS += $(addprefix $(OUT)/,$(TARGETS)) OUT_DIRS += $(addsuffix /$(BUILDTYPE),$(OUT_TARGETS))
BUILD_TARGETS += $(addprefix build-,$(TARGETS)) BUILD_TARGETS += $(addprefix build-,$(TARGETS))
CHECK_TARGETS += $(addprefix check-,$(TARGETS)) CHECK_TARGETS += $(addprefix check-,$(TARGETS))
@ -129,7 +140,7 @@ CLEAN_TARGETS += $(addprefix clean-,$(TARGETS))
RUN_TARGETS += $(addprefix run-,$(firstword $(TARGETS))) RUN_TARGETS += $(addprefix run-,$(firstword $(TARGETS)))
EXTRACT_TARGETS += $(patsubst $(OUT)/%.tar.gz,$(OUT)/src/%,$(FETCH_TARGETS)) EXTRACT_TARGETS += $(patsubst $(OUT)/%.tar.gz,$(OUT)/src/%,$(FETCH_TARGETS))
DISCOVER_CC_TARGETS += $(addprefix discover-cc-,$(firstword $(TARGETS))) DISCOVER_CC_TARGETS += $(addprefix discover-cc-,$(firstword $(TARGETS)))
RULE_TARGETS = $(addprefix $(OUT)/,$(addsuffix /rules.mk,$(TARGETS))) RULE_TARGETS += $(addsuffix /rules.mk,$(OUT_TARGETS))
TARGETS := $(sort $(TARGETS)) TARGETS := $(sort $(TARGETS))
@ -139,33 +150,36 @@ echo_if_silent = VERBOSE=1
$(VERBOSE)echo_if_silent = echo $1 $(VERBOSE)echo_if_silent = echo $1
$(VERBOSE)SILENT := @ $(VERBOSE)SILENT := @
$(HOST_CONTAINER)container_run_volumes += '$(realpath $(PROJECT_ROOT)):$(CONTAINER_PROJECT_ROOT):cached' $(HOST_CONTAINER)image_run_volumes += --volume '$(realpath $(PROJECT_ROOT)):$(CONTAINER_PROJECT_ROOT):cached'
$(HOST_CONTAINER)container_run_volumes += '$(realpath $(OUT)/$1):$(CONTAINER_OUT)/$1:delegated' $(HOST_CONTAINER)image_run_volumes += --volume '$(realpath $(OUT)/$1):$(CONTAINER_OUT)/$1:delegated'
image_run_volumes += $(addprefix --volumes-from ,$2)
container_name = $(REGISTRY_PREFIX)$(subst -,/,$1)/$(PROJECT_NAME):$(VERSION) image_name = $(REGISTRY_PREFIX)$(subst -,/,$1)/$(PROJECT_NAME):$(VERSION)
container_run = $(DOCKER) run $(DOCKER_RUNFLAGS) $3 \ image_run = $(DOCKER) run $(DOCKER_RUNFLAGS) \
$(addprefix --volume ,$(call container_run_volumes,$1)) \ $(call image_run_volumes,$1,$(HOST_CONTAINER)) \
--workdir '$(CONTAINER_OUT)/$1' \ $(addprefix --cgroup-parent ,$(CONTAINER_CGROUP_PARENT)) \
$(call container_name,$1) \ --workdir '$(CONTAINER_OUT)/$1/$(BUILDTYPE)' \
$3 \
$(call image_name,$1) \
$2 $2
image_rule = \ image_rule = \
$$(OUT)/docker/$1: $$(OUT)/docker/$1.dockerfile $$(EXTRACT_TARGETS) $$(PROJECT_ROOT)/Makefile; \ $$(OUT)/docker/$1: $$(OUT)/docker/$1.dockerfile $$(EXTRACT_TARGETS) $$(PROJECT_ROOT)/Makefile; \
$(SILENT)$$(call image,$1) $$(SILENT)$$(call image,$1)
image = \ image = \
$(call echo_if_silent,docker build $(call container_name,$1) $(OUT)) \ $(call echo_if_silent,TARGET=$1 docker build $(call image_name,$1) $(OUT)) \
&& $(DOCKER) build $(DOCKER_BUILDFLAGS) --iidfile $@ --file $< --tag $(call container_name,$1) $(OUT) && $(DOCKER) build $(DOCKER_BUILDFLAGS) --iidfile $@ --file $< --tag $(call image_name,$1) $(OUT)
configure_rule = \ configure_rule = \
$$(OUT)/$1/CMakeCache.txt: $$(PROJECT_ROOT)/CMakeLists.txt $$(OUT)/docker/$1; \ $$(OUT)/$1/$$(BUILDTYPE)/CMakeCache.txt: $$(PROJECT_ROOT)/CMakeLists.txt $$(OUT)/docker/$1 | $$(OUT)/$1/$$(BUILDTYPE)/gdbserver; \
$(SILENT)$$(call configure,$1) $$(SILENT)$$(call configure,$1)
configure = \ configure = \
$(call run,$1,sh -c 'cmake $(CMAKEFLAGS) $(CONTAINER_PROJECT_ROOT) && $(CONTAINER_PROJECT_ROOT)/build/discover_cc_settings.sh $(notdir $@) $(realpath $(dir $@))') \ $(call run,$1,sh -c 'cmake $(CMAKEFLAGS) $(CONTAINER_PROJECT_ROOT) && $(CONTAINER_PROJECT_ROOT)/build/discover_cc_settings.sh $(notdir $@) $(realpath $(dir $@))') \
&& touch $(addprefix $(dir $@)/,include_dirs.txt) $@ && touch $(addprefix $(dir $@)/,include_dirs.txt) $@
build_rule = \ build_rule = \
build-$1: $$(OUT)/$1/CMakeCache.txt; \ build-$1: $$(OUT)/$1/$$(BUILDTYPE)/CMakeCache.txt; \
$(SILENT)$$(call build,$1) $$(SILENT)$$(call build,$1)
build = $(call run,$1,ninja $(PARALLELMFLAGS) $(NINJAFLAGS) $(GOALS)) build = $(call run,$1,ninja $(PARALLELMFLAGS) $(NINJAFLAGS) $(GOALS))
check_rule = \ check_rule = \
@ -173,30 +187,44 @@ check_rule = \
memcheck_rule = \ memcheck_rule = \
memcheck-$1: build-$1; \ memcheck-$1: build-$1; \
$(SILENT)$$(call memcheck,$1) $$(SILENT)$$(call memcheck,$1)
memcheck = $(call run,$1,ctest -T memcheck $(CTESTFLAGS)) memcheck = $(call run,$1,ctest -T memcheck $(CTESTFLAGS))
run_rule = \ run_rule = \
run-$1: $$(OUT)/docker/$1; \ run-$1: $$(OUT)/docker/$1; \
$(SILENT)$$(call run,$1,/bin/bash,--tty) || true $$(SILENT)$$(call run,$1,bash,--tty) || true
run = $(call echo_if_silent,TARGET=$1 $2) && $(call container_run,$1,$2,$3) run = $(call echo_if_silent,TARGET=$1 BUILDTYPE=$(BUILDTYPE) $2) && $(call image_run,$1,$2,$3)
clean_rule = \ clean_rule = \
clean-$1: ; \ clean-$1: ; \
$(SILENT)-$$(call clean,$1) $$(SILENT)-$$(call clean,$1)
clean = rm -rf $(OUT)/$1 clean = rm -rf $(OUT)/$1
discover_cc_settings_rule = \ discover_cc_settings_rule = \
$$(OUT)/$1/include_dirs.txt: $$(OUT)/$1/CMakeCache.txt; \ $$(OUT)/$1/$$(BUILDTYPE)/include_dirs.txt: $$(OUT)/$1/$$(BUILDTYPE)/CMakeCache.txt; \
$(SILENT)$$(call discover_cc_settings,$1) $$(SILENT)$$(call discover_cc_settings,$1)
discover_cc_settings = \ discover_cc_settings = \
$(call run,$1,$(CONTAINER_PROJECT_ROOT)/build/discover_cc_settings.sh $(notdir $<) $(realpath $(dir $<))) $(call run,$1,$(CONTAINER_PROJECT_ROOT)/build/discover_cc_settings.sh $(notdir $<) $(realpath $(dir $<)))
discover_cc_rule = \ discover_cc_rule = \
discover-cc-$1: $$(OUT)/$1/include_dirs.txt; \ discover-cc-$1: $$(OUT)/$1/$$(BUILDTYPE)/include_dirs.txt; \
$(SILENT)$$(call discover_cc,$1) $$(SILENT)$$(call discover_cc,$1)
discover_cc = cat $< discover_cc = cat $<
wrapper_rule = \
$$(OUT)/$1/$$(BUILDTYPE)/gdbserver: $$(PROJECT_ROOT)/build/run_image.template $$(OUT)/docker/$1; \
$$(SILENT)$$(call wrapper,$1)
wrapper = \
$(call echo_if_silent,generating $@) \
&& sed \
-e 's@%PROJECT_ROOT%@$(abspath $(PROJECT_ROOT))@g' \
-e 's@%DOCKER%@$(DOCKER)@g' \
-e 's@%RUNFLAGS%@$(DOCKER_RUNFLAGS) $(call image_run_volumes,$1)@g' \
-e 's@%IMAGE%@$(call image_name,$1)@g' \
-e 's@%RUNCMD%@$(notdir $@)@g' \
$< > $@ \
&& chmod +x $@
# Rules # Rules
ifneq ($(MAKECMDGOALS),distclean) ifneq ($(MAKECMDGOALS),distclean)
@ -224,6 +252,8 @@ $(RULE_TARGETS): $(PROJECT_ROOT)/Makefile | $(OUT_DIRS)
echo '$(call discover_cc_settings_rule,$(TARGET))'; \ echo '$(call discover_cc_settings_rule,$(TARGET))'; \
echo; \ echo; \
echo '$(call discover_cc_rule,$(TARGET))'; \ echo '$(call discover_cc_rule,$(TARGET))'; \
echo; \
echo '$(call wrapper_rule,$(TARGET))'; \
} > $@ } > $@
.PHONY: all build-% .PHONY: all build-%
@ -259,7 +289,6 @@ debug-print-%:
@printf '%s\n' '$*:' $($*) @printf '%s\n' '$*:' $($*)
$(CHECK_TARGETS): GOALS := test $(CHECK_TARGETS): GOALS := test
$(CHECK_TARGETS) $(MEMCHECK_TARGETS): CONTAINER_USER := user
$(OUT)/docker/qemu-arm-static-$(QEMU_VERSION): $(OUT)/docker/qemu-arm-static-$(QEMU_VERSION):
$(SILENT) \ $(SILENT) \

View File

@ -11,61 +11,79 @@ RUN set -x \
ninja-build \ ninja-build \
pkg-config \ pkg-config \
rsync \ rsync \
valgrind \ gdb \
&& rm -rf /var/lib/apt/lists/* gdbserver \
valgrind
COPY src /usr/local/src COPY src /usr/local/src
ARG PARALLELMFLAGS=-j2 ARG PARALLELMFLAGS=-j2
ARG DUMB_INIT_VERISON=1.2.2
RUN set -x \
&& builddeps="xxd" \
&& apt install --yes --no-install-recommends $builddeps \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cp -R "/usr/local/src/dumb-init-$DUMB_INIT_VERISON" . \
&& cd dumb-init-$DUMB_INIT_VERISON \
&& make "$PARALLELMFLAGS" \
&& chmod +x dumb-init \
&& mv dumb-init /usr/local/bin/dumb-init \
&& dumb-init --version \
&& rm -rf "$builddir" \
&& apt purge -y $builddeps
ARG GTEST_VERSION=1.8.1 ARG GTEST_VERSION=1.8.1
RUN set -x \ RUN set -x \
&& mkdir -p /tmp/out \ && builddir="/tmp/out" \
&& cd /tmp/out \ && mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \ && cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \
&& make "$PARALLELMFLAGS" install \ && make "$PARALLELMFLAGS" install \
&& rm -rf /tmp/out && rm -rf "$builddir"
ARG FUSE_VERSION=3.1.1 ARG FUSE_VERSION=3.1.1
RUN set -x \ RUN set -x \
&& apt update \ && builddeps="libtool automake gettext" \
&& apt install --yes --no-install-recommends \ && apt install --yes --no-install-recommends $builddeps \
libtool \
automake \
gettext \
&& cd "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \ && cd "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& ./makeconf.sh \ && ./makeconf.sh \
&& mkdir -p /tmp/out \ && builddir="/tmp/out" \
&& cd /tmp/out \ && mkdir -p "$builddir" \
&& cd "$builddir" \
&& "/usr/local/src/libfuse-fuse-$FUSE_VERSION/configure" \ && "/usr/local/src/libfuse-fuse-$FUSE_VERSION/configure" \
&& make "$PARALLELMFLAGS" install \ && make "$PARALLELMFLAGS" install \
&& rm -rf /tmp/out \ && rm -rf "$builddir" \
&& rm -rf /var/lib/apt/lists/* && apt purge -y $builddeps
ARG WEBSOCKETS_VERSION=3.1.0 ARG WEBSOCKETS_VERSION=3.1.0
RUN set -x \ RUN set -x \
&& apt update \
&& apt install --yes --no-install-recommends \ && apt install --yes --no-install-recommends \
ca-certificates \
openssl \ openssl \
libssl-dev \ libssl-dev \
&& mkdir -p /tmp/out \ && builddir="/tmp/out" \
&& cd /tmp/out \ && mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \ && cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \
&& make "$PARALLELMFLAGS" install \ && make "$PARALLELMFLAGS" install \
&& rm -rf /tmp/out \ && rm -rf "$builddir"
&& rm -rf /var/lib/apt/lists/*
ARG JANSSON_VERSION=2.12 ARG JANSSON_VERSION=2.12
RUN set -x \ RUN set -x \
&& mkdir -p /tmp/out \ && builddir="/tmp/out" \
&& cd /tmp/out \ && mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \ && cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \
&& make "$PARALLELMFLAGS" install \ && make "$PARALLELMFLAGS" install \
&& rm -rf /tmp/out && rm -rf "$builddir"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
@ -81,3 +99,5 @@ RUN set -x \
WORKDIR "$OUT" WORKDIR "$OUT"
ENTRYPOINT ["dumb-init", "--"]

View File

@ -13,60 +13,78 @@ RUN set -x \
ninja-build \ ninja-build \
pkg-config \ pkg-config \
rsync \ rsync \
&& rm -rf /var/lib/apt/lists/* gdb \
gdbserver
COPY src /usr/local/src COPY src /usr/local/src
ARG PARALLELMFLAGS=-j2 ARG PARALLELMFLAGS=-j2
ARG DUMB_INIT_VERISON=1.2.2
RUN set -x \
&& builddeps="xxd" \
&& apt install --yes --no-install-recommends $builddeps \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cp -R "/usr/local/src/dumb-init-$DUMB_INIT_VERISON" . \
&& cd dumb-init-$DUMB_INIT_VERISON \
&& make "$PARALLELMFLAGS" \
&& chmod +x dumb-init \
&& mv dumb-init /usr/local/bin/dumb-init \
&& dumb-init --version \
&& rm -rf "$builddir" \
&& apt purge -y $builddeps
ARG GTEST_VERSION=1.8.1 ARG GTEST_VERSION=1.8.1
RUN set -x \ RUN set -x \
&& mkdir -p /tmp/out \ && builddir="/tmp/out" \
&& cd /tmp/out \ && mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \ && cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \
&& make "$PARALLELMFLAGS" install \ && make "$PARALLELMFLAGS" install \
&& rm -rf /tmp/out && rm -rf "$builddir"
ARG FUSE_VERSION=3.1.1 ARG FUSE_VERSION=3.1.1
RUN set -x \ RUN set -x \
&& apt update \ && builddeps="libtool automake gettext" \
&& apt install --yes --no-install-recommends \ && apt install --yes --no-install-recommends $builddeps \
libtool \
automake \
gettext \
&& cd "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \ && cd "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& ./makeconf.sh \ && ./makeconf.sh \
&& mkdir -p /tmp/out \ && builddir="/tmp/out" \
&& cd /tmp/out \ && mkdir -p "$builddir" \
&& cd "$builddir" \
&& "/usr/local/src/libfuse-fuse-$FUSE_VERSION/configure" \ && "/usr/local/src/libfuse-fuse-$FUSE_VERSION/configure" \
&& make "$PARALLELMFLAGS" install \ && make "$PARALLELMFLAGS" install \
&& rm -rf /tmp/out \ && rm -rf "$builddir" \
&& rm -rf /var/lib/apt/lists/* && apt purge -y $builddeps
ARG WEBSOCKETS_VERSION=3.1.0 ARG WEBSOCKETS_VERSION=3.1.0
RUN set -x \ RUN set -x \
&& apt update \
&& apt install --yes --no-install-recommends \ && apt install --yes --no-install-recommends \
ca-certificates \
openssl \ openssl \
libssl-dev \ libssl-dev \
&& mkdir -p /tmp/out \ && builddir="/tmp/out" \
&& cd /tmp/out \ && mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \ && cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \
&& make "$PARALLELMFLAGS" install \ && make "$PARALLELMFLAGS" install \
&& rm -rf /tmp/out \ && rm -rf "$builddir"
&& rm -rf /var/lib/apt/lists/*
ARG JANSSON_VERSION=2.12 ARG JANSSON_VERSION=2.12
RUN set -x \ RUN set -x \
&& mkdir -p /tmp/out \ && builddir="/tmp/out" \
&& cd /tmp/out \ && mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \ && cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \
&& make "$PARALLELMFLAGS" install \ && make "$PARALLELMFLAGS" install \
&& rm -rf /tmp/out && rm -rf "$builddir"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
@ -82,3 +100,5 @@ RUN set -x \
WORKDIR "$OUT" WORKDIR "$OUT"
ENTRYPOINT ["dumb-init", "--"]

View File

@ -41,6 +41,7 @@ fi
{ {
echo '#include <...> search starts here:' echo '#include <...> search starts here:'
# shellcheck disable=SC1117
sed -n -e "s@\(.*\)@$INCLUDE_DIRS_PREFIX\1@p" "$INCLUDE_DIRS_TMPFILE" sed -n -e "s@\(.*\)@$INCLUDE_DIRS_PREFIX\1@p" "$INCLUDE_DIRS_TMPFILE"
echo 'End of search list.' echo 'End of search list.'
} > "$INCLUDE_DIRS_FILE" } > "$INCLUDE_DIRS_FILE"

View File

@ -2,7 +2,22 @@
<project> <project>
<configuration id="cdt.managedbuild.toolchain.gnu.base.2091678410" name="amd64-ubuntu"> <configuration id="cdt.managedbuild.toolchain.gnu.base.2091678410" name="amd64-ubuntu">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true"/> <provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<language id="org.eclipse.cdt.core.gcc">
<resource project-relative-path="">
<entry kind="includeFile" name="/${ProjName}/.build/amd64-ubuntu-builder/Debug/builtins.h">
<flag value="BUILTIN|LOCAL|VALUE_WORKSPACE_PATH"/>
</entry>
</resource>
</language>
<language id="org.eclipse.cdt.core.g++">
<resource project-relative-path="">
<entry kind="includeFile" name="/${ProjName}/.build/amd64-ubuntu-builder/Debug/builtins.hpp">
<flag value="BUILTIN|LOCAL|VALUE_WORKSPACE_PATH"/>
</entry>
</resource>
</language>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(g?cc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/> <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(g?cc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>

36
build/run_image.template Normal file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e
PROJECT_ROOT="${PROJECT_ROOT:-%PROJECT_ROOT%}"
DOCKER="${DOCKER:-%DOCKER%}"
IMAGE="${IMAGE:-%IMAGE%}"
NETWORK="${NETWORK:-host}"
HOST_CONTAINER="${HOST_CONTAINER:-"$("$PROJECT_ROOT/build/get_container_id.sh")"}"
# shellcheck disable=SC2162
read -a ADDITIONAL_RUNFLAGS <<< "$RUNFLAGS"
RUNFLAGS=()
# shellcheck disable=SC2191
RUNFLAGS+=( %RUNFLAGS% )
if [[ -n "$HOST_CONTAINER" ]]; then
RUNFLAGS+=( --volumes-from "$HOST_CONTAINER" )
fi
RUNFLAGS+=( --network "$NETWORK" )
if [[ -n "$CONTAINER_CGROUP_PARENT" ]]; then
RUNFLAGS+=( --cgroup-parent "$CONTAINER_CGROUP_PARENT" )
fi
RUNFLAGS+=( --workdir "$PWD" )
RUNCMD=( %RUNCMD% )
set -- "${RUNFLAGS[@]}" "${ADDITIONAL_RUNFLAGS[@]}" "$IMAGE" "${RUNCMD[@]}" "$@"
exec "$DOCKER" run "$@"