2021-10-12 01:57:06 +02:00
FROM ubuntu:focal
# Needed to prevent tzdata hanging while expecting user input
ENV DEBIAN_FRONTEND = "noninteractive" TZ = "Europe/London"
2018-07-12 15:28:59 +02:00
# Build and base stuff
2019-11-19 16:30:40 +01:00
# (zlib1g-dev is needed for the Qt host binary builds, but should not be used by target binaries)
2020-03-27 22:58:51 +01:00
ENV APT_ARGS = "-y --no-install-recommends --no-upgrade"
2023-07-04 19:36:00 +02:00
# Install packages for i386; disabled on aarch64 and arm64 hosts
RUN ( dpkg --print-architecture | grep -Eq 'aarch64|arm64' || dpkg --add-architecture i386)
RUN ( dpkg --print-architecture | grep -Eq 'aarch64|arm64' || ( apt-get update && apt-get install $APT_ARGS \
g++-9-multilib \
wine32) && rm -rf /var/lib/apt/lists/*)
2021-12-30 19:44:13 +01:00
RUN apt-get update && apt-get install $APT_ARGS \
autotools-dev \
automake \
autoconf \
2021-11-25 05:02:50 +01:00
bison \
2021-12-30 19:44:13 +01:00
build-essential \
bsdmainutils \
curl \
ccache \
2022-03-17 14:51:22 +01:00
clang \
2021-12-30 19:44:13 +01:00
cmake \
g++ \
2022-06-10 15:27:53 +02:00
gettext \
2020-06-03 15:26:39 +02:00
git \
libc++-dev \
libc++abi-dev \
2023-08-03 13:45:17 +02:00
libtool \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-shape0 \
libxcb-sync1 \
libxcb-xfixes0 \
libxcb-xinerama0 \
libxcb-xkb1 \
libxkbcommon-x11-0 \
2021-12-30 19:44:13 +01:00
wget \
unzip \
m4 \
pkg-config \
zlib1g-dev
2018-07-12 15:28:59 +02:00
2023-06-20 21:10:54 +02:00
# Python setup
# PYTHON_VERSION should match the value in .python-version
2024-10-04 22:53:56 +02:00
ARG PYTHON_VERSION = 3 .9.18
2023-06-20 21:10:54 +02:00
RUN apt-get update && apt-get install $APT_ARGS \
ca-certificates \
libbz2-dev \
libffi-dev \
liblzma-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
llvm \
make \
tk-dev \
xz-utils
2024-08-11 11:35:22 +02:00
ENV PYENV_ROOT = "/usr/local/pyenv"
ENV PATH = " ${ PYENV_ROOT } /shims: ${ PYENV_ROOT } /bin: ${ PATH } "
2023-06-20 21:10:54 +02:00
RUN curl https://pyenv.run | bash \
&& pyenv update \
&& pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION \
&& pyenv rehash
2021-12-30 19:44:13 +01:00
RUN pip3 install \
codespell = = 1.17.1 \
flake8 = = 3.8.3 \
jinja2 \
2023-06-21 07:22:37 +02:00
lief = = 0.12.1 \
2021-12-30 19:44:13 +01:00
pyzmq \
vulture = = 2.3 \
2020-06-25 17:08:37 +02:00
mypy = = 0.781 \
2022-04-27 20:14:40 +02:00
yq \
multiprocess
2018-07-12 15:28:59 +02:00
# dash_hash
2023-05-11 11:26:07 +02:00
ARG DASH_HASH_VERSION = 1 .4.0
RUN git clone --depth 1 --no-tags --branch= ${ DASH_HASH_VERSION } https://github.com/dashpay/dash_hash
2023-05-12 03:19:45 +02:00
RUN cd dash_hash && pip3 install -r requirements.txt .
2018-07-12 15:28:59 +02:00
ARG USER_ID = 1000
ARG GROUP_ID = 1000
# add user with specified (or default) user/group ids
2024-08-12 06:58:20 +02:00
ENV USER_ID = " ${ USER_ID } "
ENV GROUP_ID = " ${ GROUP_ID } "
2018-07-12 15:28:59 +02:00
RUN groupadd -g ${ GROUP_ID } dash
2022-08-22 21:42:36 +02:00
RUN useradd -u ${ USER_ID } -g dash -s /bin/bash -m -d /home/dash dash
2018-07-12 15:28:59 +02:00
2020-03-27 22:58:51 +01:00
# Packages needed for all target builds
2021-12-30 19:44:13 +01:00
RUN apt-get update && apt-get install $APT_ARGS \
bc \
gawk \
g++-arm-linux-gnueabihf \
g++-mingw-w64-x86-64 \
jq \
libz-dev \
libncurses5 \
nsis \
python3-zmq \
parallel \
2019-12-17 17:46:08 +01:00
valgrind \
2021-12-30 19:44:13 +01:00
wine-stable \
wine64 \
ci: build TSan with clang 15 and add -Werror=thread-safety, fix-up stacktraces (#5375)
## Description
Pull request was inspired by the need to debug lock problems when
working on https://github.com/dashpay/dash/pull/5352.
As far as I'm aware, only macOS has `-Werror=thread-safety` as part of
its default `CXXFLAGS` despite the capability being present on Linux as
well. This PR introduces thread safety checks for that into our thread
sanitizer build.
Additionally, since we're using Clang, something that on first glimpse,
appears to be something that `stacktraces.cpp` isn't happy with, due to
`-Wl,-wrap` being available only on GCC, that no longer seems to be the
case, since the version of Clang with comes with `focal`, its `lld`
_does_ have support for `-wrap` (see [man page for `lld` on
`focal`](https://manpages.ubuntu.com/manpages/focal/en/man1/lld.1.html)).
The current `stable` version of Clang/LLVM is 15, at the time of this
pull request (see https://apt.llvm.org/) but `focal` ships with an older
version, requiring us to use the official LLVM APT repository. I feel we
should be testing with recent compilers alongside the ones shipped by
LTS distributions.
Certain bugs are only made apparent when testing on rolling release
distros or distros that have faster update cycles, like Fedora (see
https://github.com/dashpay/dash/pull/5295 for an illustration of that),
which ship with more recent compilers. Until we overhaul our CI systems
to test using those distros directly (our current infrastructure is
centered around using a "development image" with an LTS distro as the
base), this is the best we can do.
A similar pull request testing against the latest GCC stable will be
welcome as that is currently outside the scope of this PR as the changes
made were to make sure that builds were operating as expected on
Clang/LLVM 15.
---------
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-05-26 20:49:29 +02:00
xorriso
2020-03-27 22:58:51 +01:00
2024-02-22 13:47:26 +01:00
ARG CPPCHECK_VERSION = 2 .13.0
2021-12-28 22:54:50 +01:00
RUN curl -sL " https://github.com/danmar/cppcheck/archive/ ${ CPPCHECK_VERSION } .tar.gz " | tar -xvzf - --directory /tmp/
RUN cd /tmp/cppcheck-${ CPPCHECK_VERSION } && mkdir build && cd build && cmake .. && cmake --build . -j 8
2024-08-11 11:35:22 +02:00
ENV PATH = " /tmp/cppcheck- ${ CPPCHECK_VERSION } /build/bin: ${ PATH } "
2021-12-28 22:54:50 +01:00
RUN mkdir /usr/local/share/Cppcheck && ln -s /tmp/cppcheck-${ CPPCHECK_VERSION } /cfg/ /usr/local/share/Cppcheck/cfg
2020-06-25 17:08:37 +02:00
ARG SHELLCHECK_VERSION = v0.7.1
RUN curl -sL " https://github.com/koalaman/shellcheck/releases/download/ ${ SHELLCHECK_VERSION } /shellcheck- ${ SHELLCHECK_VERSION } .linux.x86_64.tar.xz " | tar --xz -xf - --directory /tmp/
2024-08-11 11:35:22 +02:00
ENV PATH = " /tmp/shellcheck- ${ SHELLCHECK_VERSION } : ${ PATH } "
2021-09-10 01:32:30 +02:00
2020-03-27 22:58:51 +01:00
# This is a hack. It is needed because gcc-multilib and g++-multilib are conflicting with g++-arm-linux-gnueabihf. This is
# due to gcc-multilib installing the following symbolic link, which is needed for -m32 support. However, this causes
2021-07-17 21:15:21 +02:00
# arm builds to also have the asm folder implicitly in the include search path. This is kind of ok, because the asm folder
2020-03-27 22:58:51 +01:00
# for arm has precedence.
RUN ln -s x86_64-linux-gnu/asm /usr/include/asm
2018-07-12 15:28:59 +02:00
# Make sure std::thread and friends is available
RUN \
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix; \
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix; \
exit 0
2024-02-10 12:47:41 +01:00
ARG LLVM_VERSION = 16
ci: build TSan with clang 15 and add -Werror=thread-safety, fix-up stacktraces (#5375)
## Description
Pull request was inspired by the need to debug lock problems when
working on https://github.com/dashpay/dash/pull/5352.
As far as I'm aware, only macOS has `-Werror=thread-safety` as part of
its default `CXXFLAGS` despite the capability being present on Linux as
well. This PR introduces thread safety checks for that into our thread
sanitizer build.
Additionally, since we're using Clang, something that on first glimpse,
appears to be something that `stacktraces.cpp` isn't happy with, due to
`-Wl,-wrap` being available only on GCC, that no longer seems to be the
case, since the version of Clang with comes with `focal`, its `lld`
_does_ have support for `-wrap` (see [man page for `lld` on
`focal`](https://manpages.ubuntu.com/manpages/focal/en/man1/lld.1.html)).
The current `stable` version of Clang/LLVM is 15, at the time of this
pull request (see https://apt.llvm.org/) but `focal` ships with an older
version, requiring us to use the official LLVM APT repository. I feel we
should be testing with recent compilers alongside the ones shipped by
LTS distributions.
Certain bugs are only made apparent when testing on rolling release
distros or distros that have faster update cycles, like Fedora (see
https://github.com/dashpay/dash/pull/5295 for an illustration of that),
which ship with more recent compilers. Until we overhaul our CI systems
to test using those distros directly (our current infrastructure is
centered around using a "development image" with an LTS distro as the
base), this is the best we can do.
A similar pull request testing against the latest GCC stable will be
welcome as that is currently outside the scope of this PR as the changes
made were to make sure that builds were operating as expected on
Clang/LLVM 15.
---------
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-05-26 20:49:29 +02:00
# Setup Clang+LLVM support
RUN apt-get update && apt-get install $APT_ARGS \
lsb-release \
software-properties-common \
gnupg \
&& rm -rf /var/lib/apt/lists/*
RUN cd /tmp && \
wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
/tmp/llvm.sh ${ LLVM_VERSION } && \
rm -rf /tmp/llvm.sh
2022-08-22 21:42:36 +02:00
RUN \
mkdir -p /src/dash && \
2018-07-12 15:28:59 +02:00
mkdir -p /cache/ccache && \
mkdir /cache/depends && \
mkdir /cache/sdk-sources && \
2022-08-22 21:42:36 +02:00
chown ${ USER_ID } :${ GROUP_ID } /src && \
chown ${ USER_ID } :${ GROUP_ID } -R /src && \
chown ${ USER_ID } :${ GROUP_ID } /cache && \
chown ${ USER_ID } :${ GROUP_ID } -R /cache
2021-12-16 15:14:41 +01:00
2022-08-22 21:42:36 +02:00
WORKDIR /src/dash
2018-07-12 15:28:59 +02:00
USER dash