Commit Graph

362 Commits

Author SHA1 Message Date
Jack Grigg 9052751c21 depends: Build C++ dependencies with C++ 17 2020-10-20 13:55:14 +01:00
str4d eaed8d5797
depends: Add untested note to FreeBSD host
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-10-19 20:19:00 +01:00
Jack Grigg ab4033c49c depends: Fix boost::iostreams usage on Windows with libc++
Fixed upstream (but not yet in a Boost release):
    https://github.com/boostorg/iostreams/pull/106
2020-10-13 16:33:25 +01:00
Jack Grigg c691a8413f depends: Rename Boost libraries to follow MinGW/GCC convention
Boost uses the MSVC naming convention when building Windows libraries,
which causes issues with lld.
2020-10-13 15:29:01 +01:00
Jack Grigg 3973a16358 depends: Fix "unused variables" warning when compiling zeromq for Windows
Clang triggers that warning, which becomes an error due to -Werror.
2020-10-13 14:12:41 +01:00
Jack Grigg 5ca4fbf8f6 build: Statically link libc++ 2020-10-13 14:12:41 +01:00
Jack Grigg fa54a1661a depends: Add multilib paths for Linux cross-compile 2020-10-13 14:12:41 +01:00
Jack Grigg 0887f64c90 depends: Don't replace default CXXFLAGS in C++ dependencies 2020-10-13 14:12:41 +01:00
Jack Grigg 1b96347867 depends: Add libc++ as a dependency
For mingw32:

- We use the binaries provided by MSYS2, which do not go back as far as
  libc++ 8. We use libc++ 9 here, matching the LLVM version we will be
  switching to in a subsequent commit (to match the LLVM version used by
  Rust 1.44). We manually specify the path to the libc++ headers,
  because they don't match the headers used by Clang itself.

- We now require at least mingw-w64 6.0.0, which fixes two Clang
  compilation bugs:
  - 1bd66b53be
  - 82b169c573

Darwin is ignored, as the Xcode SDK includes libc++.

For all other targets, we use the static libraries included in Clang
releases. We reuse the files we downloaded in native_clang for native
compilation, instead of fetching the archive twice.
2020-10-13 14:12:41 +01:00
Jack Grigg ff4cb00cb2 depends: Vendor LLD and use it for linking
We don't specify it for macOS, as we already pin a specific SDK there.
2020-10-12 18:10:16 +01:00
Jack Grigg 4abd76f70e depends: Use vendored Clang for macOS cross-compilation 2020-10-12 17:55:12 +01:00
Jack Grigg d306b72be4 depends: Use vendored Clang for native compilation
Clang is used for compiling C/C++ dependencies, as well as the Zcash
binaries themselves. GCC is still required for compiling native
toolchain dependencies (such as ccache).
2020-10-12 17:55:12 +01:00
Jack Grigg d071e316e5 depends: Add Clang 8.0.0
We vendor only the subset of the Clang tarball that we require.
2020-10-12 17:55:12 +01:00
Nate Wilcox 5a47aa5350 Convert a sed command to a static patch file. 2020-10-12 11:58:28 +09:00
str4d a5c2daf618
depends: Update packages documentation for Zcash
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-10-08 14:15:03 +01:00
Jack Grigg 7c9fa28274 depends: ZeroMQ 4.3.3 2020-10-06 00:03:21 +01:00
fanquake 3c4f9d383f build: pass --enable-option-checking to applicable packages 2020-10-05 23:48:58 +01:00
fanquake 3420f0171e build: only pass --disable-dependency-tracking to packages that understand it
By blanket passing --disable-dependency-tracking to all depends packages
we end up with some warnings like:

configure: WARNING: unrecognized options: --disable-dependency-tracking

So instead, only pass it to packages that understand it.

Related to https://github.com/bitcoin/bitcoin/issues/16354.
2020-10-05 23:46:38 +01:00
fanquake 13f0e7874a depends: zeromq: disable draft classes and methods 2020-10-05 23:42:15 +01:00
Carl Dong 84dfe68465 depends: Purge libtool archives
We use pkg-config where we can, which generally replaces libtool at a
higher level and does not have the same downsides as libtool. These
archives sit in our depends tree with no purpose and pollute the final
bitcoin build with massive overlinking.
2020-10-05 23:37:09 +01:00
Carl Dong df60fd966b depends: Build secondary deps statically.
Secondary dependencies don't need to be shared.
2020-10-05 23:36:26 +01:00
fanquake 92aa4d6178 depends: Disable unused ZeroMQ features
Zcash: From upstream commit 387879dd4cbecd4d39bcf691bfe910047e5ed85c
2020-10-05 22:46:58 +01:00
Jack Grigg be700a89cc depends: ccache 3.7.12 2020-10-05 19:58:39 +01:00
Jack Grigg a9f62bdda0 depends: Boost 1.74.0
- The old patch is no longer necessary because of this upstream fix:
    https://github.com/boostorg/build/pull/560

- Boost 1.72 removed a <deque> from an include, which exposed a missing
  include in src/httpserver.cpp.

- Boost 1.73 moved function placeholders into the boost::placeholders
  namespace.

- The new patch is a fix from just after Boost 1.74 was released, fixing
  a warning that was missed.
2020-10-05 19:48:46 +01:00
Dimitris Apostolou 95a5c30339
Fix zeromq warning 2020-10-03 09:13:35 +03:00
Jack Grigg 0d4a7b032f depends: Use correct HOST for download-linux target
By using the old HOST with -unknown, `make -C depends download` was
interpreting the download-linux step as a cross-compile, and attempting
to download a Rust stdlib for Linux that we weren't pinning (because we
don't support cross-compiling to x86_64 Linux - just build it native).

Follow-up to https://github.com/zcash/zcash/pull/4749.
2020-10-01 11:22:27 +01:00
Jack Grigg 076c1af55c depends: utfcpp 3.1.2 2020-10-01 11:10:33 +01:00
Jack Grigg 78a7230f50 depends: googletest 1.8.1 2020-10-01 10:57:57 +01:00
Jack Grigg 7725f66051 depends: ccache 3.7.11 2020-10-01 10:57:26 +01:00
Jack Grigg 96da9c2c00 depends: libevent 2.1.12
This includes https://github.com/libevent/libevent/pull/637 which fixes
a problem we encounter during cross-compilation with clang.
2020-10-01 10:56:42 +01:00
fanquake f477932d38 depends: remove OpenSSL package 2020-09-30 00:40:12 +01:00
Jack Grigg 9384b78c0f depends: Update map of GCC canonical hosts to Rust targets
The updated files now output x86_64-pc-linux-gnu on some platforms where
they previously output x86_64-unknown-linux-gnu.
2020-09-28 18:20:47 +01:00
Jack Grigg 8e55824119 depends: Update to latest config.guess & config.sub 2020-09-25 14:11:58 +01:00
Dimitris Apostolou 4e1d3856ee
Remove reference to cargo-checksum.sh 2020-09-25 07:15:04 +03:00
Jack Grigg a554f7ccc6 depends: Remove cargo-checksum.sh
Now that we are using `cargo vendor`, the checksum files are computed
automatically.
2020-09-23 11:30:35 +01:00
Sean Bowe 03ce24013a
Update Rust to 1.44.1. 2020-09-22 15:06:01 -06:00
Jack Grigg 2449349882 depends: Ensure that SOURCES_PATH exists before vendoring crates
During Gitian builds, SOURCES_PATH is set to a path within the Gitian
cache. Normally this path is created as part of creating a particular
dependency's source directory, but in some situations we may vendor Rust
crates before this folder exists.
2020-09-19 13:35:36 +01:00
Jack Grigg 549bf2dfa8 depends: Switch to `cargo vendor` for Rust dependencies
When we first integrated Rust into our build system, we had two
limitations:

- We were building the `librustzcash` FFI library as a dependency, and
  therefore needed access to its crate dependencies in the depends
  system.
- Gitian builds happen offline, so we needed to fetch any crate
  dependencies ahead of time, and then configure cargo to use these in
  an offline environment.

At the time, `cargo` already had support for "Source Replacement", but
there was no easy way to package the dependencies in the necessary way.
What we implemented was effectively the `cargo-vendor` tool, built using
Makefiles. A noticeable downside was that we were pinning dependencies
twice: once in the `Cargo.lock` for the FFI library, and again in our
depends system.

Since then, `cargo-vendor` has been upstreamed into `cargo` itself, and
we have moved `librustzcash` into this repository. We can therefore use
`cargo vendor` directly from our pinned Rust compiler to fetch the
dependencies, and rely on our local `Cargo.lock` to pin the specific
crates we are relying on.
2020-09-18 22:55:57 +01:00
Jack Grigg f0babb8356 depends: cargo update 2020-08-25 13:07:22 +01:00
Jack Grigg c10ba7da41 depends: Migrate to zcash_* 0.3.0 Rust crates 2020-08-25 13:07:22 +01:00
Homu 2502ebb183 Auto merge of #4656 - str4d:depends-fixes, r=str4d
depends: Fixes to build system
2020-08-10 23:58:27 +00:00
Jack Grigg 682bc15757 depends: Split check-packages and check-sources across categories
All the text from a make action is passed as arguments to a single
execve call, and it can't be longer than the maximum size allowed by the
operating system. We now have enough Rust crates vendored by the depends
system that we are hitting this limit here.
2020-08-10 22:52:23 +01:00
Jack Grigg ddc517b2c8 depends: Add platform-specific overrides for download files 2020-08-10 22:52:23 +01:00
Jack Grigg 2a3770cfbf depends: Rework Rust integration
The Rust toolchain is now a native dependency, and the vendored crates
no longer depend on the native toolchain.
2020-08-10 22:52:23 +01:00
Homu 9487115cbb Auto merge of #3952 - LongShao007:master, r=daira
Remove unnecessary patch in bdb.mk

there is no "__atomic_compare_exchange" function in "src/dbinc/atomic.h".
2020-08-10 13:31:55 +00:00
Jack Grigg 927a03465f Merge branch 'master' into modernise-macos-toolchain 2020-08-08 00:07:31 +01:00
Homu d36718542c Auto merge of #4597 - str4d:rust-tracing, r=str4d
Use the Rust tracing crate for C++ logging

This PR swaps in the `tracing` crate (via FFI) for logging to either standard
output or `debug.log`. It transparently maps all existing `LogPrintf` and
`LogPrint` invocations to info-level `tracing` events, and passes through
correct file and line information. `error` invocations are mapped to error-level
`tracing` events, currently without line information (due to the way that
`error` is used in the codebase; swapping individual callsites to the new
`LogError` macro will provide that information).

The end-goal for this change is that we don't need to make any disruptive
changes to the codebase, but we can start to leverage `tracing`-specific
functionality where we want to, such as providing extra fields on certain log
lines (that can be filtered for), adding spans to record the flow of execution
through `zcashd`, and logging within C++ and Rust simultaneously. Support
for extra fields on spans and events will be added in a subsequent PR.

The `-debug` config options are converted at launch into their corresponding
directives for tracing's `EnvFilter`. The new `setlogfilter` RPC method allows
this filter to be reloaded dynamically. The syntax is documented in the
`setlogfilter` help text, as well as here:

https://docs.rs/tracing-subscriber/0.2.7/tracing_subscriber/filter/struct.EnvFilter.html#directives

When `-printtoconsole` is specified, the output now includes timestamps and
ANSI encoding :)
2020-08-07 21:54:46 +00:00
Homu 205c7b5844 Auto merge of #4653 - str4d:reliable-dependency-fetching, r=str4d
depends: Revert to using upstreams as primary download paths

We use the depends system for vendoring `zcashd` dependencies, pinning them
with SHA-256 hashes. It supports fetching dependencies from both their
upstream archive source, and a mirror operated by ECC.

In #816, we switched to the ECC mirror as the primary source, due to an
unreliable upstream (SourceForge). However, this only addressed the symptom
(that dependency builds would reliably fail with an unreliable upstream that
was serving incorrect files). In particular, if the ECC mirror were to become
similarly unreliable, the issue would return.

This PR fixes the core problem, by downloading dependencies and checking
their hashes as an atomic operation. This gives us greater resiliency, as
both the primary and fallback would need to fail in order to halt the build.
Having addressed this problem, we also switch back to using upstreams as
primary download paths.
2020-08-07 18:14:56 +00:00
Jack Grigg 70c518bb84 depends: tracing-core 0.1.13 2020-08-07 15:26:28 +01:00
Jack Grigg 2b7d824714 Use a tracing EnvFilter directive for -debug flags 2020-08-07 15:08:10 +01:00