Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker image for better caching #115

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

l0rinc
Copy link

@l0rinc l0rinc commented Jul 26, 2024

Put the creating of the runtime and compile images before the copy . . so that they're cached as stable layers, to make sure local changes don't rebuild them.

The build image is now built on top of the runtime image, speeding up build time (and making sure the copied files are actually run on the exact same platform).

Also added make clean, fixed in https://github.com/hoytech/golpe/pull/3/files.
These fix the build issue mentioned in #107


FROM alpine:3.18.3 AS build

ENV TZ=Europe/London
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessarry, isn't UTC the default?

@@ -24,25 +24,24 @@ RUN \
lmdb-dev \
flatbuffers-dev \
libsecp256k1-dev \
zstd-dev \
&& rm -rf /var/cache/apk/* \
Copy link
Author

@l0rinc l0rinc Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have --no-cache in the runtime build:

docker images

REPOSITORY              TAG       IMAGE ID       CREATED          SIZE
strfry_image_original   latest    bba6a16b8521   14 seconds ago   143MB

and

REPOSITORY     TAG       IMAGE ID       CREATED         SIZE
strfry_image   latest    22a7b0451b35   7 minutes ago   143MB

btw, the Ubuntu one is a lot bigger:

REPOSITORY            TAG       IMAGE ID       CREATED         SIZE
strfry_image_ubuntu   latest    312188f2bc47   3 minutes ago   206MB

&& rm -rf /var/cache/apk/*
COPY . .

RUN make clean \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean was added to the runtime to avoid reusing the local build artefacts

@@ -35,15 +35,15 @@ A C++20 compiler is required, along with a few other common dependencies. On Deb
git clone https://github.com/hoytech/strfry && cd strfry/
git submodule update --init
make setup-golpe
make -j4
make -j$(nproc)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be able to use all processors when not in a docker image

@@ -1,4 +1,4 @@
FROM ubuntu:jammy as build
FROM ubuntu:jammy AS build
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to silence the warning


COPY . .
# Runtime dependencies
FROM alpine:3.18.3 AS runtime-deps
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can update to 3.20.2 in another PR

RUN \
apk --no-cache add \
# Build dependencies
FROM runtime-deps AS build-deps
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid repeating the image and avoid redownloading the dependencies

@asoltys
Copy link

asoltys commented Aug 25, 2024

I tried to build with the Dockerfile from this PR but got errors:

 => ERROR [build 3/3] RUN make clean  && git submodule update --init  && make setup-golpe  && make -j4                                                                                   128.6s
------
 > [build 3/3] RUN make clean  && git submodule update --init  && make setup-golpe  && make -j4:
0.512 rm -f strfry src/*.o src/*.d src/apps/*/*.o src/apps/*/*.d
0.514 rm -rf build/
0.515 rm -f golpe/external/uWebSockets/src/{*.o,libuWS.a,libuWS.so}
0.941 cd golpe/external && git submodule update --init hoytech-cpp docopt.cpp loguru parallel-hashmap \
0.941     config \
0.941     json PEGTL \
0.941     rasgueadb \
0.941     lmdbxx \
0.941     templar \
0.941     uWebSockets
1.157 golpe/gen-fbs.pl
1.158 golpe/gen-config.pl
1.159 PERL5LIB=golpe/vendor/ golpe/external/rasgueadb/rasgueadb-generate golpe.yaml build
1.159 golpe/gen-main.cpp.pl
1.164
1.164 warning:
1.164   /build/fbs/nostr-index.fbs:22: 15: warning: field names should be lowercase snake_case, got: tagsGeneral
1.164 /build/fbs/nostr-index.fbs:23: 15: warning: field names should be lowercase snake_case, got: tagsFixed32
1.164
1.165 golpe/gen-golpe.h.pl
1.246 PERL5LIB=golpe/vendor/ perl golpe/external/templar/templar.pl src/tmpls/ strfrytmpl build/StrfryTemplates.h
1.285 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT golpe/logging.o -MF golpe/logging.d -c golpe/logging.cpp -o golpe/logging.o
1.285 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT build/main.o -MF build/main.d -c build/main.cpp -o build/main.o
1.285 g++ -std=c++20 -O0 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT build/config.o -MF build/config.d -c build/config.cpp -o build/config.o
1.410 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/Decompressor.o -MF src/Decompressor.d -c src/Decompressor.cpp -o src/Decompressor.o
3.876 In file included from golpe/logging.cpp:3:
3.876 golpe/external/loguru/loguru.cpp: In function 'loguru::Text loguru::errno_as_text()':
3.876 golpe/external/loguru/loguru.cpp:581:22: warning: unused variable 'buff' [-Wunused-variable]
3.876   581 |                 char buff[256];
3.876       |                      ^~~~
6.300 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/events.o -MF src/events.d -c src/events.cpp -o src/events.o
7.555 In file included from /usr/include/c++/12.2.1/string:40,
7.555                  from build/golpe.h:4,
7.555                  from golpe/logging.cpp:1:
7.555 In static member function 'static constexpr std::char_traits<char>::char_type* std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)',
7.555     inlined from 'static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/12.2.1/bits/basic_string.h:423:21,
7.555     inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/12.2.1/bits/basic_string.tcc:532:22,
7.555     inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/12.2.1/bits/basic_string.h:2171:19,
7.555     inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/12.2.1/bits/basic_string.h:1928:22,
7.555     inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]' at /usr/include/c++/12.2.1/bits/basic_string.h:3541:36,
7.555     inlined from 'loguru::Text loguru::ec_to_text(const char*)' at golpe/external/loguru/loguru.cpp:1813:19:
7.555 /usr/include/c++/12.2.1/bits/char_traits.h:431:56: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]
7.555   431 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
7.555       |                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
8.168 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/misc.o -MF src/misc.d -c src/misc.cpp -o src/misc.o
13.67 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/onAppStartup.o -MF src/onAppStartup.d -c src/onAppStartup.cpp -o src/onAppStartup.o
16.98 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_compact.o -MF src/apps/dbutils/cmd_compact.d -c src/apps/dbutils/cmd_compact.cpp -o src/apps/dbutils/cmd_compact.o
18.75 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_delete.o -MF src/apps/dbutils/cmd_delete.d -c src/apps/dbutils/cmd_delete.cpp -o src/apps/dbutils/cmd_delete.o
19.03 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_dict.o -MF src/apps/dbutils/cmd_dict.d -c src/apps/dbutils/cmd_dict.cpp -o src/apps/dbutils/cmd_dict.o
33.49 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_export.o -MF src/apps/dbutils/cmd_export.d -c src/apps/dbutils/cmd_export.cpp -o src/apps/dbutils/cmd_export.o
36.84 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_import.o -MF src/apps/dbutils/cmd_import.d -c src/apps/dbutils/cmd_import.cpp -o src/apps/dbutils/cmd_import.o
44.47 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_info.o -MF src/apps/dbutils/cmd_info.d -c src/apps/dbutils/cmd_info.cpp -o src/apps/dbutils/cmd_info.o
45.84 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_monitor.o -MF src/apps/dbutils/cmd_monitor.d -c src/apps/dbutils/cmd_monitor.cpp -o src/apps/dbutils/cmd_monitor.o
50.99 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/dbutils/cmd_scan.o -MF src/apps/dbutils/cmd_scan.d -c src/apps/dbutils/cmd_scan.cpp -o src/apps/dbutils/cmd_scan.o
59.52 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/relay/RelayCron.o -MF src/apps/relay/RelayCron.d -c src/apps/relay/RelayCron.cpp -o src/apps/relay/RelayCron.o
61.18 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/relay/RelayIngester.o -MF src/apps/relay/RelayIngester.d -c src/apps/relay/RelayIngester.cpp -o src/apps/relay/RelayIngester.o
66.89 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/relay/RelayNegentropy.o -MF src/apps/relay/RelayNegentropy.d -c src/apps/relay/RelayNegentropy.cpp -o src/apps/relay/RelayNegentropy.o
72.07 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/relay/RelayReqMonitor.o -MF src/apps/relay/RelayReqMonitor.d -c src/apps/relay/RelayReqMonitor.cpp -o src/apps/relay/RelayReqMonitor.o
75.87 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/relay/RelayReqWorker.o -MF src/apps/relay/RelayReqWorker.d -c src/apps/relay/RelayReqWorker.cpp -o src/apps/relay/RelayReqWorker.o
76.24 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/relay/RelaySignalHandler.o -MF src/apps/relay/RelaySignalHandler.d -c src/apps/relay/RelaySignalHandler.cpp -o src/apps/relay/RelaySignalHandler.o
82.22 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/relay/RelayWebsocket.o -MF src/apps/relay/RelayWebsocket.d -c src/apps/relay/RelayWebsocket.cpp -o src/apps/relay/RelayWebsocket.o
82.87 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/relay/RelayWriter.o -MF src/apps/relay/RelayWriter.d -c src/apps/relay/RelayWriter.cpp -o src/apps/relay/RelayWriter.o
85.31 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/relay/cmd_relay.o -MF src/apps/relay/cmd_relay.d -c src/apps/relay/cmd_relay.cpp -o src/apps/relay/cmd_relay.o
88.32 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/mesh/cmd_router.o -MF src/apps/mesh/cmd_router.d -c src/apps/mesh/cmd_router.cpp -o src/apps/mesh/cmd_router.o
92.65 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/mesh/cmd_stream.o -MF src/apps/mesh/cmd_stream.d -c src/apps/mesh/cmd_stream.cpp -o src/apps/mesh/cmd_stream.o
95.50 g++ -std=c++20 -O3 -g -Wall -fPIC  -DDOCOPT_HEADER_ONLY -Iinclude -Ibuild -Isrc -Igolpe/external -Igolpe/external/lmdbxx/include -Igolpe/external/config/include -Igolpe/external/json/include -Igolpe/external/PEGTL/include -Igolpe/external/hoytech-cpp -Igolpe/external/docopt.cpp -Igolpe/external/loguru -Igolpe/external/parallel-hashmap -Iexternal/negentropy/cpp -MMD -MP -MT src/apps/mesh/cmd_sync.o -MF src/apps/mesh/cmd_sync.d -c src/apps/mesh/cmd_sync.cpp -o src/apps/mesh/cmd_sync.o
126.3 g++ golpe/logging.o build/main.o build/config.o src/Decompressor.o src/events.o src/misc.o src/onAppStartup.o src/apps/dbutils/cmd_compact.o src/apps/dbutils/cmd_delete.o src/apps/dbutils/cmd_dict.o src/apps/dbutils/cmd_export.o src/apps/dbutils/cmd_import.o src/apps/dbutils/cmd_info.o src/apps/dbutils/cmd_monitor.o src/apps/dbutils/cmd_scan.o src/apps/relay/RelayCron.o src/apps/relay/RelayIngester.o src/apps/relay/RelayNegentropy.o src/apps/relay/RelayReqMonitor.o src/apps/relay/RelayReqWorker.o src/apps/relay/RelaySignalHandler.o src/apps/relay/RelayWebsocket.o src/apps/relay/RelayWriter.o src/apps/relay/cmd_relay.o src/apps/mesh/cmd_router.o src/apps/mesh/cmd_stream.o src/apps/mesh/cmd_sync.o  -flto  golpe/external/uWebSockets/libuWS.a -llmdb -lcrypto -lssl -lz -ldl -pthread -lsecp256k1 -lzstd -o strfry
128.2 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(Networking.o): in function `__gnu_cxx::__is_single_threaded()':
128.2 /usr/include/c++/11/ext/atomicity.h:52: undefined reference to `__libc_single_threaded'
128.2 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(Networking.o): in function `uS::TLS::createContext(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
128.2 /home/adam/strfry/golpe/external/uWebSockets/src/Networking.cpp:48: undefined reference to `SSL_CTX_set_options'
128.2 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(Networking.o): in function `__gnu_cxx::__is_single_threaded()':
128.2 /usr/include/c++/11/ext/atomicity.h:52: undefined reference to `__libc_single_threaded'
128.2 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/include/c++/11/ext/atomicity.h:52: undefined reference to `__libc_single_threaded'
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(Node.o): in function `uS::Node::Node(int, int, int, bool)':
128.4 /home/adam/strfry/golpe/external/uWebSockets/src/Node.cpp:59: undefined reference to `SSL_CTX_set_options'
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(WebSocket.o): in function `uWS::WebSocket<true>::close(int, char const*, unsigned long)':
128.4 /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29: undefined reference to `__memcpy_chk'
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(WebSocket.o): in function `uWS::WebSocket<false>::close(int, char const*, unsigned long)':
128.4 /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29: undefined reference to `__memcpy_chk'
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(WebSocket.o): in function `bool uWS::WebSocketProtocol<true, uWS::WebSocket<true> >::consumeMessage<6u, unsigned char>(unsigned char, char*&, unsigned int&, uWS::WebSocketState<true>*)':
128.4 /usr/include/x86_64-linux-gnu/bits/stdio2.h:71: undefined reference to `__snprintf_chk'
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(WebSocket.o): in function `bool uWS::WebSocketProtocol<true, uWS::WebSocket<true> >::consumeMessage<8u, unsigned short>(unsigned short, char*&, unsigned int&, uWS::WebSocketState<true>*)':
128.4 /usr/include/x86_64-linux-gnu/bits/stdio2.h:71: undefined reference to `__snprintf_chk'
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(WebSocket.o): in function `bool uWS::WebSocketProtocol<true, uWS::WebSocket<true> >::consumeMessage<14u, unsigned long>(unsigned long, char*&, unsigned int&, uWS::WebSocketState<true>*)':
128.4 /usr/include/x86_64-linux-gnu/bits/stdio2.h:71: undefined reference to `__snprintf_chk'
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(WebSocket.o): in function `bool uWS::WebSocketProtocol<false, uWS::WebSocket<false> >::consumeMessage<2u, unsigned char>(unsigned char, char*&, unsigned int&, uWS::WebSocketState<false>*)':
128.4 /usr/include/x86_64-linux-gnu/bits/stdio2.h:71: undefined reference to `__snprintf_chk'
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(WebSocket.o): in function `bool uWS::WebSocketProtocol<false, uWS::WebSocket<false> >::consumeMessage<4u, unsigned short>(unsigned short, char*&, unsigned int&, uWS::WebSocketState<false>*)':
128.4 /usr/include/x86_64-linux-gnu/bits/stdio2.h:71: undefined reference to `__snprintf_chk'
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(WebSocket.o):/usr/include/x86_64-linux-gnu/bits/stdio2.h:71: more undefined references to `__snprintf_chk' follow
128.4 /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: golpe/external/uWebSockets/libuWS.a(HTTPSocket.o): in function `uWS::HttpSocket<true>::upgrade(char const*, char const*, unsigned long, char const*, unsigned long, bool*, bool*)':
128.4 /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29: undefined reference to `__memcpy_chk'
128.6 collect2: error: ld returned 1 exit status
128.6 make: *** [golpe/rules.mk:26: strfry] Error 1
------
Dockerfile:36
--------------------
  35 |
  36 | >>> RUN make clean \
  37 | >>>  && git submodule update --init \
  38 | >>>  && make setup-golpe \
  39 | >>>  && make -j4
  40 |
--------------------
ERROR: failed to solve: process "/bin/sh -c make clean  && git submodule update --init  && make setup-golpe  && make -j4" did not complete successfully: exit code: 2

@l0rinc
Copy link
Author

l0rinc commented Aug 25, 2024

@asoltys, are you able to build on master or on the Ubuntu image?
Since clean is currently broken (fixed in another PR), can you try doing a git clean -fxd before building?

This PR is just reordering the existing image, it's not meant to fix it if it's not working (which can happen if new dependencies aren't compatible anymore).

@asoltys
Copy link

asoltys commented Aug 25, 2024

The ubuntu image worked but I got the same issue with the alpine image when I tried it on the master branch after doing git clean -fxd

@khimaros
Copy link

i'm seeing a similar error when trying to build on debian trixie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants