Commit graph

843 commits

Author SHA1 Message Date
Jason Rhinelander 5b97ff6e9c cmake modernization
The archaic (i.e. decade old) cmake usage here really got in the way of
trying to properly use newer libraries (like lokimq), so this undertakes
overhauling it considerably to make it much more sane (and significantly
reduce the size).

I left more of the architecture-specific bits in the top-level
CMakeLists.txt intact; most of the efforts here are about properly
loading dependencies, specifying dependencies and avoiding a whole pile
of cmake antipatterns.

This bumps the required cmake version to 3.5, which is what xenial comes
with.

- extensive use of interface libraries to include libraries,
definitions, and include paths

- use Boost::whatever instead of ${Boost_WHATEVER_LIBRARY}.  The
interface targets are (again) much better as they also give you any
needed include or linking flags without needing to worry about them.

- don't list header files when building things.  This has *never* been
correct cmake usage (cmake has always known how to wallet_rpc_headers
the headers that .cpp files include to know about build changes).

- remove the loki_add_library monstrosity; it breaks target names and
makes compiling less efficient because the author couldn't figure out
how to link things together.

- make loki_add_executable take the output filename, and set the output
path to bin/ and install to bin because *every single usage* of
loki_add_executable was immediately followed by setting the output
filename and setting the output path to bin/ and installing to bin.

- move a bunch of crap that is only used in one particular
src/whatever/CMakeLists.txt into that particular CMakeLists.txt instead
of the top level CMakeLists.txt (or src/CMakeLists.txt).

- Remove a bunch of redundant dependencies; most of them look like they
were just copy-and-pasted in, and many more aren't needed (since they
are implied by the PUBLIC linking of other dependencies).

- Removed `die` since it just does a FATAL_ERROR, but adds color (which
is useless since CMake already makes FATAL_ERRORs perfectly visible).

- Change the way LOKI_DAEMON_AND_WALLET_ONLY works to just change the
make targets to daemon and simplewallet rather than changing the build
process (this should make it faster, too, since there are various other
things that will be excluded).
2020-03-06 00:36:57 -04:00
Doyle 6db16af82c Add sqlite3 support for depends and dockerfile 2020-02-13 11:07:46 +11:00
Doyle 394d587c2c Remove vendored SQLite, rely on system installed lib 2020-02-13 11:07:46 +11:00
Jason Rhinelander f3fdcb1fbc Replace once_a_time_seconds; send proofs faster
This replaces the horrible, horrible, badly misused templated
once_a_time_seconds and once_a_time_milliseconds with a `periodic_task`
that works the same way but takes parameters as constructor arguments
instead of template parameters.

It also makes various small improvements:

- uses std::chrono::steady_clock instead of ifdef'ing platform dependent
  timer code.
- takes a std::chrono duration rather than a template integer and
  scaling parameter.
- timers can be reset to trigger on the next invocation, and this is
  thread-safe.
- timer intervals can be changed at run-time.

This all then gets used to reset the proof timer immediately upon
receiving a ping (initially or after expiring) from storage server and
lokinet so that we send proofs out faster.
2019-12-26 12:29:05 -04:00
Jason Rhinelander 38a4240c71 Avoid long-deprecated boost::sleep
Also don't return a completely useless bool.
2019-12-26 12:26:03 -04:00
Jason Rhinelander a8d4887bb8 Remove unneeded patch 2019-12-23 15:09:45 -04:00
Jason Rhinelander 150850c148 openssl depends makefile fix 2019-12-22 22:52:11 -04:00
Howard Chu dc0d2462fd "Fix" non-determinism in native_cctools build
By omitting the otool binary which is built non-deterministically.
We don't use it anyway.
2019-12-22 22:41:27 -04:00
Howard Chu cfc94b9ede Fix unwind library ordering
Sort objects being archived
2019-12-22 22:41:06 -04:00
Howard Chu 6a0d18e102 Fixup sodium darwin
get rid of sodium-darwin.mk special case, unify back with sodium.mk
2019-12-22 22:40:36 -04:00
Howard Chu e8cc7bfaad Add ARFLAGS
Needed to invoke deterministic mode on some archivers
2019-12-22 22:39:55 -04:00
Howard Chu 200a9efc51 depends: Add FreeBSD support 2019-12-22 22:37:36 -04:00
Howard Chu 2e8cdab270 Add Android support 2019-12-22 22:33:27 -04:00
hyperreality f768f4e016 Fix Travis build on Windows + Mac
Following 13c0b8c, the unwind package is being attempted to be built on
Windows and Mac when it should only be built on Linux.
2019-12-22 22:24:05 -04:00
TheCharlatan 75fddd37e7 Add depends riscv 64 bit support 2019-12-22 22:24:00 -04:00
Jason Rhinelander 055b593237 Fix contrib/depends library incompatibilities
sodium and zmq libs weren't using the same variable name which would end
up linking to system libsodium even when we meant to link to the static
one from contrib/depends.
2019-12-19 20:24:38 -04:00
Jason Rhinelander 19c562f800 Vote serialization compatibility fix (#984)
quorum_vote_t's were serialized as blob data, which is highly
non-portable (probably isn't the same on non-amd64 arches) and broke
between 5.x and 6.x because `signature` is aligned now (which changed
its offset and thus broke 5.x <-> 6.x vote transmission).

This adds a hack to write votes into a block of memory compatible with
AMD64 5.x nodes up until HF14, then switches to a new command that fully
serializes starting at the hard fork (after which we can remove the
backwards compatibility stuff added here).
2019-12-17 10:47:12 +10:00
Jason Rhinelander 2dc6e87184 Remove unused (and outdated) libunbound
unbound is vendored under external/ already; this doesn't get used.
2019-12-03 17:07:18 -04:00
Jason Rhinelander dab4596cf0 Update openssl to 1.1.1d
1.0.2 is nearly obsolete (it reaches end of support at the end of 2019).
2019-12-03 17:07:18 -04:00
Jason Rhinelander a22f0d7d96 Update libusb to 1.0.23
This (along with hidapi) were recently resurrected.
2019-12-03 17:07:18 -04:00
Jason Rhinelander dbc4a4ad0c Update ldns to 1.7.1 2019-12-03 17:07:18 -04:00
Jason Rhinelander 448e7c1b09 Update hidapi to 0.9.0
0.8.x is long obsolete, project has been resurrected at a new home as
version 0.9.0.
2019-12-03 17:07:18 -04:00
Jason Rhinelander 6928d764ef Update zeromq to 4.3.2 and enable sodium & curve
4.3.2 is a security update.  We also want sodium and curve support for
loki.

The new patches are upstream fixes for mingw builds.
2019-12-03 17:07:18 -04:00
Jason Rhinelander b6189701d8 Update sodium to 1.0.18 2019-12-03 17:07:18 -04:00
Jason Rhinelander 9954688c94 Remove ccache from deps
Including ccache via the deps system makes little sense: this is a host
system tool, like the compiler, that should be installed in the build
environment.
2019-12-03 17:07:18 -04:00
Jason Rhinelander 845e7a9446 Remove cppzmq build system dep
We include a copy of cppzmq already (plus it's header only to begin
with).
2019-12-03 17:07:18 -04:00
Howard Chu d7f500cd1e Fix readline build
Make sure it links to our libtinfo from our ncurses build.
Hardcode some basic terminal descriptions into our libtinfo.
Re-enable $HOME/.terminfo support to allow user customization.
Use unlikely terminfo-dir, to prevent accidentally using
differently-configured system databases.
2019-12-03 17:07:18 -04:00
iDunk5400 59eac93514 depends: attempt to fix readline
Make readline actually compile, and make ncurses use existing terminfo data (if available).
2019-12-03 17:07:18 -04:00
TheCharlatan 4e6f7ab68a Add ncurses package for linux and darwin readline
Readline support is now compiled with the ncurses backend.
2019-12-03 17:07:18 -04:00
iDunk5400 b49a3a6b85 depends: fix monero binaries Boost linking errors
It would try to link against host system Boost libs when building outside gitian. Tested with x86_64-linux-gnu target.
2019-12-03 17:07:18 -04:00
Jason Rhinelander ca36648749 Split up huge instanciations & header fixes
rpc/instanciations.cpp is a huge compiler job because it includes two
separate huge template instanciations [sic] in it.  Splitting it apart
into two separate compilation units makes compilation more
parallelizable and requires less ram for the individual job.

The split also revealed a few missing headers in epee for logging macros.
2019-12-03 00:51:18 -04:00
Doyle 8df27d99b7
Merge pull request #935 from jagerman/blink-wallet-burn
Blink wallet burn
2019-11-29 13:51:00 +11:00
Jason Rhinelander fc0abd94e5 Don't try forward declaring is_byte_spannable 2019-11-28 02:09:58 -04:00
Jason Rhinelander e50a445a0f Fix for older libc++ (#938)
Older libc++ (as on our travis-ci darwin build) apparently don't
properly treat std::array's size() method as constexpr.  Work around
this by using the deduced `Size` template parameter instead.
2019-11-28 16:27:12 +11:00
Jason Rhinelander d66e6e9e3f Align hashable data structures
We don't impose any alignment on hashable types, but this means the
hashing function is doing invalid misaligned access when converting to a
size_t.  This aligns all of the primitive data types (crypto::hash,
public keys, etc.) to the same alignment as size_t.

That cascades into a few places in epee which only allow byte spanning
types that have byte alignment when what it really requires is just that
the type has no padding.  In C++17 this is exactly the purpose of
std::has_unique_object_representations, but that isn't available (or
even implementable) in C++14 so add specializations for the type that
need it to tell epee that we know those types are properly packed and
that it can safely use them as bytes.

Related to this, monero/epee also misuses `is_standard_layout` when the
purpose is actually `is_trivially_copyable`, so fixed that too.  (You
need the latter but don't need the former for a type to be safely
memcpy'able; the only purpose of `is_standard_layout` is when you need
to be sure your structs are compatible with C structs which is
irrelevant here).
2019-11-27 14:07:52 -04:00
Jason Rhinelander 00098181fe epee serialization simplifications
Removes one unnecessary layer of templated indirection in kv
serialization, and removes use of boost::mpl::vector code generation.

Also removes a double-specification of the same type in the epee
array_entry specification.
2019-11-27 14:07:52 -04:00
Jason Rhinelander 29be7f6552 Allow epee async call response values to be moved
This allows the caller to also take the response by rvalue reference so
that they can move outsubvalues.  The rvalue is totally fine here (once
the callback is invoked it is never used again) and still binds
perfectly well to const-lvalue accepting callbacks.
2019-11-27 14:07:52 -04:00
Jason Rhinelander 8632c63738 Teach epee to serialize std::array & simplify template code
Also adds unordered_set serialization support (not that we currently
need it, but it's just two lines to support).
2019-11-26 18:49:33 -04:00
Jason Rhinelander a9294cdbef Remove boost::value_initialized and BOOST_FOREACH (#921)
Neither of these have a place in modern C++11; boost::value_initialized
is entirely superseded by `Type var{};` which does value initialization
(or default construction if a default constructor is defined).  More
problematically, each `boost::value_initialized<T>` requires
instantiation of another wrapping templated type which is a pointless
price to pay the compiler in C++11 or newer.

Also removed is the AUTO_VAL_INIT macro (which is just a simple macro
around constructing a boost::value_initialized<T>).

BOOST_FOREACH is a similarly massive pile of code to implement
C++11-style for-each loops. (And bizarrely it *doesn't* appear to fall
back to C++ for-each loops even when under a C++11 compiler!)

This removes both entirely from the codebase.
2019-11-01 09:26:58 +11:00
Jason Rhinelander 0408af80ef iOS build fix (#903)
Apple clang is resolving the `quoted()` calls here with
std::quoted(std::string) because of the ADL with the std::string
argument, then boost fails because rather than passing boost ranges the
code ends up passing libc++'s internal `__quoted_output_proxy` (the
opaque return type of `std::quoted()`.

(This only appeared now because std::quoted() doesn't exist before
C++14).

This works around the issue by just renaming the internal `quoted()`
function to `add_quotes()`.
2019-10-18 08:48:18 +10:00
Doyle 0bf62d0dfd
Merge pull request #888 from Doy-lee/FixTravisOnMacAndMakeDepends
Fix travis on mac and make depends
2019-10-10 14:00:22 +11:00
Doyle 7568fb9d1e Specify boost no system paths properly, fix type ambiguity in epee 2019-10-10 12:17:29 +11:00
Doyle 4825c4c023 In openssl >1.1, SSL_CTX_set_ecdh_auto is macroed 1, cast to calm warnings 2019-10-10 11:43:50 +11:00
Howard Chu 12a2e75310 Don't set ARCH_ID if it's already set
Usually it's unset, but depends toolchain files set it explicitly
for cross-compiling. Don't override preset values. But make sure
it's set for all x86 / x86_64 builds, not just Linux.

Also make sure -std=c++11 is set for Darwin builds, not all
submodules were getting it consistently before.
2019-10-09 15:33:21 +11:00
Jason Rhinelander 0b384f5f52 Use perfect forwarding to set default serialize value
Avoids an extra copy plus also allows move assignment where available.
2019-10-07 22:09:17 -03:00
Howard Chu 3b8dd4b25b Updated RandomX integration from upstream
Support RandomX PoW algorithm
2019-09-25 17:12:23 -03:00
moneromooo-monero 9fc266df58 epee: misc_log_ex.h can now be used in C code
use mfatal/merror/mwarning/minfo/mdebug/mtrace
2019-09-25 14:46:53 -03:00
Doyle aaf4c5a32c Add WARNINGS_AS_ERRORS flag for release builds 2019-09-16 18:02:58 +10:00
Doyle 97c7c0f5fd Revert "Remove -Werror"
This reverts commit 707c2f836b.
2019-09-16 10:09:34 +10:00
Doyle 6689f70d09
Check wallet is connected before entering trigger happy exception functions (#838) 2019-09-13 13:10:47 +10:00