Commit Graph

5449 Commits (744acce8d27a6c9d332e17914331ebff84ebfbbd)
 

Author SHA1 Message Date
Jeff 1e96347981
Merge pull request #1124 from jagerman/deabseil-finale
De-abseil finale: no more abseil
4 years ago
Jason Rhinelander f976ebbe49 make format 🤦 4 years ago
Jason Rhinelander 05b95dd6d4 Disable memory sanitizer build
It doesn't currently work for either test suite: we get a
`MemorySanitizer: use-of-uninitialized-value` immediately from both test
suites, with what looks like catch2 or gtest internals.

So just disable it for now.
4 years ago
Jason Rhinelander 55acec80ec Disable thread annotation when not under libc++
They are fairly useless under stdlibc++ because it doesn't have the
required annotations on stl mutexes and locks, so we just get tons of
useless warnings.
4 years ago
Jason Rhinelander 84186ce0b8 Always pass XSAN to cmake 4 years ago
Jason Rhinelander 3be0766f27 Bump XSAN build to bionic and add status message 4 years ago
Jason Rhinelander 18a2444c50 Add gcc5 workaround for catch2 GENERATE(table
stdlibc++'s before v6 erroneously have the tuple constructor as
explicit, which causes the initializer lists here to fail.
4 years ago
Jason Rhinelander 27025030ce Renamed uint128.h -> uint128.hpp 4 years ago
Jason Rhinelander 3fedd5ba6b Avoid wrong-order initialization on big endian 4 years ago
Jason Rhinelander 2093f94244 Make uint128_t use big/little endian layout internally
Thus if someone wants to memcpy out of it it will have the expected
endianness of the internal data.
4 years ago
Jason Rhinelander 454abb4f9f Avoid copies in mutators
Reimplement operators in terms of mutators, rather than vice versa, so
that mutators don't have to make a copy.
4 years ago
Jason Rhinelander 4207a7cfa3 Rewrite In6ToHUInt to be endian agnostic 4 years ago
Jason Rhinelander 1232f34f90 Rewrite generate expressions to make clang-7 happy 4 years ago
Jason Rhinelander dba3ff7fd3 gcc 5.x string_view workaround 4 years ago
Jason Rhinelander 0839c16f19 Final abseil purge
Bye-bye Google Boost.
4 years ago
Jason Rhinelander 5ce6c01476 Don't use double-underscores
double-underscore names are reserved for the compiler/STL.
4 years ago
Jason Rhinelander 4338e38cd6 Remove old vendored ghc-filesystem
We aren't using this anymore; this should have been deleted in the
switch to submodules.
4 years ago
Jason Rhinelander 5fcc11f2bf Fix format 4 years ago
Jason Rhinelander 5d1230d7c9 constexpr string_view fixes
Pre-C++17 char_traits::compare isn't constexpr so we can't constexpr the
find/rfind methods that use it.

begin() etc, however, can be constexpr (and need to be for some of the
other constexpr methods here that use them).
4 years ago
Jason Rhinelander 46242ba69b TrimWhiteSpace -> TrimWhitespace
Fix my dumb initial capitalization choice.
4 years ago
Jason Rhinelander 74d4afad51 Remove metric config parsing 4 years ago
Jason Rhinelander 54186c4a89 Replace absl string_view with string_view from lokimq
When we add loki-mq has a dependency we can just alias it, but for now
it's easier to copy the header than add the whole submodule library.
4 years ago
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