dash/depends
fanquake 94a8e1a713
Merge bitcoin/bitcoin#28097: depends: xcb-proto 1.15.2
7cb88c8b46723d306b96953a6a60c90a4ab211e3 depends: xcb-proto 1.15.2 (fanquake)

Pull request description:

  Resolves build failures with Python 3.12, i.e building on rawhide:
  ```bash
  make -C depends -j9
  ...
  make[3]: Nothing to be done for 'install-exec-am'.
   /usr/bin/mkdir -p '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
   /usr/bin/install -c -m 644 __init__.py error.py expr.py align.py matcher.py state.py xtypes.py '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
  ModuleNotFoundError: No module named 'imp'
  make[3]: *** [Makefile:271: install-pkgpythonPYTHON] Error 1
  ```

  `imp` was removed in 3.12: https://docs.python.org/3/library/imp.html.

  Guix Build:
  ```bash
  6d1725c9346bdf04e1eeec2deffda90957bd081700ba896834a143756410fb0e  guix-build-7cb88c8b4672/output/aarch64-linux-gnu/SHA256SUMS.part
  34486c39daea8a3ce8d92e9c1501f26e5f5e300d9612a25bd56c48ab56353329  guix-build-7cb88c8b4672/output/aarch64-linux-gnu/bitcoin-7cb88c8b4672-aarch64-linux-gnu-debug.tar.gz
  cb0080d75d0fc4fc5c7fc022b5771470c60609c35836e7b66c4f479a2edcd098  guix-build-7cb88c8b4672/output/aarch64-linux-gnu/bitcoin-7cb88c8b4672-aarch64-linux-gnu.tar.gz
  395c332f83206125819aabf9a5dad5c906bdcd78ec13269fdfb4215bb5cc3247  guix-build-7cb88c8b4672/output/arm-linux-gnueabihf/SHA256SUMS.part
  f9e72693dd59f1b4dce6b6efa7bf325b2b589075a904c57b430dbe5c39add4ff  guix-build-7cb88c8b4672/output/arm-linux-gnueabihf/bitcoin-7cb88c8b4672-arm-linux-gnueabihf-debug.tar.gz
  14cfcebcd557d30d5a07837ab38ca217346f9b97e238a96376d6467d0db39e1a  guix-build-7cb88c8b4672/output/arm-linux-gnueabihf/bitcoin-7cb88c8b4672-arm-linux-gnueabihf.tar.gz
  1aaa7c04156a78628060a2ec47077589fb5dfb7a2e558fe604aaaa916b8a7f51  guix-build-7cb88c8b4672/output/arm64-apple-darwin/SHA256SUMS.part
  94585898babc8fdce7660c3160fe7b26c6f6749ac53a177f91a8b4226856ab7b  guix-build-7cb88c8b4672/output/arm64-apple-darwin/bitcoin-7cb88c8b4672-arm64-apple-darwin-unsigned.dmg
  9bcc693e5fad668e6c7beb8280c9c3e6988318569e0efa7d24f8cd990a3c1dd4  guix-build-7cb88c8b4672/output/arm64-apple-darwin/bitcoin-7cb88c8b4672-arm64-apple-darwin-unsigned.tar.gz
  3e427a7c2530cc3bb2f87125997bafa94234c21ebb7004cc36dc8408c0b0c9ff  guix-build-7cb88c8b4672/output/arm64-apple-darwin/bitcoin-7cb88c8b4672-arm64-apple-darwin.tar.gz
  988909c91077cb83b8d5ee77933192525d1fa1fd0bba0874138433314cb64927  guix-build-7cb88c8b4672/output/dist-archive/bitcoin-7cb88c8b4672.tar.gz
  b13c8b1f4f75505d2356f9e702db384dbb58ee3f7f0af3b110df4b7bc4c80f52  guix-build-7cb88c8b4672/output/powerpc64-linux-gnu/SHA256SUMS.part
  6f2f204401c36ee59564c8d56f9adf4f2587471ea0705e0f6a89ade4a8decf55  guix-build-7cb88c8b4672/output/powerpc64-linux-gnu/bitcoin-7cb88c8b4672-powerpc64-linux-gnu-debug.tar.gz
  c1af63ec54fcbfd267a047d2dca41bdfcace1ae6a5746df11bd710217b17b205  guix-build-7cb88c8b4672/output/powerpc64-linux-gnu/bitcoin-7cb88c8b4672-powerpc64-linux-gnu.tar.gz
  2407bc6d0beaa12dd7601ff14ef2c077346752a7b57fdf27df0a512f2af825bd  guix-build-7cb88c8b4672/output/powerpc64le-linux-gnu/SHA256SUMS.part
  ff033b4b2a3c2816555ee3a443e4087cba47d4eb05b00e092603892ff91acc30  guix-build-7cb88c8b4672/output/powerpc64le-linux-gnu/bitcoin-7cb88c8b4672-powerpc64le-linux-gnu-debug.tar.gz
  ebd9c3ab462290e2c3264dd4184a1d132b90cc93d8359ae28bc23a120b918716  guix-build-7cb88c8b4672/output/powerpc64le-linux-gnu/bitcoin-7cb88c8b4672-powerpc64le-linux-gnu.tar.gz
  57afcfe859903b960ef792447d34a17d556e44c98c021f5a35bfbd963f9e7be5  guix-build-7cb88c8b4672/output/riscv64-linux-gnu/SHA256SUMS.part
  105e6ef4fbac91e1bbbea3e98c80915654894d247cbfe0e4d2ff89b633ace10e  guix-build-7cb88c8b4672/output/riscv64-linux-gnu/bitcoin-7cb88c8b4672-riscv64-linux-gnu-debug.tar.gz
  e893e321ddd966c29fa949c3d7866fd0dca6ea87f9185e702a17c62896acf90b  guix-build-7cb88c8b4672/output/riscv64-linux-gnu/bitcoin-7cb88c8b4672-riscv64-linux-gnu.tar.gz
  80e7610cdb2ea9f1a503fa7c9ac7e29600e98fdac020951a76525494822416d9  guix-build-7cb88c8b4672/output/x86_64-apple-darwin/SHA256SUMS.part
  8fe050ca40af1d2830f7efe928f8ea8e30800dfa286f5d22549255d7ed893a30  guix-build-7cb88c8b4672/output/x86_64-apple-darwin/bitcoin-7cb88c8b4672-x86_64-apple-darwin-unsigned.dmg
  51a06c78edb9b29008deab11f5e98acac04de64080804d22b5a4f30c4b195ee5  guix-build-7cb88c8b4672/output/x86_64-apple-darwin/bitcoin-7cb88c8b4672-x86_64-apple-darwin-unsigned.tar.gz
  5cb44b69b2315fd2bb4122fa252158a9460269f24121226d88f6146e52aafc5b  guix-build-7cb88c8b4672/output/x86_64-apple-darwin/bitcoin-7cb88c8b4672-x86_64-apple-darwin.tar.gz
  d57f8ad1041a8112b012472ff00593a214f55215a29c5e5c3bc724d5eb645b1e  guix-build-7cb88c8b4672/output/x86_64-linux-gnu/SHA256SUMS.part
  76f1865d49cedf4b03f9ac5c4cb968968e54f8b19e96391340d82669a9395e93  guix-build-7cb88c8b4672/output/x86_64-linux-gnu/bitcoin-7cb88c8b4672-x86_64-linux-gnu-debug.tar.gz
  63cca6f0cbfd74148b20093bc2494b9abf50594cfb7055c5b5d702583d6c37a4  guix-build-7cb88c8b4672/output/x86_64-linux-gnu/bitcoin-7cb88c8b4672-x86_64-linux-gnu.tar.gz
  8d2afd4156525bc4684271092b5017e12f01fcc3dad29608886d10c0ef01b09d  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/SHA256SUMS.part
  6ebb038dc1f589bf92bcf3766dfcb0310f7df9ff4f75c943c2eb6fcced1a2580  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/bitcoin-7cb88c8b4672-win64-debug.zip
  d73aad8495174a49dad172278fbe590b86104bca9fcec8301a548a9fc8b1118f  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/bitcoin-7cb88c8b4672-win64-setup-unsigned.exe
  7697fffdb9b2c2f0c6042f56daf9940c561ed4c950692a2adbb039ecd885e047  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/bitcoin-7cb88c8b4672-win64-unsigned.tar.gz
  4483876d0e5709b25bd2e238958a820f7996eaebe21c1c3f3a8c3f490a0c8562  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/bitcoin-7cb88c8b4672-win64.zip
  ```

ACKs for top commit:
  hebasto:
    ACK 7cb88c8b46723d306b96953a6a60c90a4ab211e3, tested on Ubuntu Mantic with:

Tree-SHA512: 7e01c20f15864c29ada6719051e683fbf7a533aaed810aa74763f50f6810fa49e8d3773d13d18ba88a20404305fc92d3c95190e799ebaf25a82301e97422e7a8
2024-05-07 12:34:22 -05:00
..
builders Merge bitcoin/bitcoin#23955: build: add support for NetBSD in depends 2023-12-26 22:26:21 -06:00
hosts fix: drop -static-libstc++ from depends/hosts/{linux,mingw32}.mk which is clang-only 2024-04-03 16:03:26 +07:00
packages Merge bitcoin/bitcoin#28097: depends: xcb-proto 1.15.2 2024-05-07 12:34:22 -05:00
patches Merge bitcoin/bitcoin#24134: build: Fix zeromq package when cross-compiling 2024-01-13 19:32:29 -06:00
.gitignore Merge #17678: depends: Support for S390X and POWER targets 2023-04-25 23:14:25 +03:00
config.guess Merge bitcoin/bitcoin#22071: depends: latest config.guess and config.sub 2021-09-24 13:32:15 -04:00
config.site.in Merge #18677: Multiprocess build support 2024-01-16 09:34:26 -06:00
config.sub Merge bitcoin/bitcoin#22071: depends: latest config.guess and config.sub 2021-09-24 13:32:15 -04:00
description.md trivial: add some missing dashifications (#4772) 2022-04-19 09:09:42 +03:00
funcs.mk Merge bitcoin/bitcoin#25046: build: Fix libmultiprocess cross-compiling to Linux hosts 2024-02-22 20:58:43 -06:00
gen_id Merge bitcoin/bitcoin#21427: depends: Fix id_string invocations 2023-04-14 23:34:14 -05:00
Makefile Merge #18677: Multiprocess build support 2024-01-16 09:34:26 -06:00
packages.md Merge #16691: doc: improve depends prefix documentation 2023-04-04 12:45:27 -05:00
README.md Merge #21354: build, doc: Drop no longer required packages from macOS cross-compiling dependencies 2024-04-11 02:25:07 +07:00

Usage

To build dependencies for the current arch+OS:

make

To build for another arch/OS:

make HOST=host-platform-triplet

For example:

make HOST=x86_64-w64-mingw32 -j4

Dash Core's configure script by default will ignore the depends output. In order for it to pick up libraries, tools, and settings from the depends build, you must set the CONFIG_SITE environment variable to point to a config.site settings file. In the above example, a file named depends/x86_64-w64-mingw32/share/config.site will be created. To use it during compilation:

CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure

The default install prefix when using config.site is --prefix=depends/<host-platform-triplet>, so depends build outputs will be installed in that location.

Common host-platform-triplets for cross compilation are:

  • i686-pc-linux-gnu for Linux 32 bit
  • x86_64-pc-linux-gnu for x86 Linux
  • x86_64-w64-mingw32 for Win64
  • x86_64-apple-darwin for macOS
  • arm64-apple-darwin for ARM macOS
  • arm-linux-gnueabihf for Linux ARM 32 bit
  • aarch64-linux-gnu for Linux ARM 64 bit
  • powerpc64-linux-gnu for Linux POWER 64-bit (big endian)
  • powerpc64le-linux-gnu for Linux POWER 64-bit (little endian)
  • riscv32-linux-gnu for Linux RISC-V 32 bit
  • riscv64-linux-gnu for Linux RISC-V 64 bit
  • s390x-linux-gnu for Linux S390X
  • armv7a-linux-android for Android ARM 32 bit
  • aarch64-linux-android for Android ARM 64 bit
  • x86_64-linux-android for Android x86 64 bit

The paths are automatically configured and no other options are needed unless targeting Android.

Install the required dependencies: Ubuntu & Debian

For macOS cross compilation

sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso

Note: You must obtain the macOS SDK before proceeding with a cross-compile. Under the depends directory, create a subdirectory named SDKs. Then, place the extracted SDK under this new directory. For more information, see SDK Extraction.

For Win64 cross compilation

For linux (including i386, ARM) cross compilation

Common linux dependencies:

sudo apt-get install make automake curl g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch bison

For linux ARM cross compilation:

sudo apt-get install g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf

For linux AARCH64 cross compilation:

sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu

For linux POWER 64-bit cross compilation (there are no packages for 32-bit):

sudo apt-get install g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu

For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit):

sudo apt-get install g++-riscv64-linux-gnu binutils-riscv64-linux-gnu

RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken test_dash executable (see https://github.com/bitcoin/bitcoin/pull/13543), this is apparently fixed in gcc-8.1.0.

For linux S390X cross compilation:

sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu

Install the required dependencies: OpenBSD

pkg_add bash gtar

Dependency Options

The following can be set when running make: make FOO=bar

  • SOURCES_PATH: Downloaded sources will be placed here
  • BASE_CACHE: Built packages will be placed here
  • SDK_PATH: Path where SDKs can be found (used by macOS)
  • FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up
  • NO_QT: Don't download/build/cache Qt and its dependencies
  • NO_QR: Don't download/build/cache packages needed for enabling qrencode
  • NO_ZMQ: Don't download/build/cache packages needed for enabling ZeroMQ
  • NO_WALLET: Don't download/build/cache libs needed to enable the wallet
  • NO_BDB: Don't download/build/cache BerkeleyDB
  • NO_SQLITE: Don't download/build/cache SQLite
  • NO_UPNP: Don't download/build/cache packages needed for enabling UPnP
  • ALLOW_HOST_PACKAGES: Packages that are missed in dependencies (due to NO_* option or build script logic) are searched for among the host system packages using pkg-config. It allows building with packages of other (newer) versions
  • NO_NATPMP: Don't download/build/cache packages needed for enabling NAT-PMP
  • MULTIPROCESS: build libmultiprocess (experimental, requires cmake)
  • DEBUG: Disable some optimizations and enable more runtime checking
  • HOST_ID_SALT: Optional salt to use when generating host package ids
  • BUILD_ID_SALT: Optional salt to use when generating build package ids
  • FORCE_USE_SYSTEM_CLANG: (EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the system's $PATH rather than the default prebuilt release of Clang from llvm.org. Clang 8 or later is required.

If some packages are not built, for example make NO_WALLET=1, the appropriate options will be passed to Dash Core's configure. In this case, --disable-wallet.

Additional targets

download: run 'make download' to fetch all sources without building them
download-osx: run 'make download-osx' to fetch all sources needed for macOS builds
download-win: run 'make download-win' to fetch all sources needed for win builds
download-linux: run 'make download-linux' to fetch all sources needed for linux builds

Android

Before proceeding with an Android build one needs to get the Android SDK and use the "SDK Manager" tool to download the NDK and one or more "Platform packages" (these are Android versions and have a corresponding API level). In order to build ANDROID_API_LEVEL (API level corresponding to the Android version targeted, e.g. Android 9.0 Pie is 28 and its "Platform package" needs to be available) and ANDROID_TOOLCHAIN_BIN (path to toolchain binaries depending on the platform the build is being performed on) need to be set.

API levels from 24 to 29 have been tested to work.

If the build includes Qt, environment variables ANDROID_SDK and ANDROID_NDK need to be set as well but can otherwise be omitted. This is an example command for a default build with no disabled dependencies:

ANDROID_SDK=/home/user/Android/Sdk ANDROID_NDK=/home/user/Android/Sdk/ndk-bundle make HOST=aarch64-linux-android ANDROID_API_LEVEL=28 ANDROID_TOOLCHAIN_BIN=/home/user/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin

Other documentation