From 7d93c1c238ca0cca90b9accdfe9f1c71fe723ff8 Mon Sep 17 00:00:00 2001 From: cornfeedhobo Date: Sun, 20 Oct 2024 23:23:47 -0500 Subject: [PATCH] bump to v0.18.3.3 --- Dockerfile | 93 ++++++++++++++++++++++++++------------- README.md | 4 +- VERSION | 2 +- build.sh | 1 + docker-compose.yml | 1 - epee.stdint.patch | 12 ----- patches/easylogging.patch | 13 ++++++ patches/epee.patch | 24 ++++++++++ patches/miniupnpc.2.patch | 22 +++++++++ patches/miniupnpc.patch | 14 ++++++ patches/monero.patch | 25 +++++++++++ 11 files changed, 165 insertions(+), 46 deletions(-) delete mode 100644 epee.stdint.patch create mode 100644 patches/easylogging.patch create mode 100644 patches/epee.patch create mode 100644 patches/miniupnpc.2.patch create mode 100644 patches/miniupnpc.patch create mode 100644 patches/monero.patch diff --git a/Dockerfile b/Dockerfile index cd4eae4..8a6fb2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,40 +1,52 @@ # Multistage docker build, requires docker 17.05 +ARG ALPINE_TAG=3.20 + # Builder stage -FROM alpine:edge as builder +FROM alpine:${ALPINE_TAG} as builder ARG MONERO_TAG RUN test -n "${MONERO_TAG}" RUN set -ex && \ apk update && \ - apk upgrade --no-cache && \ - apk add --no-cache \ + apk upgrade && \ + apk add \ autoconf \ automake \ + boost-dev \ + clang-dev \ cmake \ + cppzmq \ curl \ doxygen \ file \ - g++ \ gettext \ git \ go \ gperf \ + graphviz-dev \ + hidapi-dev \ + icu-data-full \ libtool \ + libsodium-dev \ + libudev-zero-dev \ + libusb-dev \ linux-headers \ + llvm-libunwind-dev \ make \ + openssl-dev \ patch \ perl \ python3 \ + qt5-qttools-dev \ + rapidjson-dev \ + readline-dev \ + samurai \ + unbound-dev \ + zeromq-dev \ zlib-dev -# Alpine doesn't package this anymore, and it's been archived on github. -# This is dirty and won't last forever. It might be worth embedding soon. -RUN apk add --no-cache \ - --repository=http://dl-cdn.alpinelinux.org/alpine/v3.16/main \ - libexecinfo-dev - # Build the fixuid tool RUN set -ex && \ go install github.com/boxboat/fixuid@v0.5.1 && \ @@ -48,38 +60,59 @@ RUN git clone \ WORKDIR /usr/src/monero -# This is patched on master, but didn't make it into this release. -COPY epee.stdint.patch epee.stdint.patch -RUN patch -p1 < epee.stdint.patch - -# Set flags that make it possible to compile against musl. -ENV CFLAGS="-fPIC -DELPP_FEATURE_CRASH_LOG -DSTACK_TRACE=OFF" -ENV CXXFLAGS="-fPIC -DELPP_FEATURE_CRASH_LOG -DSTACK_TRACE=OFF" -ENV LDFLAGS="-Wl,-V" +# patches needed to work with alpine +COPY patches patches +RUN set -ex && \ + patch -p1 < patches/easylogging.patch && \ + patch -p1 < patches/epee.patch && \ + patch -p1 < patches/miniupnpc.patch && \ + patch -p1 < patches/monero.patch -# Build dependencies and monero, but like, be nice about it. -RUN nice -n 19 \ +# Build monero, but like, be nice about it. +RUN set -ex && \ + cmake \ + -Wno-dev \ + -B build \ + -G Ninja \ + -D ARCH="x86-64" \ + -D BUILD_64=on \ + -D BUILD_TAG="linux-x64" \ + -D BUILD_TESTS=off \ + -D MANUAL_SUBMODULES=1 \ + -D STACK_TRACE=off \ + -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_C_COMPILER=clang \ + -D CMAKE_CXX_COMPILER=clang++ \ + -D CMAKE_INSTALL_PREFIX=/usr \ + && \ + nice -n 19 \ ionice -c2 -n7 \ - make -j${NPROC:-$(( $(nproc) - 1 ))} depends target=x86_64-linux-gnu + cmake --build build # Runtime stage -FROM alpine:edge as runtime +FROM alpine:${ALPINE_TAG} as runtime RUN set -ex && \ apk update && \ apk upgrade --no-cache && \ apk add --no-cache \ - ca-certificates - -# Alpine doesn't package this anymore, and it's been archived on github. -# This is dirty and won't last forever. It might be worth embedding soon. -RUN apk add --no-cache \ - --repository=http://dl-cdn.alpinelinux.org/alpine/v3.16/main \ - libexecinfo + boost \ + ca-certificates \ + hidapi \ + libsodium-dev \ + libudev-zero \ + libusb \ + llvm-libunwind \ + openssl \ + rapidjson \ + readline \ + unbound \ + zeromq \ + zlib COPY --from=builder /root/go/bin/fixuid /usr/local/bin/fixuid -COPY --from=builder /usr/src/monero/build/x86_64-linux-gnu/release/bin/* /usr/local/bin/ +COPY --from=builder /usr/src/monero/build/bin/* /usr/local/bin/ # Create a dedicated user and configure fixuid ARG MONERO_USER="monero" diff --git a/README.md b/README.md index 2f2e129..62a4a6b 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ ## TL;DR ```bash -UID="$(id -u)" GID="$(id -g)" docker-compose run wallet +UID="$(id -u)" GID="$(id -g)" docker compose run wallet ``` ```bash -docker-compose down +docker compose down ``` ## Running the Daemon diff --git a/VERSION b/VERSION index 1ec0588..03341b5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.18.3.2 +v0.18.3.3 diff --git a/build.sh b/build.sh index f439751..2ff9f11 100755 --- a/build.sh +++ b/build.sh @@ -13,6 +13,7 @@ docker_tag="${1:-${monero_tag}}" build_script=( docker build + --progress=plain --build-arg="MONERO_TAG=${monero_tag}" --tag="cornfeedhobo/monero:${docker_tag}" . diff --git a/docker-compose.yml b/docker-compose.yml index d5a99e1..d9915f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,5 @@ services: target: "/home/monero/.bitmonero" command: > monero-wallet-cli - --wallet-file="${WALLET:-wallet}" --daemon-address="blockchain:18081" --trusted-daemon diff --git a/epee.stdint.patch b/epee.stdint.patch deleted file mode 100644 index 24401eb..0000000 --- a/epee.stdint.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/contrib/epee/include/net/http_base.h b/contrib/epee/include/net/http_base.h -index 4af4da790..ee49c6e2a 100644 ---- a/contrib/epee/include/net/http_base.h -+++ b/contrib/epee/include/net/http_base.h -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - - #undef MONERO_DEFAULT_LOG_CATEGORY - #define MONERO_DEFAULT_LOG_CATEGORY "net.http" diff --git a/patches/easylogging.patch b/patches/easylogging.patch new file mode 100644 index 0000000..c930c42 --- /dev/null +++ b/patches/easylogging.patch @@ -0,0 +1,13 @@ +diff --git a/external/easylogging++/easylogging++.h b/external/easylogging++/easylogging++.h +index b983a79..6d51f00 100644 +--- a/external/easylogging++/easylogging++.h ++++ b/external/easylogging++/easylogging++.h +@@ -221,7 +221,7 @@ ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStre + # define ELPP_INTERNAL_INFO(lvl, msg) + #endif // (defined(ELPP_DEBUG_INFO)) + #if (defined(ELPP_FEATURE_ALL)) || (defined(ELPP_FEATURE_CRASH_LOG)) +-# if (ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_OPENBSD && !ELPP_OS_NETBSD && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN) ++# if (__has_include() && ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_OPENBSD && !ELPP_OS_NETBSD && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN) + # define ELPP_STACKTRACE 1 + # else + # define ELPP_STACKTRACE 0 diff --git a/patches/epee.patch b/patches/epee.patch new file mode 100644 index 0000000..08404d6 --- /dev/null +++ b/patches/epee.patch @@ -0,0 +1,24 @@ +diff --git a/contrib/epee/include/net/http_base.h b/contrib/epee/include/net/http_base.h +index 4af4da7..ee49c6e 100644 +--- a/contrib/epee/include/net/http_base.h ++++ b/contrib/epee/include/net/http_base.h +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #undef MONERO_DEFAULT_LOG_CATEGORY + #define MONERO_DEFAULT_LOG_CATEGORY "net.http" +diff --git a/contrib/epee/src/file_io_utils.cpp b/contrib/epee/src/file_io_utils.cpp +index c0798a5..2fd3aa1 100644 +--- a/contrib/epee/src/file_io_utils.cpp ++++ b/contrib/epee/src/file_io_utils.cpp +@@ -26,6 +26,7 @@ + + #include "file_io_utils.h" + ++#include + #include + #include + #include diff --git a/patches/miniupnpc.2.patch b/patches/miniupnpc.2.patch new file mode 100644 index 0000000..ee3d4cd --- /dev/null +++ b/patches/miniupnpc.2.patch @@ -0,0 +1,22 @@ +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index 30e3d31..1c6d1e2 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -2989,7 +2989,7 @@ namespace nodetool + UPNPUrls urls; + IGDdatas igdData; + char lanAddress[64]; +- result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); ++ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, nullptr, 0); + freeUPNPDevlist(deviceList); + if (result > 0) { + if (result == 1) { +@@ -3057,7 +3057,7 @@ namespace nodetool + UPNPUrls urls; + IGDdatas igdData; + char lanAddress[64]; +- result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); ++ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, nullptr, 0); + freeUPNPDevlist(deviceList); + if (result > 0) { + if (result == 1) { diff --git a/patches/miniupnpc.patch b/patches/miniupnpc.patch new file mode 100644 index 0000000..f40c723 --- /dev/null +++ b/patches/miniupnpc.patch @@ -0,0 +1,14 @@ +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index 5b7f69a..8f4a346 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -36,6 +36,9 @@ + # others. + + find_package(Miniupnpc REQUIRED) ++if(NOT MSVC) ++ add_compile_options(-D_GNU_SOURCE) ++endif() + + message(STATUS "Using in-tree miniupnpc") + set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) diff --git a/patches/monero.patch b/patches/monero.patch new file mode 100644 index 0000000..a6ec568 --- /dev/null +++ b/patches/monero.patch @@ -0,0 +1,25 @@ +diff --git a/cmake/Version.cmake b/cmake/Version.cmake +index e9ed9fb..e3377aa 100644 +--- a/cmake/Version.cmake ++++ b/cmake/Version.cmake +@@ -32,7 +32,7 @@ function (write_version tag) + endfunction () + + find_package(Git QUIET) +-if ("$Format:$" STREQUAL "") ++if ("$Format:$" STREQUAL "" OR NOT EXISTS .git) + # We're in a tarball; use hard-coded variables. + set(VERSION_IS_RELEASE "true") + write_version("release") +diff --git a/src/common/combinator.cpp b/src/common/combinator.cpp +index 72b1397..2b42a66 100644 +--- a/src/common/combinator.cpp ++++ b/src/common/combinator.cpp +@@ -29,6 +29,7 @@ + // + // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers + ++#include + #include "combinator.h" + + namespace tools {