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

[WIP] The Everything Refactor #2212

Open
wants to merge 312 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
312 commits
Select commit Hold shift + click to select a range
88fd085
Outbound context absorbed sendcontex
dr7ana Oct 18, 2023
66ec886
Compilation fixes
dr7ana Oct 19, 2023
c0b19de
Review commit
dr7ana Oct 19, 2023
b597ae5
"Refactor" aka delete Crypto/CryptoManager
jagerman Oct 19, 2023
12a8932
Cmake restructuring
dr7ana Oct 23, 2023
f574cd7
Clang format include sorting + CMake
dr7ana Oct 24, 2023
f21facf
Add format.sh detection of include problems
jagerman Oct 24, 2023
52b1757
Bring oxen-encoding back in as a submodule
jagerman Oct 18, 2023
3d44e58
Fix systemd linkage
jagerman Oct 24, 2023
57393ea
Review fixes
dr7ana Oct 24, 2023
19f9a8f
Temporarily disable building/running test suite
jagerman Oct 25, 2023
5596ffd
CI Fixes, squash
dr7ana Oct 25, 2023
127ac2c
windows fixes
dr7ana Oct 25, 2023
acf4940
squash
dr7ana Oct 25, 2023
6d6301d
Disable Router Hive & DEB builds
jagerman Oct 25, 2023
b909f53
Default libcrypt to whether or not we find it
jagerman Oct 25, 2023
57c471e
Bump WinDivert to latest
jagerman Oct 25, 2023
c46c18e
Bump libzmq static; remove patches
dr7ana Oct 26, 2023
98583b8
Windows CI fixes
dr7ana Oct 26, 2023
eb37796
Bump oxen-mq for libzmq llvm static build fix
jagerman Oct 26, 2023
cb2a2cf
Weird clang unused variable CI fix
dr7ana Oct 26, 2023
63b8fd4
Don't export CC
jagerman Oct 26, 2023
b3c3dcf
Bump armhf static build to bullseye
jagerman Oct 26, 2023
46482c0
Remove unused file
jagerman Oct 27, 2023
c3641ab
Turn off terrible new cmake 3.24+ default
jagerman Oct 26, 2023
ca5ed01
Bump libquic to latest for static build fixes
jagerman Oct 27, 2023
431490f
Give up for now
jagerman Oct 27, 2023
632f4ee
RC refactor layout
dr7ana Oct 31, 2023
68e67c8
{Remote,Local}RC's
dr7ana Nov 2, 2023
0de50b1
Untangle Endpoint::LookupServiceAsync
jagerman Nov 2, 2023
47bedfd
Review fixes + misc fixes
dr7ana Nov 2, 2023
c149651
A soothing re-nomenclatura
dr7ana Nov 3, 2023
5c6c6bc
config addr change
dr7ana Nov 3, 2023
472fcc7
review fixes
dr7ana Nov 16, 2023
d35073c
libquic bump
dr7ana Nov 17, 2023
3bc8c30
path build message handling mostly finished
tewinget Oct 17, 2023
bf2665b
path control messages and onioning fleshed out
tewinget Oct 21, 2023
62a88b3
omit breaking RC stuff pending refactor
tewinget Nov 3, 2023
2bea5e7
path control message response status changes
tewinget Nov 6, 2023
6572149
chahca nonce size is 24 bytes
tewinget Nov 6, 2023
04e9fd5
build fixes, clang-format, minor touch-ups
tewinget Nov 6, 2023
957280e
Delete llarp::util::memFn
jagerman Nov 8, 2023
f995b30
preconstructed dicts for error/timeout/ok
tewinget Nov 16, 2023
0000c6b
remove some unused "path build"-related functions
tewinget Nov 16, 2023
7fdecef
messages::status -> messages
tewinget Nov 27, 2023
00f30f2
onion encrypt path build frames
tewinget Nov 14, 2023
cd27121
fix some copy/paste derping
tewinget Nov 16, 2023
611d277
remove rc_lookup_handler, relocating useful parts
tewinget Nov 15, 2023
f6594a3
Remove find/lookup router
tewinget Nov 15, 2023
e29e23b
implement and use "gossip_rc" command
tewinget Nov 15, 2023
10984b2
NodeDB RCs don't need insertion time
tewinget Nov 15, 2023
6b728a0
implement new rc gossip logic
tewinget Nov 17, 2023
fb7c90d
remove explicit arg that mirrors default
tewinget Nov 27, 2023
74e7f14
minor style/naming changes
tewinget Nov 27, 2023
e37ef78
Add command to fetch RCs from remote node
tewinget Nov 17, 2023
a42d1c1
Implement fetch RouterIDs method and usage
tewinget Nov 25, 2023
52cd9e1
Minor RC load/store/prune fixups
tewinget Nov 27, 2023
af424cd
(client) periodically fetch RouterIDs from peers
tewinget Nov 27, 2023
9329ad0
FindRouterMessage is gone, also clang-format
tewinget Nov 27, 2023
040fc86
minor fixups
tewinget Nov 27, 2023
5ac4a9a
rework rotate_rc_source function, just for 'normal operation' now
tewinget Nov 28, 2023
07fc024
housekeeping and groundwork, initial commit
dr7ana Nov 28, 2023
ab24f4b
RC/RID fetching logic implemented
dr7ana Nov 28, 2023
d6b8b55
less synchronous for the subsequent fetches
dr7ana Nov 28, 2023
baabfab
fetch RID result handler logic
dr7ana Nov 28, 2023
9bb8558
housekeeping pre-trust model
dr7ana Nov 29, 2023
e1a5d93
move from vectors to unordered_sets
dr7ana Nov 29, 2023
483b79a
pull yourself up by your bootstraps sonny
dr7ana Nov 30, 2023
e02ddd6
trust model
dr7ana Dec 1, 2023
63a57d5
trust model fetch fails
dr7ana Dec 4, 2023
ec88706
testnet prep
dr7ana Dec 4, 2023
44696b1
trust model edge case handling
dr7ana Dec 5, 2023
32e55b0
testnet prep
dr7ana Dec 6, 2023
66ad28a
Local router mode
dr7ana Dec 6, 2023
267a698
libquic vbump
dr7ana Dec 7, 2023
6a32148
address parsing
dr7ana Dec 7, 2023
aeb0798
TELL ME WHEN IT WORKS
dr7ana Dec 8, 2023
686c7e0
testnet: don't give oxend and error when testing is disabled
jagerman Dec 8, 2023
03976d8
Squashed misc testnet fixes
dr7ana Dec 8, 2023
e43833a
Update logging in daemon.cpp
jagerman Dec 8, 2023
6231b49
Remove release motto
jagerman Dec 8, 2023
72276e3
Update libquic
jagerman Dec 8, 2023
ed87b73
Bump libquic
jagerman Dec 8, 2023
be61373
Remove duplicate connection closing method
jagerman Dec 8, 2023
950ebfe
Update libquic
jagerman Dec 9, 2023
4b426f5
Crit logging
dr7ana Dec 11, 2023
c4f0a70
Bootstrap seed
dr7ana Dec 11, 2023
4c3f7dc
kick
dr7ana Dec 11, 2023
0b7997e
kick
dr7ana Dec 11, 2023
2405d36
libquic vbump
dr7ana Dec 11, 2023
7568b71
kick
dr7ana Dec 11, 2023
9c92c30
try queueing
dr7ana Dec 11, 2023
3d9e3ae
kiiiiiick
dr7ana Dec 11, 2023
384cb7a
dont bomb with bootstrap reqs
dr7ana Dec 11, 2023
ba6c8ee
REVERT ME: debug incoming dict data
jagerman Dec 11, 2023
dab6e90
Fix version encoding
jagerman Dec 11, 2023
aabd413
D
dr7ana Dec 11, 2023
eb62185
RemoteRC: `explicit` single-argument constructors
jagerman Dec 11, 2023
4328212
shoot
dr7ana Dec 11, 2023
329acaf
Revert me: debug print the msg/sig/signer
jagerman Dec 11, 2023
ff3a495
Fix pubkey parsing to be read as bytes
jagerman Dec 11, 2023
3161683
Revert me: fix double-hex in debug output
jagerman Dec 11, 2023
b8c8a2c
log
dr7ana Dec 11, 2023
97fe3c6
send localrc, receive as remoterc
dr7ana Dec 11, 2023
cd96497
print but better
dr7ana Dec 11, 2023
0cf5805
DRY duplicated code in RCRemote
jagerman Dec 11, 2023
96c93c9
Bump libquic
jagerman Dec 11, 2023
f00137a
Bump libquic for message move/copy fixes
jagerman Dec 11, 2023
0e88839
who cares
dr7ana Dec 11, 2023
4c25124
libquic vbump
dr7ana Dec 12, 2023
1e1f4dd
come on already work already
dr7ana Dec 12, 2023
90a530a
whatever
dr7ana Dec 12, 2023
6505c7b
Replace GetBestNetIF with quic::Address version
jagerman Dec 12, 2023
d6cc702
Bump libquic for register_command fix
jagerman Dec 12, 2023
8bdfb20
wrap dat
dr7ana Dec 12, 2023
fcbfc19
update seeds before returning no
dr7ana Dec 12, 2023
cb39f64
Fix std::set move semantics
jagerman Dec 12, 2023
8f99ead
doofus
dr7ana Dec 12, 2023
30ea679
better!
dr7ana Dec 12, 2023
a591d44
libquic vbump
dr7ana Dec 13, 2023
dbad0d5
Fixed pending message queue weirdness
dr7ana Dec 13, 2023
9f0766f
Big fix!
dr7ana Dec 13, 2023
bf6e705
libquic vbump
dr7ana Dec 13, 2023
42da1b0
bootstrap tweaking
dr7ana Dec 13, 2023
5ab40a7
libquic vbump
dr7ana Dec 13, 2023
1364e4c
actually have rid in command registration
dr7ana Dec 13, 2023
caa7b7a
libquic vbump
dr7ana Dec 14, 2023
cc97fe1
Added connection keepalive
dr7ana Dec 15, 2023
89975a0
gossip fetch and response handling implemented
dr7ana Dec 15, 2023
7f143bb
full mesh proto implementation
dr7ana Dec 15, 2023
4d56c97
Revert me: print out the failed bootstrap response
jagerman Dec 15, 2023
7b8c8fd
booyakasha
dr7ana Dec 15, 2023
4251172
libquic/oxenc vbumps
dr7ana Dec 15, 2023
22879b6
rc parsing
dr7ana Dec 15, 2023
75e3127
btreq destructor
dr7ana Dec 15, 2023
4ce0385
loop call
dr7ana Dec 15, 2023
86f2906
Get rid of IterDir
jagerman Dec 15, 2023
961763d
lets see which gets rejected
dr7ana Dec 15, 2023
687d655
Add `exact` argument to get_n_random_rcs
jagerman Dec 15, 2023
ae38dc7
gossip storage, logs
dr7ana Dec 16, 2023
0e73605
libquic vbump (stream redux, reauth updates, alpns->ustring)
dr7ana Dec 18, 2023
3e9d5a9
ALPN verification
dr7ana Dec 18, 2023
9cc0536
re-abstraction for client connections
dr7ana Dec 19, 2023
1cbec98
address parsing of deprecated opts
dr7ana Dec 19, 2023
6171846
zero cost exception handling my ass
dr7ana Dec 20, 2023
38c1008
gossip new RC's on bfetch
dr7ana Dec 20, 2023
6bb65cc
Fix SETCAP disabling
jagerman Dec 20, 2023
9153ba3
okay now lets try clients
dr7ana Dec 20, 2023
9b37b5b
client testing
dr7ana Dec 20, 2023
8e9dce1
do not gossip client RCs!
dr7ana Dec 20, 2023
c0b6277
HAPPY NEW YEAR
dr7ana Dec 20, 2023
674edab
No fetch only throw
dr7ana Dec 21, 2023
95fe45e
Deprecate pending_msg_que in favor of libquic internal stream buffers
dr7ana Jan 7, 2024
2c12f06
libquic vbump
dr7ana Jan 16, 2024
fb19e14
squash: kick testnet
dr7ana Jan 16, 2024
9cc3efc
a soothing renomenclatura
dr7ana Jan 17, 2024
6073377
libquic vbump
dr7ana Jan 19, 2024
261fc6b
REVERT: verbose close logging
dr7ana Jan 19, 2024
12381c8
libquic vbump
dr7ana Jan 22, 2024
7970ad2
Simul-defer connections
dr7ana Jan 22, 2024
722b03b
libquic bump
dr7ana Jan 29, 2024
861d573
Clear application map connection entry earlier
dr7ana Jan 31, 2024
5f8e1ad
formatting
dr7ana Feb 1, 2024
fbd1935
nodedb one-liner
dr7ana Feb 1, 2024
0fe8c6f
remove a few calls to bootstrap fallback
dr7ana Feb 1, 2024
27f09f0
log crit
dr7ana Feb 1, 2024
62002c3
Loop call fixes, libquic bump to latest fixes
dr7ana Feb 1, 2024
a79a5d2
bump libquic after merging pr#100
dr7ana Feb 2, 2024
b15f3e7
commented out decaf20 log changes
dr7ana Feb 2, 2024
2d3e68a
log
dr7ana Feb 2, 2024
b733415
formatting
dr7ana Feb 2, 2024
cba6cd8
asserts
dr7ana Feb 2, 2024
5004fbc
libquic testing out verbose bparser stuff
dr7ana Feb 2, 2024
ac6255c
Squashed commits for merge errors afer fixing client-refactor:
dr7ana Jan 17, 2024
25f13c9
deprecated byte_t (twas a dumb typedef anyways)
dr7ana Feb 5, 2024
b1f0f37
ToString is no longer camelcase because why would it be???
dr7ana Feb 5, 2024
e495637
deprecated old types from config
dr7ana Feb 6, 2024
76f720e
bump libquic for updated exposed ranges
dr7ana Feb 7, 2024
53552ad
deprecated net/ip_address and path/path_context
dr7ana Feb 7, 2024
f541d0b
bump libquic to expose ev loop
dr7ana Feb 7, 2024
800c62b
event loop swap
dr7ana Feb 12, 2024
0d7b973
link_manager generates static_secret for quic ep
dr7ana Feb 12, 2024
e6d4814
deprecation nation
dr7ana Feb 12, 2024
28194aa
libquic bump
dr7ana Feb 13, 2024
b7b9398
compiling, not linking
dr7ana Feb 13, 2024
8cc152a
C++ version, clang-format
dr7ana Feb 14, 2024
44e7c1b
libquic bump
dr7ana Feb 25, 2024
bf2f367
bye bye bencode baby bye byeeee
dr7ana Mar 17, 2024
d0af37a
fully deprecated old logging
dr7ana Mar 17, 2024
bb5f1b3
libquic bump
dr7ana Mar 17, 2024
a8c6673
ip packet checksums for ipv4/6, udp/tcp
dr7ana Mar 17, 2024
d8f9702
templated remoteaddress object
dr7ana Mar 18, 2024
d0203b3
config parsing cleaned up for owned ranges and addresses
dr7ana Mar 18, 2024
b037c04
compile fixes (except for consteval fmt::format oddities
dr7ana Mar 18, 2024
0301bc8
re-separated address classes
dr7ana Mar 19, 2024
abb16b1
Putting new objects to use
dr7ana Mar 22, 2024
6a20b3d
libquic c++20/ev-loop/ip bump
dr7ana Mar 27, 2024
aae23c1
Restructuring, session initiation
dr7ana Mar 25, 2024
bbbc433
Transposed address types
dr7ana Apr 2, 2024
0eaf854
Design review meeting
dr7ana Apr 2, 2024
b7918df
libquic vbump
dr7ana Apr 3, 2024
b06473d
Segmented path-build
dr7ana Apr 3, 2024
8262f04
Removed outer hash for path messages
dr7ana Apr 3, 2024
ecd7744
DRY'ed out symmetric encryption logic in path-build and path-controls
dr7ana Apr 4, 2024
cbaa175
Symmetric encryption
dr7ana Apr 8, 2024
597927a
Session init
dr7ana Apr 8, 2024
a1a3254
Router prefiguring, ons resolve
dr7ana Apr 9, 2024
ee961cf
libquic vbump
dr7ana Apr 9, 2024
791155d
Make it reachable
dr7ana Apr 9, 2024
078d0df
Prefiguring, deprecation
dr7ana Apr 9, 2024
9e6a334
Buffer methods
dr7ana Apr 10, 2024
d9cee71
TCP listener laid out
dr7ana Apr 10, 2024
6e5d841
Netif and quic Tunnel reduction
dr7ana Apr 12, 2024
849c645
libquic vbump
dr7ana Apr 17, 2024
fee6cd6
So much
dr7ana Apr 18, 2024
afe20e8
Session initation, authentication
dr7ana Apr 19, 2024
8938c06
TCP client code hooked up
dr7ana Apr 19, 2024
5b9ad10
TCP tunnel differentiated inbound/outbound
dr7ana Apr 22, 2024
8a45350
Client session refactor, datagram pipelining
dr7ana Apr 22, 2024
4ef9754
Dep bump + misc
dr7ana May 17, 2024
ce16778
IPRange iterator
dr7ana May 28, 2024
4979f9a
TUN/Session IP routing negotiation
dr7ana May 29, 2024
f755d26
TUN ip packet re-writing; deps bump
dr7ana Jun 2, 2024
6a7e973
CI fixes and architecture changes; bt serialize path object fix; deps…
dr7ana Jun 3, 2024
d455a36
testing something on CI
dr7ana Jun 4, 2024
5f61469
libquic bump -> dr7ana/repeater
dr7ana Jun 5, 2024
fcf62fb
it's... alive!?
dr7ana Jun 13, 2024
52ceb26
libquic bump
dr7ana Jun 18, 2024
c15b3b1
tick logic handling
dr7ana Jun 19, 2024
dfa0e52
Aggregated bugfix commits and logging fixes
dr7ana Jul 3, 2024
9e300d2
libquic -> dr7ana/primary_net_closure branch
dr7ana Aug 16, 2024
ec2dbd3
ipv6 config disabled, tun interface solid on ipv4
dr7ana Aug 23, 2024
5b48abc
kick testnet buddy
dr7ana Aug 23, 2024
ab30bf2
so much better!
dr7ana Aug 28, 2024
b794430
Misc (squash)
dr7ana Aug 28, 2024
ca7fc07
kick
dr7ana Aug 30, 2024
35e05b3
issue fixed, force clearing nodedb
dr7ana Sep 3, 2024
036fbe2
better netif
dr7ana Sep 3, 2024
c155db3
libevent 2.2 for watchers
dr7ana Sep 4, 2024
8a381c8
more netif
dr7ana Sep 4, 2024
104ba6d
testing this out
dr7ana Sep 9, 2024
ea6d62c
libquic -> dr7ana/0rtt, etc
dr7ana Sep 12, 2024
e3d80ea
updated, may kill testnet but yolo
dr7ana Sep 13, 2024
fe9d229
yay clients connecting
dr7ana Sep 16, 2024
fe717b9
yay path building
dr7ana Sep 16, 2024
ec32167
squash, but more the zucchini type
dr7ana Sep 17, 2024
5b522e6
maybe a little green beans too
dr7ana Sep 18, 2024
c874387
any beets on the side?
dr7ana Sep 19, 2024
8495517
whatsup paths
dr7ana Sep 24, 2024
3103194
Better linux fd poller
dr7ana Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
78 changes: 55 additions & 23 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
BasedOnStyle: Google

# alignment
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlinesLeft: 'true'
AlignOperands: 'false'
AlignTrailingComments: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: All
AlwaysBreakTemplateDeclarations: 'true'
BreakBeforeBinaryOperators: NonAssignment
ColumnLimit: 120
PointerAlignment: Left
QualifierAlignment: Custom
QualifierOrder: ['inline', 'static', 'constexpr', 'const', 'type']
ReferenceAlignment: Left

# bracing
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
Expand All @@ -31,11 +31,31 @@ BraceWrapping:
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false

# breaking
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: 'true'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializersBeforeComma: 'true'
Cpp11BracedListStyle: 'true'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
BreakConstructorInitializers: BeforeColon

# indentation
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
IndentWidth: 4
NamespaceIndentation: All

# shorties
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: 'false'

# spacing
KeepEmptyLinesAtTheStartOfBlocks: 'false'
PenaltyBreakString: '3'
SpaceBeforeParens: ControlStatements
SpacesInAngles: 'false'
Expand All @@ -44,18 +64,30 @@ SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
UseTab: Never
SortIncludes: false
ColumnLimit: 100

# treat pointers and reference declarations as if part of the type
DerivePointerAlignment: false
PointerAlignment: Left

# when wrapping function calls/declarations, force each parameter to have its own line
# wrapping
PackConstructorInitializers: NextLine
BinPackParameters: 'false'
BinPackArguments: 'false'

# TODO: uncomment me when we are reading to rearrange the header includes
# IncludeBlocks: Regroup
# IncludeCategories: 'llarp/'

# Include block sorting in the following order:
# - Main header for source file (clang-format default prioritizes this first)
# - Relative path includes in quotation marks
# - Absolute path includes in angle brackets
# - External dependencies
# - System dependencies
SortIncludes: CaseInsensitive
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '".+\.h'
Priority: 2
- Regex: '^<llarp'
Priority: 3
- Regex: '<winsock2\.h>'
Priority: 4
- Regex: '<windows\.h>'
Priority: 5
- Regex: '^<.*\.h(pp)?>$'
Priority: 6
- Regex: '(<)(.)+(>)'
Priority: 7
8 changes: 7 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
HeaderFilterRegex: 'llarp/.*'
Checks: 'readability-else-after-return,clang-analyzer-core-*,modernize-*,-modernize-use-trailing-return-type,-modernize-use-nodiscard,bugprone-*,-bugprone-easily-swappable-parameters'
Checks:
'readability-else-after-return,
clang-analyzer-core-*,modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
bugprone-*,
-bugprone-easily-swappable-parameters'
86 changes: 63 additions & 23 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ local default_deps_base = [
'libsqlite3-dev',
'libcurl4-openssl-dev',
'libzmq3-dev',
'libgnutls28-dev',
'make',
];
local default_deps_nocxx = ['libsodium-dev'] + default_deps_base; // libsodium-dev needs to be >= 1.0.18
Expand All @@ -30,19 +31,33 @@ local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https:/

local apt_get_quiet = 'apt-get -o=Dpkg::Use-Pty=0 -q';

local kitware_repo(distro) = [
'eatmydata ' + apt_get_quiet + ' install -y curl ca-certificates',
'curl -sSL https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - >/usr/share/keyrings/kitware-archive-keyring.gpg',
'echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ ' + distro + ' main" >/etc/apt/sources.list.d/kitware.list',
'eatmydata ' + apt_get_quiet + ' update',
];

local debian_backports(distro, pkgs) = [
'echo "deb http://deb.debian.org/debian ' + distro + '-backports main" >/etc/apt/sources.list.d/' + distro + '-backports.list',
'eatmydata ' + apt_get_quiet + ' update',
'eatmydata ' + apt_get_quiet + ' install -y ' + std.join(' ', std.map(function(x) x + '/' + distro + '-backports', pkgs)),
];

// Regular build on a debian-like system:
local debian_pipeline(name,
image,
arch='amd64',
deps=default_deps,
extra_setup=[],
build_type='Release',
lto=false,
werror=true,
cmake_extra='',
local_mirror=true,
extra_cmds=[],
jobs=6,
tests=true,
tests=false, // FIXME TODO: temporary until test suite is fixed
oxen_repo=false,
allow_fail=false) = {
kind: 'pipeline',
Expand Down Expand Up @@ -70,13 +85,14 @@ local debian_pipeline(name,
'echo deb http://deb.oxen.io $$(lsb_release -sc) main >/etc/apt/sources.list.d/oxen.list',
'eatmydata ' + apt_get_quiet + ' update',
] else []
) + [
) + extra_setup
+ [
'eatmydata ' + apt_get_quiet + ' dist-upgrade -y',
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y gdb cmake git pkg-config ccache ' + std.join(' ', deps),
'mkdir build',
'cd build',
'cmake .. -DWITH_SETCAP=OFF -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_BUILD_TYPE=' + build_type + ' ' +
(if build_type == 'Debug' then ' -DWARN_DEPRECATED=OFF ' else '') +
'-DWARN_DEPRECATED=OFF ' +
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') +
'-DWITH_LTO=' + (if lto then 'ON ' else 'OFF ') +
'-DWITH_TESTS=' + (if tests then 'ON ' else 'OFF ') +
Expand All @@ -90,6 +106,23 @@ local debian_pipeline(name,
},
],
};
local local_gnutls(jobs=6, prefix='/usr/local') = [
apt_get_quiet + ' install -y curl ca-certificates',
'curl -sSL https://ftp.gnu.org/gnu/nettle/nettle-3.9.1.tar.gz | tar xfz -',
'curl -sSL https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-3.8.0.tar.xz | tar xfJ -',
'export PKG_CONFIG_PATH=' + prefix + '/lib/pkgconfig:' + prefix + '/lib64/pkgconfig',
'export LD_LIBRARY_PATH=' + prefix + '/lib:' + prefix + '/lib64',
'cd nettle-3.9.1',
'./configure --prefix=' + prefix + ' CC="ccache gcc"',
'make -j' + jobs,
'make install',
'cd ..',
'cd gnutls-3.8.0',
'./configure --prefix=' + prefix + ' --with-included-libtasn1 --with-included-unistring --without-p11-kit --disable-libdane --disable-cxx --without-tpm --without-tpm2 CC="ccache gcc"',
'make -j' + jobs,
'make install',
'cd ..',
];
local apk_builder(name, image, extra_cmds=[], allow_fail=false, jobs=6) = {
kind: 'pipeline',
type: 'docker',
Expand Down Expand Up @@ -301,7 +334,7 @@ local mac_builder(name,
'ulimit -n 1024', // because macos sets ulimit to 256 for some reason yeah idk
'./contrib/mac-configure.sh ' +
ci_dep_mirror(local_mirror) +
(if build_type == 'Debug' then ' -DWARN_DEPRECATED=OFF ' else '') +
'-DWARN_DEPRECATED=OFF ' +
codesign,
'cd build-mac',
// We can't use the 'package' target here because making a .dmg requires an active logged in
Expand Down Expand Up @@ -351,30 +384,32 @@ local docs_pipeline(name, image, extra_cmds=[], allow_fail=false) = {
'echo "Building on ${DRONE_STAGE_MACHINE}"',
apt_get_quiet + ' update',
apt_get_quiet + ' install -y eatmydata',
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y git clang-format-14 jsonnet',
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y git clang-format-15 jsonnet',
'./contrib/ci/drone-format-verify.sh',
],
}],
},
// documentation builder
docs_pipeline('Documentation',
docker_base + 'docbuilder',
extra_cmds=['UPLOAD_OS=docs ./contrib/ci/drone-static-upload.sh']),
//docs_pipeline('Documentation',
// docker_base + 'docbuilder',
// extra_cmds=['UPLOAD_OS=docs ./contrib/ci/drone-static-upload.sh']),

// Various debian builds
debian_pipeline('Debian sid (amd64)', docker_base + 'debian-sid'),
debian_pipeline('Debian sid/Debug (amd64)', docker_base + 'debian-sid', build_type='Debug'),
clang(13),
full_llvm(13),
clang(16),
full_llvm(16),
debian_pipeline('Debian stable (i386)', docker_base + 'debian-stable/i386'),
debian_pipeline('Debian buster (amd64)', docker_base + 'debian-buster', cmake_extra='-DDOWNLOAD_SODIUM=ON'),
debian_pipeline('Debian bullseye (amd64)',
docker_base + 'debian-bullseye',
extra_setup=debian_backports('bullseye', ['cmake']) + local_gnutls()),
debian_pipeline('Ubuntu latest (amd64)', docker_base + 'ubuntu-rolling'),
debian_pipeline('Ubuntu LTS (amd64)', docker_base + 'ubuntu-lts'),
debian_pipeline('Ubuntu bionic (amd64)',
docker_base + 'ubuntu-bionic',
deps=['g++-8'] + default_deps_nocxx,
cmake_extra='-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8',
oxen_repo=true),
debian_pipeline('Ubuntu focal (amd64)',
docker_base + 'ubuntu-focal',
deps=['g++-10'] + default_deps_nocxx,
extra_setup=kitware_repo('focal') + local_gnutls(),
cmake_extra='-DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10'),

// ARM builds (ARM64 and armhf)
debian_pipeline('Debian sid (ARM64)', docker_base + 'debian-sid', arch='arm64', jobs=4),
Expand All @@ -399,15 +434,16 @@ local docs_pipeline(name, image, extra_cmds=[], allow_fail=false) = {
'./contrib/ci/drone-static-upload.sh',
]),

// Static build (on bionic) which gets uploaded to builds.lokinet.dev:
debian_pipeline('Static (bionic amd64)',
docker_base + 'ubuntu-bionic',
deps=['g++-8', 'python3-dev', 'automake', 'libtool'],
// Static build (on focal) which gets uploaded to builds.lokinet.dev:
debian_pipeline('Static (focal amd64)',
docker_base + 'ubuntu-focal',
deps=['g++-10', 'python3-dev', 'automake', 'libtool'],
extra_setup=kitware_repo('focal'),
lto=true,
tests=false,
oxen_repo=true,
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON ' +
'-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 ' +
'-DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 ' +
'-DCMAKE_CXX_FLAGS="-march=x86-64 -mtune=haswell" ' +
'-DCMAKE_C_FLAGS="-march=x86-64 -mtune=haswell" ' +
'-DNATIVE_BUILD=OFF -DWITH_SYSTEMD=OFF -DWITH_BOOTSTRAP=OFF -DBUILD_LIBLOKINET=OFF',
Expand All @@ -416,19 +452,22 @@ local docs_pipeline(name, image, extra_cmds=[], allow_fail=false) = {
'./contrib/ci/drone-static-upload.sh',
]),
// Static armhf build (gets uploaded)
debian_pipeline('Static (buster armhf)',
docker_base + 'debian-buster/arm32v7',
debian_pipeline('Static [FIXME] (bullseye armhf)',
docker_base + 'debian-bullseye/arm32v7',
arch='arm64',
deps=['g++', 'python3-dev', 'automake', 'libtool'],
extra_setup=debian_backports('bullseye', ['cmake']),
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON ' +
'-DCMAKE_CXX_FLAGS="-march=armv7-a+fp -Wno-psabi" -DCMAKE_C_FLAGS="-march=armv7-a+fp" ' +
'-DNATIVE_BUILD=OFF -DWITH_SYSTEMD=OFF -DWITH_BOOTSTRAP=OFF',
extra_cmds=[
'./contrib/ci/drone-check-static-libs.sh',
'UPLOAD_OS=linux-armhf ./contrib/ci/drone-static-upload.sh',
],
allow_fail=true, // XXX FIXME: build currently fails!
jobs=4),

/*
// integration tests
debian_pipeline('Router Hive',
docker_base + 'ubuntu-lts',
Expand All @@ -440,6 +479,7 @@ local docs_pipeline(name, image, extra_cmds=[], allow_fail=false) = {
deb_builder(docker_base + 'debian-bullseye-builder', 'bullseye', 'debian/bullseye'),
deb_builder(docker_base + 'ubuntu-jammy-builder', 'jammy', 'ubuntu/jammy'),
deb_builder(docker_base + 'debian-sid-builder', 'sid', 'debian/sid', arch='arm64'),
*/

// Macos builds:
mac_builder('macOS (Release)', extra_cmds=[
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ testnet_tmp
vsproject/
.vs

daemon.ini
*.ini


.gradle/
Expand All @@ -67,3 +67,4 @@ regdbhelper.dll
# xcode
xcuserdata/

scc.py
25 changes: 9 additions & 16 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "external/nlohmann"]
path = external/nlohmann
url = https://github.com/nlohmann/json.git
[submodule "external/ghc-filesystem"]
path = external/ghc-filesystem
url = https://github.com/gulrak/filesystem.git
[submodule "test/Catch2"]
path = test/Catch2
url = https://github.com/catchorg/Catch2
Expand All @@ -17,25 +14,21 @@
[submodule "external/oxen-mq"]
path = external/oxen-mq
url = https://github.com/oxen-io/oxen-mq
[submodule "external/uvw"]
path = external/uvw
url = https://github.com/jagerman/uvw.git
[submodule "external/cpr"]
path = external/cpr
url = https://github.com/whoshuu/cpr
[submodule "external/ngtcp2"]
path = external/ngtcp2
url = https://github.com/ngtcp2/ngtcp2.git
branch = v0.1.0
[submodule "external/oxen-encoding"]
path = external/oxen-encoding
url = https://github.com/oxen-io/oxen-encoding.git
[submodule "external/oxen-logging"]
path = external/oxen-logging
url = https://github.com/oxen-io/oxen-logging.git
[submodule "gui"]
path = gui
url = https://github.com/oxen-io/lokinet-gui.git
[submodule "external/CLI11"]
path = external/CLI11
url = https://github.com/CLIUtils/CLI11.git
[submodule "external/oxen-libquic"]
path = external/oxen-libquic
url = https://github.com/oxen-io/oxen-libquic.git
[submodule "external/oxen-encoding"]
path = external/oxen-encoding
url = https://github.com/oxen-io/oxen-encoding.git
[submodule "external/libevent"]
path = external/libevent
url = https://github.com/libevent/libevent.git
Loading