Commit Graph

48 Commits

Author SHA1 Message Date
Jason Rhinelander ec0d44e143 Stable release bump 2020-10-19 23:44:24 -03:00
Jason Rhinelander 8ed529200b macOS 10.12 compatibility
Add var::get/var::visit implementations of std::get/std::visit that get
used if compiling for an old macos target, and use those.

The issue is that on a <10.14 macos target Apple's libc++ is missing
std::bad_variant_access, and so any method that can throw it (such as
std::get and std::visit) can't be used.  This workaround is ugly, but
such is life when you want to support running on Apple platforms.
2020-10-15 16:55:33 -03:00
Jason Rhinelander 318781a6d4 Update macos build to use 10.14 compatibility 2020-10-15 15:49:54 -03:00
Jason Rhinelander 0ac1d48bc8 Update bundled libzmq version 2020-09-16 11:46:04 -03:00
Jason Rhinelander faeeaa86d4 Add missing headers to installed header list 2020-08-13 12:38:46 -03:00
Jason Rhinelander 4e89dce5b6 Add "C" to languages
Without this CMAKE_C_COMPILER won't be set when building as a standalone
project, and we need that if we build the bundled libzmq.
2020-06-22 13:32:16 -03:00
Jason Rhinelander e072e68d84 Move -isystem hack inside if-found
This was breaking if we didn't find libzmq (or didn't find recent
enough) because the target didn't exist.
2020-05-19 22:55:57 -03:00
Jason Rhinelander e5a8d09127 Link to sodium publicly
The test suite needs this, in particular.
2020-05-15 01:36:01 -03:00
Jason Rhinelander 68c1899cda C++17 changes; replace mapbox with std::variant
Various small C++17 code improvements.

Replace mapbox::variant with std::variant.

Remove the bt_u64 type wrapper; instead we know have `bt_value` which
wraps a variant holding both int64_t and uint64_t, and has contructors
to send signed/unsigned integer types into the appropriate one.
lokimq::get_int checks both as appropriate during extraction.

As a side effect this means we no longer do the uint64_t -> int64_t
conversion on the wire, ever, without needing the wrapper; although this
can break older versions sending large positive integers (i.e. larger
than int64_t max) those weren't actually working completely reliably
with mapbox variant anyway, and the one place using such a value in loki
core (in a checksum) is already fully upgraded across the network
(currently using bt_u64, but always sending a positive value on the
wire).
2020-05-14 20:19:43 -03:00
Jason Rhinelander 7b42537801 Require C++17
Removes lokimq::string_view (the type alias is still provided for
backwards compat, but now is always std::string_view).

Bump version (on dev branch) to 1.2.0
2020-05-12 15:33:59 -03:00
Jason Rhinelander 8984dfc4ea Add address parsing/generating class
This class extends the basic ZMQ addresses with addresses that handle
parsing and generating of addresses with embedded curve pubkeys of
various forms, along with a QR-friendly address generator.
2020-05-08 21:42:16 -03:00
Jason Rhinelander 59a41943d4 Add support for setting umask when binding
This is needed to be able to control the permissions of any created ipc
sockets.
2020-05-06 14:52:41 -03:00
Jason Rhinelander 719a9b0b58 1.1.4 2020-04-30 15:12:50 -03:00
Jason Rhinelander 08a11bb9ba Add hack to fix compilation on debian sid 2020-04-28 22:52:18 -03:00
Jason Rhinelander 99bbf8dea9 Bump version (not released yet) 2020-04-23 21:51:52 -03:00
Jason Rhinelander 1a65d7f5e5 Bump version to 1.1.2 2020-04-21 16:59:41 -03:00
Jason Rhinelander 911c66140f Bump version to 1.1.1 2020-04-17 16:19:32 -03:00
Jason Rhinelander 3b86eb1341 1.1.0: invocation-time SN auth; failure responses
This replaces the recognition of SN status to be checked per-command
invocation rather than on connection.  As this breaks the API quite
substantially, though doesn't really affect the functionality, it seems
suitable to bump the minor version.

This requires a fundamental shift in how the calling application tells
LokiMQ about service nodes: rather than using a callback invoked on
connection, the application now has to call set_active_sns() (or the
more efficient update_active_sns(), if changes are readily available) to
update the list whenever it changes.  LokiMQ then keeps this list
internally and uses it when determining whether to invoke.

This release also brings better request responses on errors: when a
request fails, the data argument will now be set to the failure reason,
one of:

- TIMEOUT
- UNKNOWNCOMMAND
- NOT_A_SERVICE_NODE (the remote isn't running in SN mode)
- FORBIDDEN (auth level denies the request)
- FORBIDDEN_SN (SN required and the remote doesn't see us as a SN)

Some of these (UNKNOWNCOMMAND, NOT_A_SERVICE_NODE, FORBIDDEN) were
already sent by remotes, but there was no connection to a request and so
they would log a warning, but the request would have to time out.

These errors (minus TIMEOUT, plus NO_REPLY_TAG signalling that a command
is a request but didn't include a reply tag) are also sent in response
to regular commands, but they simply result in a log warning showing the
error type and the command that caused the failure when received.
2020-04-12 19:57:19 -03:00
Jason Rhinelander fb3bf9bd1f Bump version to 1.0.5 2020-04-06 18:16:59 -03:00
Jason Rhinelander 4c470f3e33 Bump version to 1.0.4 2020-03-29 15:21:44 -03:00
Jason Rhinelander 2493e2abd4 Remove empty file
All the batch implementation code is in jobs.cpp, this file wasn't meant
to be committed originally.
2020-03-29 12:29:38 -03:00
Jason Rhinelander 7f9141a4a9 1.0.3 release 2020-03-27 18:55:16 -03:00
Jason Rhinelander 9fec81856f 1.0.2 version bump 2020-03-24 11:35:31 -03:00
Jason Rhinelander 48d3f261d3 1.0.1 release
- internal data structure change to help armhf/gcc-6
- various test suite fixes
- various build system improvements
2020-03-21 12:57:45 -03:00
Jason Rhinelander a36e53d409 More linking overhaul
- Don't try to use cppzmq, just find libzmq ourselves.
- Allow existing `libzmq` and `sodium` targets to be used to control how
we link to libzmq and/or sodium.
- Use PkgConfig:: targets instead of the older bunch-of-variables
approach (requires cmake >= 3.6).
2020-03-15 01:43:23 -03:00
Jason Rhinelander bc0e6be801 Add sodium dep if embedding static lib when doing a shared build, too 2020-03-14 16:06:58 -03:00
Jason Rhinelander dd088c8ba5 cmake compatibility fix 2020-03-14 15:17:48 -03:00
Jason Rhinelander 3d315ba123 More static build linking fixes
Static linking is a dumpster fire.
2020-03-14 14:34:56 -03:00
Jason Rhinelander dd1a8eeb1d Use the correct variable for shared libs 2020-03-14 02:20:43 -03:00
Jason Rhinelander c4d74a8640 Slightly relax build dep to 4.3
Distros (such as buster) include a patched 4.3.1, which is fine to use.
2020-03-13 19:41:08 -03:00
Jason Rhinelander 49f8ef21f1 Install mapbox-variant and cppzmq headers 2020-03-13 19:05:12 -03:00
Jason Rhinelander a4ec2c982b Add and install pkgconfig file 2020-03-13 15:31:43 -03:00
Jason Rhinelander 4db1cd6be7 Fix lib install dir 2020-03-13 15:29:59 -03:00
Jason Rhinelander e1e8b85de6 Rearrange cmakelists.txt more logically 2020-03-13 15:29:30 -03:00
Jason Rhinelander 344fcb80d6 Disable gnu cxx extensions 2020-03-13 15:28:03 -03:00
Jason Rhinelander 4f4862fd0b Explicitly add thread linking 2020-03-13 15:27:29 -03:00
Jason Rhinelander 1f99a70f48 Build shared libraries by default
Static libraries are cursed and like to explode in bad ways.
2020-03-13 14:28:21 -03:00
Jason Rhinelander e17ca30411 Split up into logical headers and compilation units
lokimq.cpp and lokimq.h were getting monolithic; this splits lokimq.cpp
into multiple smaller cpp files by logical purpose for better parallel
compilation ability.  It also splits up the lokimq.h header slightly by
moving the ConnectionID and Message types into their own headers.
2020-03-13 14:28:21 -03:00
Jason Rhinelander 1c80b61335 Add version to cmake, generate version header 2020-03-13 14:28:05 -03:00
Jason Rhinelander 3eb6c482e1 Fix static build
Depend on cppzmq-static when doing a static build.

cppzmq-static itself has a dependency problem with libsodium, so
explicitly set the missing but required libsodium dependency on it.
2020-03-12 17:55:34 -03:00
Jason Rhinelander 75a3d7ff11 Add libsodium dependency
We don't necessarily get this through libzmq
2020-03-05 16:29:59 -04:00
Jason Rhinelander 279a4d3ea1 Set PIC on lokimq 2020-03-05 14:52:28 -04:00
Jason Rhinelander 443eca3955 Build a static libzmq if no system one or system one is too old 2020-03-05 01:00:35 -04:00
Jason Rhinelander 2207198574 Add DESTINATION for lokimq target 2020-03-03 15:25:19 -04:00
Jason Rhinelander 7be9d71d7f CMake updates: exports, drop static, disable cppzmq tests
- Properly export the lokimq::lokimq target for use as a sub-project
- Drop the lokimq::static target; the library will just be static or
non-static dependending on cmake's BUILD_SHARED_LIBS setting
- Properly disable cppzmq tests (the previous setting resulted in cmake
warnings)
2020-03-02 14:24:07 -04:00
Jason Rhinelander 46c9f147ec Better subproject cmake support
- disable cppzmq test building
- add target for main and static library
- don't build tests by default when used as a subproject
2020-03-01 14:28:50 -04:00
Jason Rhinelander 63c71396be Add initial test suite with some batch job tests 2020-02-06 18:10:26 -04:00
Jason Rhinelander 8d97ba31ad Added missing CMakeLists.txt and LICENSE 2020-02-05 20:21:02 -04:00