Skip to content

Commit 188f30a

Browse files
committed
ci rework
1 parent 30868b5 commit 188f30a

File tree

5 files changed

+111
-58
lines changed

5 files changed

+111
-58
lines changed

.drone.jsonnet

+74-57
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
local default_deps_base = [
22
'libsystemd-dev',
33
'python3-dev',
4-
'libuv1-dev',
54
'libunbound-dev',
65
'nettle-dev',
76
'libssl-dev',
87
'libevent-dev',
8+
'libfmt-dev',
9+
'libspdlog-dev',
910
'libsqlite3-dev',
1011
'libcurl4-openssl-dev',
1112
'libzmq3-dev',
@@ -14,7 +15,7 @@ local default_deps_base = [
1415
];
1516
local default_deps_nocxx = ['libsodium-dev'] + default_deps_base; // libsodium-dev needs to be >= 1.0.18
1617
local default_deps = ['g++'] + default_deps_nocxx;
17-
local docker_base = 'registry.oxen.rocks/lokinet-ci-';
18+
local docker_base = 'registry.oxen.rocks/';
1819

1920
local submodule_commands = [
2021
'git fetch --tags',
@@ -287,14 +288,14 @@ local deb_builder(image, distro, distro_branch, arch='amd64', oxen_repo=true) =
287288
};
288289

289290
local clang(version) = debian_pipeline(
290-
'Debian sid/clang-' + version + ' (amd64)',
291+
'Debian sid/clang-' + version + ' [AMD64]',
291292
docker_base + 'debian-sid-clang',
292293
deps=['clang-' + version] + default_deps_nocxx,
293294
cmake_extra='-DCMAKE_C_COMPILER=clang-' + version + ' -DCMAKE_CXX_COMPILER=clang++-' + version + ' '
294295
);
295296

296297
local full_llvm(version) = debian_pipeline(
297-
'Debian sid/llvm-' + version + ' (amd64)',
298+
'Debian sid/llvm-' + version + ' [AMD64]',
298299
docker_base + 'debian-sid-clang',
299300
deps=['clang-' + version, ' lld-' + version, ' libc++-' + version + '-dev', 'libc++abi-' + version + '-dev']
300301
+ default_deps_nocxx,
@@ -304,12 +305,14 @@ local full_llvm(version) = debian_pipeline(
304305
std.join(' ', [
305306
'-DCMAKE_' + type + '_LINKER_FLAGS=-fuse-ld=lld-' + version
306307
for type in ['EXE', 'MODULE', 'SHARED']
307-
])
308+
]) +
309+
' -DOXEN_LOGGING_FORCE_SUBMODULES=ON'
308310
);
309311

310312
// Macos build
311313
local mac_builder(name,
312314
build_type='Release',
315+
arch='amd64',
313316
werror=true,
314317
cmake_extra='',
315318
local_mirror=true,
@@ -320,7 +323,7 @@ local mac_builder(name,
320323
kind: 'pipeline',
321324
type: 'exec',
322325
name: name,
323-
platform: { os: 'darwin', arch: 'amd64' },
326+
platform: { os: 'darwin', arch: arch },
324327
steps: [
325328
{ name: 'submodules', commands: submodule_commands },
326329
{
@@ -332,10 +335,7 @@ local mac_builder(name,
332335
// basic system headers. WTF apple:
333336
'export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"',
334337
'ulimit -n 1024', // because macos sets ulimit to 256 for some reason yeah idk
335-
'./contrib/mac-configure.sh ' +
336-
ci_dep_mirror(local_mirror) +
337-
'-DWARN_DEPRECATED=OFF ' +
338-
codesign,
338+
'./contrib/mac-configure.sh ' + ci_dep_mirror(local_mirror) + '-DWARN_DEPRECATED=OFF ' + codesign,
339339
'cd build-mac',
340340
// We can't use the 'package' target here because making a .dmg requires an active logged in
341341
// macos gui to invoke Finder to invoke the partitioning tool to create a partitioned (!)
@@ -394,28 +394,78 @@ local docs_pipeline(name, image, extra_cmds=[], allow_fail=false) = {
394394
// docker_base + 'docbuilder',
395395
// extra_cmds=['UPLOAD_OS=docs ./contrib/ci/drone-static-upload.sh']),
396396

397-
// Various debian builds
398-
debian_pipeline('Debian sid (amd64)', docker_base + 'debian-sid'),
399-
debian_pipeline('Debian sid/Debug (amd64)', docker_base + 'debian-sid', build_type='Debug'),
397+
// Debian sid
398+
debian_pipeline('Debian sid [AMD64]', docker_base + 'debian-sid'),
399+
debian_pipeline('Debian sid/debug [AMD64]', docker_base + 'debian-sid', build_type='Debug'),
400+
debian_pipeline('Debian sid [ARM64]', docker_base + 'debian-sid', arch='arm64', jobs=4),
401+
400402
clang(17),
401403
full_llvm(17),
402404
clang(19),
403-
full_llvm(19),
404-
debian_pipeline('Debian stable (i386)', docker_base + 'debian-stable/i386'),
405-
debian_pipeline('Debian bullseye (amd64)',
405+
//full_llvm(19),
406+
407+
// Debian 12
408+
debian_pipeline('Debian 12 static [AMD64]',
409+
docker_base + 'debian-bookworm',
410+
deps=['g++'],
411+
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON'),
412+
debian_pipeline('Debian 12 [ARMHF]', docker_base + 'debian-bookworm/arm32v7', arch='arm64', jobs=4),
413+
debian_pipeline('Debian 12 [i386]', docker_base + 'debian-bookworm/i386'),
414+
415+
// Debian 11
416+
debian_pipeline('Debian 11 [AMD64]',
406417
docker_base + 'debian-bullseye',
407418
extra_setup=debian_backports('bullseye', ['cmake']) + local_gnutls()),
408-
debian_pipeline('Ubuntu latest (amd64)', docker_base + 'ubuntu-rolling'),
409-
debian_pipeline('Ubuntu LTS (amd64)', docker_base + 'ubuntu-lts'),
410-
debian_pipeline('Ubuntu focal (amd64)',
419+
debian_pipeline('Debian 11 static/debug [AMD64]',
420+
docker_base + 'debian-bullseye',
421+
build_type='Debug',
422+
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON',
423+
extra_setup=debian_backports('bullseye', ['cmake'])),
424+
425+
// Static debian 11 armhf (upload to builds.lokinet.dev)
426+
debian_pipeline('Debian 11 static [ARMHF]',
427+
docker_base + 'debian-bullseye/arm32v7',
428+
arch='arm64',
429+
deps=['g++', 'python3-dev', 'automake', 'libtool'],
430+
extra_setup=debian_backports('bullseye', ['cmake']),
431+
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON ' +
432+
'-DCMAKE_CXX_FLAGS="-march=armv7-a+fp -Wno-psabi" -DCMAKE_C_FLAGS="-march=armv7-a+fp" ' +
433+
'-DNATIVE_BUILD=OFF -DWITH_SYSTEMD=OFF -DWITH_BOOTSTRAP=OFF',
434+
extra_cmds=[
435+
'./contrib/ci/drone-check-static-libs.sh',
436+
'UPLOAD_OS=linux-armhf ./contrib/ci/drone-static-upload.sh',
437+
],
438+
allow_fail=true, // XXX FIXME: build currently fails!
439+
jobs=4),
440+
441+
// Ubuntu
442+
debian_pipeline('Ubuntu latest [AMD64]', docker_base + 'ubuntu-rolling'),
443+
debian_pipeline('Ubuntu LTS [AMD64]', docker_base + 'ubuntu-lts'),
444+
debian_pipeline('Ubuntu 22.04 [AMD64]', docker_base + 'ubuntu-jammy'),
445+
debian_pipeline('Ubuntu 20.04 [AMD64]',
411446
docker_base + 'ubuntu-focal',
412447
deps=['g++-10'] + default_deps_nocxx,
413448
extra_setup=kitware_repo('focal') + local_gnutls(),
414449
cmake_extra='-DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10'),
415450

416-
// ARM builds (ARM64 and armhf)
417-
debian_pipeline('Debian sid (ARM64)', docker_base + 'debian-sid', arch='arm64', jobs=4),
418-
debian_pipeline('Debian stable (armhf)', docker_base + 'debian-stable/arm32v7', arch='arm64', jobs=4),
451+
// Static ubuntu focal amd64 build (upload to builds.lokinet.dev)
452+
debian_pipeline('Ubuntu 20.04 static [AMD64]',
453+
docker_base + 'ubuntu-focal',
454+
deps=['g++-10', 'python3-dev', 'automake', 'libtool'],
455+
extra_setup=kitware_repo('focal'),
456+
lto=true,
457+
tests=false,
458+
oxen_repo=true,
459+
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON ' +
460+
'-DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 ' +
461+
'-DCMAKE_CXX_FLAGS="-march=x86-64 -mtune=haswell" ' +
462+
'-DCMAKE_C_FLAGS="-march=x86-64 -mtune=haswell" ' +
463+
'-DNATIVE_BUILD=OFF -DWITH_SYSTEMD=OFF -DWITH_BOOTSTRAP=OFF -DBUILD_LIBLOKINET=OFF',
464+
extra_cmds=[
465+
'./contrib/ci/drone-check-static-libs.sh',
466+
'./contrib/ci/drone-static-upload.sh',
467+
]),
468+
419469

420470
// cross compile targets
421471
// Aug 11: these are exhibiting some dumb failures in libsodium and external deps, TOFIX later
@@ -430,45 +480,12 @@ local docs_pipeline(name, image, extra_cmds=[], allow_fail=false) = {
430480
//apk_builder('android apk', docker_base + 'flutter', extra_cmds=['UPLOAD_OS=android ./contrib/ci/drone-static-upload.sh']),
431481

432482
// Windows builds (x64)
433-
windows_cross_pipeline('Windows (amd64)',
434-
docker_base + 'debian-bookworm',
483+
windows_cross_pipeline('Windows [AMD64]',
484+
docker_base + 'debian-win32-cross',
435485
extra_cmds=[
436486
'./contrib/ci/drone-static-upload.sh',
437487
]),
438488

439-
// Static build (on focal) which gets uploaded to builds.lokinet.dev:
440-
debian_pipeline('Static (focal amd64)',
441-
docker_base + 'ubuntu-focal',
442-
deps=['g++-10', 'python3-dev', 'automake', 'libtool'],
443-
extra_setup=kitware_repo('focal'),
444-
lto=true,
445-
tests=false,
446-
oxen_repo=true,
447-
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON ' +
448-
'-DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 ' +
449-
'-DCMAKE_CXX_FLAGS="-march=x86-64 -mtune=haswell" ' +
450-
'-DCMAKE_C_FLAGS="-march=x86-64 -mtune=haswell" ' +
451-
'-DNATIVE_BUILD=OFF -DWITH_SYSTEMD=OFF -DWITH_BOOTSTRAP=OFF -DBUILD_LIBLOKINET=OFF',
452-
extra_cmds=[
453-
'./contrib/ci/drone-check-static-libs.sh',
454-
'./contrib/ci/drone-static-upload.sh',
455-
]),
456-
// Static armhf build (gets uploaded)
457-
debian_pipeline('Static [FIXME] (bullseye armhf)',
458-
docker_base + 'debian-bullseye/arm32v7',
459-
arch='arm64',
460-
deps=['g++', 'python3-dev', 'automake', 'libtool'],
461-
extra_setup=debian_backports('bullseye', ['cmake']),
462-
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON ' +
463-
'-DCMAKE_CXX_FLAGS="-march=armv7-a+fp -Wno-psabi" -DCMAKE_C_FLAGS="-march=armv7-a+fp" ' +
464-
'-DNATIVE_BUILD=OFF -DWITH_SYSTEMD=OFF -DWITH_BOOTSTRAP=OFF',
465-
extra_cmds=[
466-
'./contrib/ci/drone-check-static-libs.sh',
467-
'UPLOAD_OS=linux-armhf ./contrib/ci/drone-static-upload.sh',
468-
],
469-
allow_fail=true, // XXX FIXME: build currently fails!
470-
jobs=4),
471-
472489
/*
473490
// integration tests
474491
debian_pipeline('Router Hive',

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ if(WARNINGS_AS_ERRORS)
184184
list(APPEND warning_flags -Werror -Wno-error=array-bounds)
185185
endif()
186186

187+
# GCC 12's stringop-overflow warnings are really broken, with tons and tons of false positives all
188+
# over the place (not just in our code, but also in its own stdlibc++ code). It's better in 13
189+
# w.r.t. stdlibc++, but our code still throws tons of warnings, so disable it for now.
190+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
191+
list(APPEND warning_flags -Wno-stringop-overflow)
192+
endif()
187193
list(APPEND warning_flags -Wno-deprecated-declarations)
188194

189195
add_library(lokinet-base-internal_warnings INTERFACE)

llarp/dns/question.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ namespace llarp::dns
102102

103103
std::string Question::to_string() const
104104
{
105-
return "DNSQuestion:[ qname:{} | qtype:{:x} | qclass:{:x} ]"_format(qname, qtype, qclass);
105+
return "DNSQuestion:[ qname:{} | qtype:{} | qclass:{} ]"_format(qname, qtype, qclass);
106106
}
107107
} // namespace llarp::dns

llarp/router/router.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,17 @@ namespace llarp
376376
// Router config
377377
min_client_outbounds = conf.router.client_router_connections;
378378

379+
// clang-format off
380+
DISABLE_WARNING_PUSH
381+
DISABLE_MAYBE_UNINITIALIZED
379382
std::optional<std::string> paddr = (conf.router.public_ip) ? conf.router.public_ip
380383
: (conf.links.public_addr) ? conf.links.public_addr
381384
: std::nullopt;
382385
std::optional<uint16_t> pport = (conf.router.public_port) ? conf.router.public_port
383386
: (conf.links.public_port) ? conf.links.public_port
384387
: std::nullopt;
388+
DISABLE_WARNING_POP
389+
// clang-format on
385390

386391
if (pport.has_value() and not paddr.has_value())
387392
throw std::runtime_error{"If public-port is specified, public-addr must be as well!"};

llarp/util/common.hpp

+25
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,28 @@
77

88
#include <cstdint>
99
#include <cstdlib>
10+
11+
// clang-format off
12+
#if defined(__GNUC__) || defined(__clang__)
13+
#define DO_PRAGMA(X) _Pragma(#X)
14+
#define DISABLE_WARNING_PUSH DO_PRAGMA(GCC diagnostics push)
15+
#define DISABLE_WARNING_POP DO_PRAGMA(GCC diagnostic pop)
16+
#define DISABLE_WARNING(wname) DO_PRAGMA(GCC diagnostic ignored #wname)
17+
#elif defined(_MSC_VER_)
18+
#define DISABLE_WARNING_PUSH __pragma(warning(push))
19+
#define DISABLE_WARNING_POP __pragma(warning(pop))
20+
#define DISABLE_WARNING(wnumber) __pragma(warning(disable : wnumber))
21+
#else
22+
// unknown compiler, ignore suppression directives
23+
#define DISABLE_WARNING_PUSH
24+
#define DISABLE_WARNING_POP
25+
#endif
26+
27+
#if defined(__GNUC__) || defined(__clang__)
28+
#define DISABLE_MAYBE_UNINITIALIZED DISABLE_WARNING(-Wmaybe-uninitialized)
29+
#elif defined(_MSC_VER_)
30+
#define DISABLE_MAYBE_UNINITIALIZED DISABLE_WARNING(C4701)
31+
#else
32+
#define DISABLE_MAYBE_UNINITIALIZED
33+
#endif
34+
// clang-format on

0 commit comments

Comments
 (0)