Commit Graph

31 Commits

Author SHA1 Message Date
Jack Grigg c7df8445d0 depends: Allow per-host package download paths
Clang's download path includes its version, but LLVM doesn't always
publish every package for every version, so we need to support multiple
versions.

Fixes zcash/zcash#4954.
2021-01-21 15:19:02 +00: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
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
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 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
Jack Grigg 927a03465f Merge branch 'master' into modernise-macos-toolchain 2020-08-08 00:07:31 +01:00
Jack Grigg 9cdc6f2a85 depends: Use FALLBACK_DOWNLOAD_PATH if the primary's hash doesn't match
The previous behaviour was to use FALLBACK_DOWNLOAD_PATH to download
dependencies if the primary did not resolve. This was not resilient
against primaries that either mis-report HTTP status codes (e.g.
SourceForge returning 200 OK alongside a 404 webpage), or did not
guarantee artifacts to be bit-stable (e.g. GitHub regenerating commit
archive caches in a non-reproducible manner); in either case, the
incorrect file would be fetched and then the build would fail due to
hash mismatch.

The new behaviour is to download dependencies and check their hashes as
an atomic operation, and use FALLBACK_DOWNLOAD_PATH if any part of the
operation fails.
2020-08-07 10:07:07 +01:00
Jack Grigg 25ef1940b0 Revert "Try downloading from our mirror first to avoid headaches."
This reverts commit 5cd512b928.
2020-08-07 09:14:20 +01:00
Jack Grigg a4bfd2ea09 Revert "Rename FALLBACK_DOWNLOAD_PATH to PRIORITY_DOWNLOAD_PATH"
This reverts commit be60c6d7f6.
2020-08-07 09:13:23 +01:00
Carl Dong d6c3af5e84 depends: Decouple toolchain + binutils
For now they remain the same, but in the next commit, we will assign
them differently according to wether or not we're using system clang.
2020-07-30 04:33:36 +01:00
Carl Dong 6dcba32cc4
depends: tar: Always extract as yourself
For normal users, --no-same-owner is default, but not so for root, where
it is assumed that root can change ownership willy-nilly. This is not
the case for privilege-limited container environments where we gaslight
the process into thinking it's root.

Zcash: Excludes QT changes
2019-12-10 20:38:31 +00:00
Jack Grigg f3ec4534ee
depends: Fix crate vendoring path 2019-09-07 04:04:13 -04:00
Jack Grigg d7ab954511
depends: Generalise the rust package cross-compilation functions 2019-03-13 04:40:57 +00:00
Jack Grigg c63c9f20e4
depends: Add support for unpackaged Rust crates 2018-04-11 08:00:23 -06:00
Jack Grigg 0adfdc99b2
depends: Explicitly download and vendor Rust dependencies
Closes #2231.
2018-03-28 15:46:51 +02:00
kozyilmaz 35e12d992a empty spaces in PATH variable cause build failure 2017-10-31 15:14:21 +03:00
Homu 00fd23930b Auto merge of #2443 - str4d:1621-priority-download-path, r=str4d
Rename FALLBACK_DOWNLOAD_PATH to PRIORITY_DOWNLOAD_PATH

Closes #1621.
2017-06-19 23:46:44 -07:00
Jack Grigg be60c6d7f6
Rename FALLBACK_DOWNLOAD_PATH to PRIORITY_DOWNLOAD_PATH
Closes #1621.
2017-06-15 16:32:36 +12:00
kozyilmaz e6dc07bc69 support per platform filename and hash setting for dependencies 2017-06-09 13:15:27 +03:00
Taylor Hornby 5cd512b928 Try downloading from our mirror first to avoid headaches. 2016-03-31 16:33:30 -06:00
Nathan Wilcox ad71899e5f Append the preferred local filename to fallback url, rather than upstream filename.
In some cases, such as for github revision tarballs, the upstream
filename is just ``$HASH.tar.gz``, but the local filename is
``${PACKAGE_NAME}-${HASH}.tar.gz``. With this patch, it's clear which
packages each URLs provides *and* it makes the process of updating
http://z.cash/depends/sources a simple scp rather than involving some
kind of name translation.

Closes #622.
2016-01-19 18:24:45 -08:00
Cory Fields 235b3a789d depends: sanity-check sources and cached builds
In some cases (Travis), sources and build caches may be moved around in-between
builds, and we can't necessarily trust that everything is still intact.

This introduces pre-build checks that verify against stashed checksums.

Note that this will cause all sources to be re-downloaded, since cached sources
weren't trustworthy before this.
2015-05-14 01:33:07 -04:00
Michael Ford 5a809ef0f0 depends: fix typos 2015-01-31 17:38:28 -05:00
Cory Fields d57b303e1e depends: fix major regression after d546191dc.
Broken hash logic caused all depends on some platforms (osx at least) to end up
with the same build-id. Without this fix, nothing will be rebuilt when recipes
or dependencies change.
2014-12-31 13:20:24 -05:00
Cory Fields d546191dc2 depends: Move source stamps to source dir and misc cleanups
Since the last commit will force rebuilds of all depends, take the opportunity
to clean up a few other things that would trigger rebuilds as well.

- Move source stamps to the sources dir so that SOURCES_PATH is respected for
  "make download".
- Only print "fetching..." when actually downloading a file.
- Avoid using non-deterministic paths for the recipe hash (patch location).
  This should ensure that all builders get the same resulting build-ids.
- Use a per-package source paths. This will allow for removing old source files
  in the future.
- Use a host-agnostic path for downloads which gets cleaned up properly.
2014-12-11 19:23:12 -05:00
Cory Fields 2027ad30e7 depends: add the debug/release concept to depends 2014-09-25 14:56:25 -04:00
Cory Fields e4cf9f8479 depends: fix typo in source downloading. Regression from c897b1e732.
Some sources are renamed after download, since the filenames don't play nice
with (for example) gitian. This fixes the rename.

Needed for OSX build as it renames a file.
2014-09-04 14:17:57 -04:00
Cory Fields c897b1e732 depends: add a fallback path in case package sources go missing
If a source url fails to download, try again at
$FALLBACK_DOWNLOAD_PATH/file.name, where FALLBACK_DOWNLOAD_PATH can be
overridden by the user.
2014-08-22 15:42:54 -04:00
Cory Fields 1910910dde depends: fix shasum on osx < 10.9
Shasum verification from stdin doesn't work there, so we write to a file
instead.

Formatted a bit too.
2014-08-15 22:48:36 -04:00
Cory Fields 1dec09b341 depends: add shared dependency builder
See the README's in depends for documentation
2014-08-08 15:10:46 -04:00