mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +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:
@@ -11,61 +11,79 @@ RUN set -x \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
rsync \
|
||||
valgrind \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
gdb \
|
||||
gdbserver \
|
||||
valgrind
|
||||
|
||||
COPY src /usr/local/src
|
||||
|
||||
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
|
||||
|
||||
RUN set -x \
|
||||
&& mkdir -p /tmp/out \
|
||||
&& cd /tmp/out \
|
||||
&& builddir="/tmp/out" \
|
||||
&& mkdir -p "$builddir" \
|
||||
&& cd "$builddir" \
|
||||
&& cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \
|
||||
&& make "$PARALLELMFLAGS" install \
|
||||
&& rm -rf /tmp/out
|
||||
&& rm -rf "$builddir"
|
||||
|
||||
ARG FUSE_VERSION=3.1.1
|
||||
|
||||
RUN set -x \
|
||||
&& apt update \
|
||||
&& apt install --yes --no-install-recommends \
|
||||
libtool \
|
||||
automake \
|
||||
gettext \
|
||||
&& builddeps="libtool automake gettext" \
|
||||
&& apt install --yes --no-install-recommends $builddeps \
|
||||
&& cd "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
|
||||
&& ./makeconf.sh \
|
||||
&& mkdir -p /tmp/out \
|
||||
&& cd /tmp/out \
|
||||
&& builddir="/tmp/out" \
|
||||
&& mkdir -p "$builddir" \
|
||||
&& cd "$builddir" \
|
||||
&& "/usr/local/src/libfuse-fuse-$FUSE_VERSION/configure" \
|
||||
&& make "$PARALLELMFLAGS" install \
|
||||
&& rm -rf /tmp/out \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf "$builddir" \
|
||||
&& apt purge -y $builddeps
|
||||
|
||||
ARG WEBSOCKETS_VERSION=3.1.0
|
||||
|
||||
RUN set -x \
|
||||
&& apt update \
|
||||
&& apt install --yes --no-install-recommends \
|
||||
ca-certificates \
|
||||
openssl \
|
||||
libssl-dev \
|
||||
&& mkdir -p /tmp/out \
|
||||
&& cd /tmp/out \
|
||||
&& builddir="/tmp/out" \
|
||||
&& mkdir -p "$builddir" \
|
||||
&& cd "$builddir" \
|
||||
&& cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \
|
||||
&& make "$PARALLELMFLAGS" install \
|
||||
&& rm -rf /tmp/out \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf "$builddir"
|
||||
|
||||
ARG JANSSON_VERSION=2.12
|
||||
|
||||
RUN set -x \
|
||||
&& mkdir -p /tmp/out \
|
||||
&& cd /tmp/out \
|
||||
&& builddir="/tmp/out" \
|
||||
&& mkdir -p "$builddir" \
|
||||
&& cd "$builddir" \
|
||||
&& cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \
|
||||
&& make "$PARALLELMFLAGS" install \
|
||||
&& rm -rf /tmp/out
|
||||
&& rm -rf "$builddir"
|
||||
|
||||
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
|
||||
|
||||
@@ -81,3 +99,5 @@ RUN set -x \
|
||||
|
||||
WORKDIR "$OUT"
|
||||
|
||||
ENTRYPOINT ["dumb-init", "--"]
|
||||
|
||||
|
||||
@@ -13,60 +13,78 @@ RUN set -x \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
rsync \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
gdb \
|
||||
gdbserver
|
||||
|
||||
COPY src /usr/local/src
|
||||
|
||||
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
|
||||
|
||||
RUN set -x \
|
||||
&& mkdir -p /tmp/out \
|
||||
&& cd /tmp/out \
|
||||
&& builddir="/tmp/out" \
|
||||
&& mkdir -p "$builddir" \
|
||||
&& cd "$builddir" \
|
||||
&& cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \
|
||||
&& make "$PARALLELMFLAGS" install \
|
||||
&& rm -rf /tmp/out
|
||||
&& rm -rf "$builddir"
|
||||
|
||||
ARG FUSE_VERSION=3.1.1
|
||||
|
||||
RUN set -x \
|
||||
&& apt update \
|
||||
&& apt install --yes --no-install-recommends \
|
||||
libtool \
|
||||
automake \
|
||||
gettext \
|
||||
&& builddeps="libtool automake gettext" \
|
||||
&& apt install --yes --no-install-recommends $builddeps \
|
||||
&& cd "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
|
||||
&& ./makeconf.sh \
|
||||
&& mkdir -p /tmp/out \
|
||||
&& cd /tmp/out \
|
||||
&& builddir="/tmp/out" \
|
||||
&& mkdir -p "$builddir" \
|
||||
&& cd "$builddir" \
|
||||
&& "/usr/local/src/libfuse-fuse-$FUSE_VERSION/configure" \
|
||||
&& make "$PARALLELMFLAGS" install \
|
||||
&& rm -rf /tmp/out \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf "$builddir" \
|
||||
&& apt purge -y $builddeps
|
||||
|
||||
ARG WEBSOCKETS_VERSION=3.1.0
|
||||
|
||||
RUN set -x \
|
||||
&& apt update \
|
||||
&& apt install --yes --no-install-recommends \
|
||||
ca-certificates \
|
||||
openssl \
|
||||
libssl-dev \
|
||||
&& mkdir -p /tmp/out \
|
||||
&& cd /tmp/out \
|
||||
&& builddir="/tmp/out" \
|
||||
&& mkdir -p "$builddir" \
|
||||
&& cd "$builddir" \
|
||||
&& cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \
|
||||
&& make "$PARALLELMFLAGS" install \
|
||||
&& rm -rf /tmp/out \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf "$builddir"
|
||||
|
||||
ARG JANSSON_VERSION=2.12
|
||||
|
||||
RUN set -x \
|
||||
&& mkdir -p /tmp/out \
|
||||
&& cd /tmp/out \
|
||||
&& builddir="/tmp/out" \
|
||||
&& mkdir -p "$builddir" \
|
||||
&& cd "$builddir" \
|
||||
&& cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \
|
||||
&& make "$PARALLELMFLAGS" install \
|
||||
&& rm -rf /tmp/out
|
||||
&& rm -rf "$builddir"
|
||||
|
||||
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
|
||||
|
||||
@@ -82,3 +100,5 @@ RUN set -x \
|
||||
|
||||
WORKDIR "$OUT"
|
||||
|
||||
ENTRYPOINT ["dumb-init", "--"]
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ fi
|
||||
|
||||
{
|
||||
echo '#include <...> search starts here:'
|
||||
# shellcheck disable=SC1117
|
||||
sed -n -e "s@\(.*\)@$INCLUDE_DIRS_PREFIX\1@p" "$INCLUDE_DIRS_TMPFILE"
|
||||
echo 'End of search list.'
|
||||
} > "$INCLUDE_DIRS_FILE"
|
||||
|
||||
30
build/language.settings.xml
Normal file
30
build/language.settings.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project>
|
||||
<configuration id="cdt.managedbuild.toolchain.gnu.base.2091678410" name="amd64-ubuntu">
|
||||
<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" 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 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 class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="true" env-hash="1982439746031607768" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="make discover-cc" prefer-non-shared="true" store-entries-with-project="false">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
</extension>
|
||||
</configuration>
|
||||
</project>
|
||||
36
build/run_image.template
Normal file
36
build/run_image.template
Normal 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 "$@"
|
||||
Reference in New Issue
Block a user