Commit Graph

5935 Commits (437895ca36d095321c463123779ef4d8c0e3f57c)
 

Author SHA1 Message Date
Jeff 437895ca36
Merge pull request #1289 from jagerman/merge-master
Merge master
4 years ago
Jason Rhinelander 5b7d194ff1 Merge remote-tracking branch 'origin/master' into dev 4 years ago
Jeff 22830fe423
Merge pull request #1287 from loki-project/majestrate-patch-1
change ci badge to use drone
4 years ago
Jeff 636622afdb
Merge pull request #1288 from jagerman/remove-str-crutch
Remove llarp::str(string_view)
4 years ago
Jason Rhinelander 854619f04f Workaround for ghc::filesystem (mac) compatibility 4 years ago
Jason Rhinelander d05e6716cb Remove llarp::str(string_view)
It was a workaround for pre-C++17 std::string which didn't support
passing a string_view to various functions/operators.  There's only one
place left that needs an explicit conversion, and that's where it is
used as a map key; so just be explicit there and remove llarp::str()
everywhere else.
4 years ago
Jeff bad6974ee5
change ci badge to use drone 4 years ago
Jeff d35b246d28
Merge pull request #1286 from jagerman/fix-links-output
Fix the static build linked libs output check
4 years ago
Jason Rhinelander 9e1e11825e Fix the static build linked libs output check
- The `grep` had a typo of `-e` instead of `-E` which made it not work

- Made the command actually fail the pipeline if unwanted linked libs
were found.

- Print in green if everything is okay.

- Add librt.so to the whitelist
4 years ago
Jason Rhinelander 7d5a99d820
Merge pull request #1284 from majestrate/toggle-lto-2020-05-20
add WITH_LTO option to disble lto on compile time
4 years ago
Jeff b885f924e8
Merge pull request #1285 from jagerman/bye-bye-travis-ci
Remove travis-ci
4 years ago
Jason Rhinelander 11342b1d9f Remove travis-ci
We don't have much left there that works -- the one useful build (s390x)
errors out with a no available disk space error, so just give up on it.
4 years ago
Jeff 639432c678
Merge pull request #1282 from jagerman/drone-macos
Bunch of crap for macOS
4 years ago
Jason Rhinelander e4e6fc205e Disable lto for most linux builds
Keeps it on for the first three (sid/release, sid/debug, and clang) and
turns them off for the rest.
4 years ago
Jeff Becker a6d17dcd16
add WITH_LTO option to disble lto on compile time 4 years ago
Jason Rhinelander ab02519a40 Add missing quote to static build linked libs test 4 years ago
Jason Rhinelander 3bb24580a4 make format 4 years ago
Jason Rhinelander a2d46eda1e Colour diff; print error *after* diff, and make it red 4 years ago
Jason Rhinelander 1d11456d26 Move specify CLICOLOR_FORCE=1 to the drone backend 4 years ago
Jason Rhinelander ebd2142114 Don't use std::optional::value() because f u macos
This replaces all use of std::optional's `opt.value()` with `*opt`
because macOS is great and the ghost of Steve Jobs says that actually
supporting std::optional's value() method is not for chumps before macOS
10.14.  So don't use it because Apple is great.

Pretty much all of our use of it actually is done better with operator*
anyway (since operator* doesn't do a check that the optional has a
value).

Also replaced *most* of the `has_value()` calls with direct bool
context, except for one in the config section which looked really
confusing at a glance without a has_value().
4 years ago
Jason Rhinelander 7f9160bb6e Untangle some interdependencies
macOS doing a shared library build is not working without untangling
some of the interdependencies.  This commit does that, at least enough
to get macOS to compile.

This isn't the cleanest as currently implemented (we have some net/
things in `liblokinet-platform` and some in `liblokinet`, and likewise
ev/vpnio.cpp is in `liblokinet` while the rest of `ev/*` is in
`liblokinet-platform`).
4 years ago
Jason Rhinelander 97088719e0 Avoid reserved __identifiers
Identifier names with `__` in them are reserved for the implementation.
One leading underscore followed by a lower-case letter is fine though
(leading underscore followed by *upper*-case is, however, also
reserved).
4 years ago
Jason Rhinelander 60d704b25d Remove dead code 4 years ago
Jason Rhinelander f9bbc30c3d IsIPv4Bogon: constexpr array instead of a function-local static vector
The fixed-size array + not needing to do an atomic operation in the
function should allow better compiler optimization.

(And with C++17 the type and size are inferred).
4 years ago
Jason Rhinelander bdc9c7bfa8 Move IPRange out of net.hpp; free up TruncateV6 etc.
- Move IPRange into its own net/ip_range.hpp

- Move the static net::IPPacket::TruncateV6, etc. functions to free
net::TruncateV6, etc. functions (now from net/ip.hpp instead of
net/ip_packet.hpp).

- Make net::TruncateV6 and net::ExpandV4 constexpr.

- Add IPRange::FromIPv4 factory function (to replace the iprange_ipv4
free function)
4 years ago
Jason Rhinelander 72bf215da4 Move IPPacket header (part 1)
Rename net/ip.{cpp,hpp} to net/ip_packet.{cpp,hpp}.

(Doing this in two commits because I want to repurpose ip.hpp/ip.cpp,
and want git to figure out the history properly).
4 years ago
Jason Rhinelander be9ddf2ae1 Bring back ghc::filesystem for broke AF macos
macOS doesn't provide `<filesystem>` support when targetting anything
earlier than 10.15.
4 years ago
Jason Rhinelander 4d34ee82c9 Move Catalina build to drone (on lokinet-mini) 4 years ago
Jason Rhinelander 7cb542ea23
Merge pull request #1274 from notlesh/fix-keymanager-test-2020-05-18
Fix various unit tests
4 years ago
Stephen Shelton ffdeca5378
Initialize all primitive values in Config 4 years ago
Stephen Shelton 807bfc5302
Initialize Config with LoadConfig in all key manager tests 4 years ago
Stephen Shelton fa6845b206
Use global RC file paths instead of redefining them 4 years ago
Stephen Shelton ac225eb65e
Testing: explicitly initialize variable 4 years ago
Stephen Shelton 7167b4ad02
Properly initialize config in unit test 4 years ago
Jeff a43bdef27c
Merge pull request #1280 from jagerman/gcc10
Add gcc-10 build
4 years ago
Jason Rhinelander b1281cd9d3 Add gcc-10 build
This is temporary (until the `g++` metapackage switches from gcc 9 to
gcc 10).
4 years ago
Jason Rhinelander 110fbe14c9
Merge pull request #1279 from jagerman/curl-fix
Fix cmake curl definition
4 years ago
Jason Rhinelander 604501b07f Fix cmake curl definition 4 years ago
Jeff abc127a78a
Merge pull request #1276 from despair86/sockaddr-fix
fix sockaddr on win32
4 years ago
Rick V 918a09c0cf fix sockaddr win32 and collapse headers on the unix side 4 years ago
Jason Rhinelander cc5e8787c5
Merge pull request #1275 from jagerman/curl-win32-fix
Only link curl if we set up a curl target
4 years ago
Jason Rhinelander 28362fd6a6 Clean up curl define
It doesn't have to be win32-specific, we could (for example) use this on
mac as well to build without curl/SN support.
4 years ago
Jason Rhinelander 856cf82c0e Only link curl if we set up a curl target
Should fix win32 (which doesn't link to curl).
4 years ago
Jeff 759c0e6f31
Merge pull request #1273 from jagerman/drone
Drone CI + cmake + fixes
4 years ago
Jason Rhinelander a82b83119e Remove travis-ci builds now handled via drone 4 years ago
Jason Rhinelander 7f8698ce44 Add several drone ci builds 4 years ago
Jason Rhinelander 5e91c946c5 AVX code: move stub into separate file; always check -mavx2/-mfma
This simplifies the build a bit by moving the avx stubs into a single .c
file: we can avoid compiling all of the avx2 code and just add a single
stub file instead when the compiler doesn't have -mavx2/-mfma.

This also simplifies cmake to just always test the flags; there are some
cases (like using NATIVE_BUILD) where USE_AVX2 doesn't necessarily
apply, and it's cheap to just check them.
4 years ago
Jason Rhinelander b4fce0e3ee curl: use ccache; disabled lots of other crap
brotli and libpsl both got autodetected on my system, so explicitly
disable them (and a bunch of other crap from --configure).

Build with ccache.
4 years ago
Jason Rhinelander fa794e64cd Build libsodium with ccache and fPIC
fPIC is needed in case we are building a shared liblokinet (within which
we want the static libsodium).
4 years ago
Jason Rhinelander c5faa86926 cmake refactor
Refactors many things in cmake to improve and simplify:

- don't use variable indirection for target names; target names are
*already* a variable of sorts.  (e.g. ${UTIL_LIB} is now just
lokinet-util).  cmake/basic_definitions.cmake is now gone.

- fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather
than shoving a bunch of flag hacks through link_libraries and
add_compile_options.  This also now enables LTO when building a shared
library (because previously the -flto hacks were only turned on in the
static code for some reason).

- build liblokinet as *either* shared library or static library, but not
both.  Building both makes things more complicated because they had
different names (lokinet-shared or lokinet-static) and seems pointless:
you generally want one or the other.  Now there is just the liblokinet
target, which will be shared or static depending on the value of
BUILD_SHARED_LIBS.

- Simplify lokinet-cryptography AVX2 code: just build *one* library, and
add in the additional AVX2 files when possible, rather than building two
and needing to merge them.

- Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK.
It makes no sense to use one of these (_RUNTIME) on Windows and the
other on non-Windows when they appear to try to do the same thing.

- remove a bunch of annotations from `endif(FOO)` -> `endif()`.

- move all the tuntap compilation code (including OS-specific source
file selection) into vendor/CMakeLists.txt and build tuntap as an
intermediate OBJECT library rather than keeping a global variable in 5
different files.

- move release motto define to root cmake; it made no sense being
duplicated in both unix.cmake and win32.cmake

- fix add_log_tag to not stomp on any existing source compile flags with
its definition.  Also use proper compile definition property instead of
cramming it into compile flags.

- make optimization/linker flags less hacky.  There's no reason for us
to force particular optimization flags because the cmake build type
already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3).  Not doing
that also silences a bunch of cmake warnings because it thinks "-O0 -g3"
etc.  are link libraries (which is reasonable: that's what the code was
telling cmake they are).

- sets the default build type to RelWithDebInfo which gives us `-O2 -g`
if you don't specify a build type.

- Move PIC up (so that the things loaded in unix.cmake, notably libuv,
have it set).

- Add a custom `curl` interface library that carries the correct link
target and include paths for curl (system or bundled).
4 years ago