Commit Graph

5218 Commits (089056ca5bca2e03ec484fbbe0058b06d3cf5eee)
 

Author SHA1 Message Date
Jason Rhinelander 089056ca5b Remove all ABSL_ATTRIBUTE_UNUSED uses 4 years ago
Jason Rhinelander 5fd830bc36 Prettify uptime duration in log lines
Produces strings such as:

    [+1h09m12.475s]

instead of:

    [+4152475 ms]
4 years ago
Jason Rhinelander 2e9840ea39 Replace abseil date code with Hinnart's date.h
Howard Hinnart's date.h is the library that was accepted as C++20
date/calendar support, so this is essentially a backport of C++20 date
time support.

(It does support timezone support, but requires more of the library and
that seems like overkill for what we need; this just prints UTC
timestamps instead, which need only a header-only include).
4 years ago
Jason Rhinelander ba1b20153e Miscellaneous small absl removals 4 years ago
Jason Rhinelander 870062e8cc Remove absl optimization
This was being used to get at gcc/clang's __builtin_expect, but we don't
really need that: we can just avoid the check entirely when not in debug
mode which should be even faster.
4 years ago
Jason Rhinelander 5efcd49a3b Deabseil: remove absl::StrCat, de-templatize fromEnv
fromEnv here wasn't usefully templatized (the base template basically
couldn't be used for anything except a string anyway), so just replaced
it with the overloads we need and moved the implementations out of the
header.
4 years ago
Jason Rhinelander 5c95971335 Make C++ literals available everywhere in `llarp` 4 years ago
Jason Rhinelander 561bfe24c0 Add cmake "check" target to run all tests
Renames the cmake Catch2 test target to "catch" (instead of "check") and
adds a "rungtest" for gtest (because the "gtest" target is already taken
by the gtest library itself), and then repurposes the "check" target to
run both test suite binaries.

Also updates the top-level Makefile to do the same thing, except that
there the gtest target is just "gtest" instead of "rungtest".
4 years ago
Jason Rhinelander 98c34d995b De-abseil: Add our own llarp::TrimWhiteSpace
Adds a TrimWhiteSpace instead of using abseil's.

Adds Catch2 tests for it, and also converts the existing str tests to
catch (which look much, much nicer than the gtest ones).
4 years ago
Jason Rhinelander 00a624ab40 Fix and rename CaselessCmp -> CaselessLessThan
The comparison done here was really weird: by comparing lengths *before*
contents "zz" would sort before "aaa".  It wasn't invalid for the
specific purpose being used here (looking for true/false values), but
would be highly broken if someone tried to use it elsewhere.

Also renamed it because it really is just a `<` implementation, not a
full cmp implementation.
4 years ago
Jeff d9b779e780
Merge pull request #1126 from jagerman/old-xenial
Add an old xenial gcc build
4 years ago
Jason Rhinelander b7eb083da0 Add an old xenial gcc build 4 years ago
Jeff 60f92f2f45
Merge pull request #1122 from jagerman/deabseil-mutexes
De-abseil, part 2: mutex, locks, (most) time
4 years ago
Jason Rhinelander 7d167d3fe4 Add return types to lambda
Without these the return type could be wrong (e.g. supposed to return a
reference but returns a value).
4 years ago
Jason Rhinelander f84ce61d66 Removed empty cpp files
These aren't needed: CMake already knows how to follow #includes and
rebuild when headers change as long as the headers are included
*somewhere*.  The extra .cpp files here just require building a bunch of
.cpp files with just header content that we just end up throw away
during linking (since the same things will also be compiled in whatever
other compilation units include the same headers).
4 years ago
Jason Rhinelander fe61367a87 Vastly simplified llarp::util::memFn
There is a huge pile of unnecessary machinery here that can be solved
with a few lambdas and some member function pointer type deduction.
4 years ago
Jason Rhinelander b4440094b0 De-abseil, part 2: mutex, locks, (most) time
- util::Mutex is now a std::shared_timed_mutex, which is capable of
  exclusive and shared locks.

- util::Lock is still present as a std::lock_guard<util::Mutex>.

- the locking annotations are preserved, but updated to the latest
  supported by clang rather than using abseil's older/deprecated ones.

- ACQUIRE_LOCK macro is gone since we don't pass mutexes by pointer into
  locks anymore (WTF abseil).

- ReleasableLock is gone.  Instead there are now some llarp::util helper
  methods to obtain unique and/or shared locks:
    - `auto lock = util::unique_lock(mutex);` gets an RAII-but-also
      unlockable object (std::unique_lock<T>, with T inferred from
      `mutex`).
    - `auto lock = util::shared_lock(mutex);` gets an RAII shared (i.e.
      "reader") lock of the mutex.
    - `auto lock = util::unique_locks(mutex1, mutex2, mutex3);` can be
      used to atomically lock multiple mutexes at once (returning a
      tuple of the locks).
  This are templated on the mutex which makes them a bit more flexible
  than using a concrete type: they can be used for any type of lockable
  mutex, not only util::Mutex.  (Some of the code here uses them for
  getting locks around a std::mutex).  Until C++17, using the RAII types
  is painfully verbose:

  ```C++
  // pre-C++17 - needing to figure out the mutex type here is annoying:
  std::unique_lock<util::Mutex> lock(mutex);
  // pre-C++17 and even more verbose (but at least the type isn't needed):
  std::unique_lock<decltype(mutex)> lock(mutex);
  // our compromise:
  auto lock = util::unique_lock(mutex);
  // C++17:
  std::unique_lock lock(mutex);
  ```

  All of these functions will also warn (under gcc or clang) if you
  discard the return value.  You can also do fancy things like
  `auto l = util::unique_lock(mutex, std::adopt_lock)` (which lets a
  lock take over an already-locked mutex).

- metrics code is gone, which also removes a big pile of code that was
  only used by metrics:
  - llarp::util::Scheduler
  - llarp:🧵:TimerQueue
  - llarp::util::Stopwatch
4 years ago
Jeff 9c0f230dbf
Merge pull request #1120 from notlesh/fix-the-build-2020-02-21
Fix the build
4 years ago
Stephen Shelton ea97a8f2ac
Make format 4 years ago
Jeff 2868b3327b
Merge pull request #1119 from jagerman/update-osx-image
Update osx image to latest on travis
4 years ago
Stephen Shelton 16be86a5c3
Merge pull request #1116 from tewinget/short-path-names
path builder prints hops, rest print short name
4 years ago
Jason Rhinelander 4c38206944 Remove unneeded mingw homebrew dep 4 years ago
Jason Rhinelander d517f7d8b2 Do a homebrew update 4 years ago
Jason Rhinelander fa90726fe1 Update osx image to latest on travis 4 years ago
Thomas Winget fae86281e9 make path short name look nicer 4 years ago
Thomas Winget 145efaf0bb should probably build before committing... 4 years ago
Thomas Winget 74d421ac2d PathBuildNumber -> NextPathBuildNumber because increment side-effect 4 years ago
Thomas Winget ad3465ee66 std move better 4 years ago
Thomas Winget 893ef2b874 const-y-ness and move-y-ness 4 years ago
Thomas Winget fc56a018e5 path builder prints hops, rest print short name 4 years ago
Jeff 7c5a721457
Merge pull request #1114 from notlesh/redundant-introset-lookup-improvements-2020-02-20
Redundant introset lookup improvements
4 years ago
Stephen Shelton 63c3106db2
Make format 4 years ago
Stephen Shelton 0429bafbb3
Merge pull request #1111 from notlesh/redundant-introset-propagation-2020-02-19
Redundant introset propagation
4 years ago
Stephen Shelton 66cb30fa58
Refactor: remove recursionDepth from DHT lookups 4 years ago
Jeff 6ac5f19b3a
Merge pull request #1110 from jagerman/no-abseil-optional
De-abseil, part 1: remove absl::optional
4 years ago
Jeff a9663d10ae
Merge pull request #1112 from jagerman/remove-llvm-homebrew
Remove llvm from travis-ci homebrew packages
4 years ago
Jason Rhinelander 6aedebbfbf Remove llvm from travis-ci homebrew packages
It doesn't seem like we need this for the mac build.
4 years ago
Stephen Shelton 45a36fcfee
Rework FindIntro logic per redundant strategy 4 years ago
Jason Rhinelander 05a2e961e6 Add missing header 4 years ago
Stephen Shelton 4c499fb076
Make format 4 years ago
Stephen Shelton 6966168f5a
Minor improvements to DHT inroset propagation 4 years ago
Stephen Shelton dff9aeb250
Propagate Introset publishing redundantly 4 years ago
Jeff Becker dc7828941f
add log statement 4 years ago
Jason Rhinelander ac1486d0be Replace absl::optional with optional-lite
Step 1 of removing abseil from lokinet.

For the most part this is a drop-in replacement, but there are also a
few changes here to the JSONRPC layer that were needed to work around
current gcc 10 dev snapshot:

- JSONRPC returns a json now instead of an optional<json>.  It doesn't
  make any sense to have a json rpc call that just closes the connection
  with returning anything.  Invoked functions can return a null (default
  constructed) result now if they don't have anything to return (such a
  null value won't be added as "result").
4 years ago
Jason Rhinelander 860ada8e30
Merge pull request #1108 from majestrate/require-router-version-2020-02-19
Require router version in RCs of public routers
4 years ago
Jeff Becker 9a6148c4c3
require router version in public routers 4 years ago
Jeff 6f182c4b26
Merge pull request #1077 from majestrate/mock-lokid-rpc-2020-02-02
mock lokid for loopback testnet
4 years ago
Jeff 20bc168d1c
Merge pull request #1093 from majestrate/toggle-publishing-introsets-2020-02-11
make publishing introsets optional
4 years ago
Jeff bb7dabaace
Merge pull request #1106 from majestrate/use-endpoint-path-for-lookup-2020-02-18
Use endpoint path for outbound context introset update
4 years ago
Jeff Becker 1874f439b7
add comment 4 years ago