mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-23 16:44:52 +01:00
Compare commits
126 Commits
v0.20-fina
...
v0.19.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f9f9b37b5 | ||
|
|
33cbedef28 | ||
|
|
e301a9fde3 | ||
|
|
f8d2a04847 | ||
|
|
5f2f304cbe | ||
|
|
5baaea4410 | ||
|
|
9c714993e9 | ||
|
|
a7bdf5c3ac | ||
|
|
0b64310fb6 | ||
|
|
5b2de04e7f | ||
|
|
6957419a28 | ||
|
|
27bb2cc3b6 | ||
|
|
8bd2ab1f35 | ||
|
|
a8411b3d9c | ||
|
|
aee9d2306a | ||
|
|
89a6bb9245 | ||
|
|
52c3bec1ba | ||
|
|
2ea826cfc4 | ||
|
|
28a9df7d76 | ||
|
|
be951470be | ||
|
|
1fd9cd2cb4 | ||
|
|
8c0a9595ec | ||
|
|
d70f700021 | ||
|
|
f8f7d91b80 | ||
|
|
b7e16a82c9 | ||
|
|
30a28146ac | ||
|
|
0d87a5b4e2 | ||
|
|
bde6a5a676 | ||
|
|
e422f65aee | ||
|
|
0d0dd6ae96 | ||
|
|
ed0223ec59 | ||
|
|
05f5dd96c7 | ||
|
|
58ba7c314d | ||
|
|
48fef5ebae | ||
|
|
1964561a3a | ||
|
|
a28ea316ed | ||
|
|
facbdc0f5e | ||
|
|
628103d673 | ||
|
|
c3caf2d84c | ||
|
|
e5322d6dad | ||
|
|
9bd082e657 | ||
|
|
ba0b7e1296 | ||
|
|
4755037d45 | ||
|
|
f55442aa81 | ||
|
|
fa4d00b569 | ||
|
|
5e1728017b | ||
|
|
f5fb7fca96 | ||
|
|
7d53995ff2 | ||
|
|
b4e5363ccc | ||
|
|
f11872cbf4 | ||
|
|
1cf77a2dc3 | ||
|
|
755b0734bb | ||
|
|
178a834687 | ||
|
|
1b0afb71a2 | ||
|
|
c3cb60222c | ||
|
|
1299a1a11f | ||
|
|
daf2fff236 | ||
|
|
c8ad23c529 | ||
|
|
4cf7350422 | ||
|
|
9d980c1f7f | ||
|
|
98159132c3 | ||
|
|
cd67b1dcb8 | ||
|
|
b8101fb7ac | ||
|
|
eac49073eb | ||
|
|
e2c45d89f7 | ||
|
|
a5489c9892 | ||
|
|
88729d804e | ||
|
|
eafcea7a0a | ||
|
|
7e66d04770 | ||
|
|
179d55f052 | ||
|
|
bb123c6527 | ||
|
|
fd4ec7c720 | ||
|
|
99b54076ff | ||
|
|
4330a1ee7f | ||
|
|
b0f9b8e648 | ||
|
|
cd7b3b254a | ||
|
|
112144dc52 | ||
|
|
1a6a534665 | ||
|
|
c0dc728206 | ||
|
|
febf04841f | ||
|
|
310b29f9c3 | ||
|
|
bd8c6f12e8 | ||
|
|
5276b0e5a2 | ||
|
|
4d7875c555 | ||
|
|
bda2f5b3c9 | ||
|
|
d14ab7c522 | ||
|
|
b9f1bc0fc1 | ||
|
|
ca5f8deefd | ||
|
|
551583398b | ||
|
|
a284bbbee8 | ||
|
|
2aba76ce02 | ||
|
|
dd198064b5 | ||
|
|
1bc9988993 | ||
|
|
890dc0a7cc | ||
|
|
6ec0dc195d | ||
|
|
1e9816d17c | ||
|
|
c7c8e3e072 | ||
|
|
e05b2dba16 | ||
|
|
42414bfd05 | ||
|
|
84908668a0 | ||
|
|
2d0b3c0716 | ||
|
|
8bca3ce0b1 | ||
|
|
2a15679816 | ||
|
|
7358ae6d71 | ||
|
|
f6aab42bba | ||
|
|
eb5a899d5a | ||
|
|
e39c9cff1a | ||
|
|
8082b3847a | ||
|
|
0f6f7a574a | ||
|
|
d5c36ce0c4 | ||
|
|
5b68d1654f | ||
|
|
334e27ed5a | ||
|
|
e1bacb591a | ||
|
|
6a45766acb | ||
|
|
dc0fe7ae1f | ||
|
|
ba46f39418 | ||
|
|
3834d3d121 | ||
|
|
bd9d40dbbd | ||
|
|
3a7b2a15e3 | ||
|
|
913972944b | ||
|
|
bd22dea633 | ||
|
|
cd1e7bb064 | ||
|
|
6db76c6bc7 | ||
|
|
9fdaaecf49 | ||
|
|
76ec335234 | ||
|
|
57eb126416 |
@@ -11,7 +11,7 @@ environment:
|
||||
QT_DOWNLOAD_HASH: '9a8c6eb20967873785057fdcd329a657c7f922b0af08c5fde105cc597dd37e21'
|
||||
QT_LOCAL_PATH: 'C:\Qt5.9.8_x64_static_vs2019'
|
||||
VCPKG_INSTALL_PATH: 'C:\tools\vcpkg\installed'
|
||||
VCPKG_COMMIT_ID: 'f3f329a048eaff759c1992c458f2e12351486bc7'
|
||||
VCPKG_COMMIT_ID: '40230b8e3f6368dcb398d649331be878ca1e9007'
|
||||
install:
|
||||
# Disable zmq test for now since python zmq library on Windows would cause Access violation sometimes.
|
||||
# - cmd: pip install zmq
|
||||
@@ -24,6 +24,7 @@ install:
|
||||
cd c:\tools\vcpkg
|
||||
$env:GIT_REDIRECT_STDERR = '2>&1' # git is writing non-errors to STDERR when doing git pull. Send to STDOUT instead.
|
||||
git pull origin master > $null
|
||||
git checkout $env:VCPKG_COMMIT_ID
|
||||
git -c advice.detachedHead=false checkout $env:VCPKG_COMMIT_ID
|
||||
.\bootstrap-vcpkg.bat > $null
|
||||
Add-Content "C:\tools\vcpkg\triplets\$env:PLATFORM-windows-static.cmake" "set(VCPKG_BUILD_TYPE release)"
|
||||
@@ -54,7 +55,7 @@ build_script:
|
||||
after_build:
|
||||
#- 7z a bitcoin-%APPVEYOR_BUILD_VERSION%.zip %APPVEYOR_BUILD_FOLDER%\build_msvc\%platform%\%configuration%\*.exe
|
||||
test_script:
|
||||
- cmd: src\test_bitcoin.exe -l test_suite
|
||||
- cmd: src\test_bitcoin.exe -k stdout -e stdout 2> NUL
|
||||
- cmd: src\bench_bitcoin.exe -evals=1 -scaling=0 > NUL
|
||||
- ps: python test\util\bitcoin-util-test.py
|
||||
- cmd: python test\util\rpcauth-test.py
|
||||
|
||||
@@ -7,7 +7,7 @@ task:
|
||||
timeout_in: 60m
|
||||
env:
|
||||
MAKEJOBS: "-j9"
|
||||
DANGER_RUN_CI_ON_HOST: "1"
|
||||
RUN_CI_ON_HOST: "1"
|
||||
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
|
||||
CCACHE_SIZE: "200M"
|
||||
CCACHE_DIR: "/tmp/ccache_dir"
|
||||
@@ -15,6 +15,8 @@ task:
|
||||
folder: "/tmp/ccache_dir"
|
||||
depends_built_cache:
|
||||
folder: "/tmp/cirrus-ci-build/depends/built"
|
||||
depends_sdk_cache:
|
||||
folder: "/tmp/cirrus-ci-build/depends/sdk-sources"
|
||||
install_script:
|
||||
- apt-get update
|
||||
- apt-get -y install git bash ccache
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve (use this for suspected bugs only, if not sure, open a regular issue below)
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: Bug
|
||||
assignees: ''
|
||||
|
||||
21
.github/ISSUE_TEMPLATE/good_first_issue.md
vendored
21
.github/ISSUE_TEMPLATE/good_first_issue.md
vendored
@@ -1,21 +0,0 @@
|
||||
---
|
||||
name: Good first issue
|
||||
about: '(Regular devs only): Suggest a new good first issue'
|
||||
title: ''
|
||||
labels: good first issue
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
#### Useful skills:
|
||||
|
||||
<!-- (For example, “C++11 std::thread”, “Qt5 GUI and async GUI design” or “basic understanding of Bitcoin mining and the Bitcoin Core RPC interface”.) -->
|
||||
|
||||
#### Want to work on this issue?
|
||||
|
||||
The purpose of the `good first issue` label is to highlight which issues are suitable for a new contributor without a deep understanding of the codebase.
|
||||
|
||||
You do not need to request permission to start working on this. You are encouraged to comment on the issue if you are planning to work on it. This will help other contributors monitor which issues are actively being addressed and is also an effective way to request assistance if and when you need it.
|
||||
|
||||
For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md) before opening your pull request.
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -7,9 +7,8 @@ src/bitcoind
|
||||
src/bitcoin-cli
|
||||
src/bitcoin-tx
|
||||
src/bitcoin-wallet
|
||||
src/test/fuzz
|
||||
!src/test/fuzz/*.*
|
||||
src/test/test_bitcoin
|
||||
src/test/test_bitcoin_fuzzy
|
||||
src/qt/test/test_bitcoin-qt
|
||||
|
||||
# autoreconf
|
||||
@@ -29,7 +28,6 @@ build-aux/m4/ltversion.m4
|
||||
build-aux/missing
|
||||
build-aux/compile
|
||||
build-aux/test-driver
|
||||
config.cache
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
@@ -90,7 +88,7 @@ src/qt/bitcoin-qt.includes
|
||||
*.qm
|
||||
Makefile
|
||||
!depends/Makefile
|
||||
src/qt/bitcoin-qt
|
||||
bitcoin-qt
|
||||
Bitcoin-Qt.app
|
||||
background.tiff*
|
||||
|
||||
@@ -108,9 +106,6 @@ qrc_*.cpp
|
||||
.DS_Store
|
||||
build
|
||||
|
||||
# Previous releases
|
||||
releases
|
||||
|
||||
#lcov
|
||||
*.gcno
|
||||
*.gcda
|
||||
|
||||
93
.travis.yml
93
.travis.yml
@@ -25,29 +25,23 @@
|
||||
# [1] https://docs.travis-ci.com/user/caching/#build-phases
|
||||
# [2] https://docs.travis-ci.com/user/customizing-the-build#build-timeouts
|
||||
|
||||
version: ~> 1.0
|
||||
|
||||
dist: xenial
|
||||
os: linux
|
||||
language: minimal
|
||||
arch: amd64
|
||||
cache:
|
||||
ccache: true
|
||||
directories:
|
||||
- $TRAVIS_BUILD_DIR/depends/built
|
||||
- $TRAVIS_BUILD_DIR/depends/sdk-sources
|
||||
- $TRAVIS_BUILD_DIR/ci/scratch/.ccache
|
||||
- $TRAVIS_BUILD_DIR/releases/$HOST
|
||||
before_cache:
|
||||
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
|
||||
stages:
|
||||
- lint
|
||||
- test
|
||||
- extended-lint
|
||||
env:
|
||||
global:
|
||||
- CI_RETRY_EXE="travis_retry"
|
||||
- CI_WAIT="while sleep 500; do echo .; done"
|
||||
- CACHE_ERR_MSG="Error! Initial build successful, but not enough time remains to run later build stages and tests. See https://docs.travis-ci.com/user/customizing-the-build#build-timeouts . Please manually re-run this job by using the travis restart button. The next run should not time out because the build cache has been saved."
|
||||
- CACHE_ERR_MSG="Error! Initial build successful, but not enough time remains to run later build stages and tests. Please manually re-run this job by using the travis restart button or asking a bitcoin maintainer to restart. The next run should not time out because the build cache has been saved."
|
||||
before_install:
|
||||
- set -o errexit; source ./ci/test/00_setup_env.sh
|
||||
- set -o errexit; source ./ci/test/03_before_install.sh
|
||||
@@ -81,89 +75,66 @@ jobs:
|
||||
script:
|
||||
- set -o errexit; source ./ci/lint/06_script.sh
|
||||
|
||||
- stage: extended-lint
|
||||
name: 'extended lint [runtime >= 60 seconds]'
|
||||
env:
|
||||
cache: false
|
||||
language: python
|
||||
python: '3.5'
|
||||
install:
|
||||
- set -o errexit; source ./ci/extended_lint/04_install.sh
|
||||
before_script:
|
||||
- set -o errexit; source ./ci/lint/05_before_script.sh
|
||||
script:
|
||||
- set -o errexit; source ./ci/extended_lint/06_script.sh
|
||||
|
||||
- stage: test
|
||||
name: 'ARM [GOAL: install] [buster] [unit tests, functional tests]'
|
||||
arch: arm64 # Can disable QEMU_USER_CMD and run the tests natively without qemu
|
||||
name: 'ARM [GOAL: install] [no unit or functional tests]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_arm.sh"
|
||||
QEMU_USER_CMD=""
|
||||
|
||||
# s390 build was disabled temporarily because of disk space issues on the Travis VM
|
||||
#
|
||||
# - stage: test
|
||||
# name: 'S390x [GOAL: install] [buster] [unit tests, functional tests]'
|
||||
# arch: s390x # Can disable QEMU_USER_CMD and run the tests natively without qemu
|
||||
# env: >-
|
||||
# FILE_ENV="./ci/test/00_setup_env_s390x.sh"
|
||||
# QEMU_USER_CMD=""
|
||||
|
||||
- stage: test
|
||||
name: 'Win64 [GOAL: deploy] [unit tests, no gui, no functional tests]'
|
||||
name: 'Win64 [GOAL: deploy] [no gui or functional tests]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_win64.sh"
|
||||
|
||||
- stage: test
|
||||
name: '32-bit + dash [GOAL: install] [CentOS 7] [gui]'
|
||||
name: '32-bit + dash [GOAL: install] [GUI: BIP70 enabled]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_i686_centos.sh"
|
||||
FILE_ENV="./ci/test/00_setup_env_i686.sh"
|
||||
|
||||
- stage: test
|
||||
name: 'x86_64 Linux [GOAL: install] [bionic] [previous releases, uses qt5 dev package and some depends packages] [unsigned char]'
|
||||
name: 'x86_64 Linux [GOAL: install] [bionic] [uses qt5 dev package instead of depends Qt to speed up build and avoid timeout] [unsigned char]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_native_qt5.sh"
|
||||
FILE_ENV="./ci/test/00_setup_env_amd64_qt5.sh"
|
||||
|
||||
- stage: test
|
||||
name: 'x86_64 Linux [GOAL: install] [trusty] [no functional tests, no depends, only system libs]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_amd64_trusty.sh"
|
||||
|
||||
- stage: test
|
||||
name: 'x86_64 Linux [GOAL: install] [xenial] [no depends, only system libs, sanitizers: thread (TSan), no wallet]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_native_tsan.sh"
|
||||
FILE_ENV="./ci/test/00_setup_env_amd64_tsan.sh"
|
||||
TEST_RUNNER_EXTRA="--exclude feature_block" # Not enough memory on travis machines
|
||||
|
||||
- stage: test
|
||||
name: 'x86_64 Linux [GOAL: install] [bionic] [no depends, only system libs, sanitizers: address/leak (ASan + LSan) + undefined (UBSan) + integer]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_native_asan.sh"
|
||||
FILE_ENV="./ci/test/00_setup_env_amd64_asan.sh"
|
||||
|
||||
- stage: test
|
||||
name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, sanitizers: fuzzer,address,undefined]'
|
||||
name: 'x86_64 Linux [GOAL: install] [bionic] [no depends, only system libs, sanitizers: fuzzer,address,undefined]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_native_fuzz.sh"
|
||||
FILE_ENV="./ci/test/00_setup_env_amd64_fuzz.sh"
|
||||
|
||||
- stage: test
|
||||
name: 'x86_64 Linux [GOAL: install] [bionic] [no wallet]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_native_nowallet.sh"
|
||||
FILE_ENV="./ci/test/00_setup_env_amd64_nowallet.sh"
|
||||
|
||||
- stage: test
|
||||
name: 'macOS 10.12 [GOAL: deploy] [no functional tests]'
|
||||
name: 'macOS 10.10 [GOAL: deploy] [no functional tests]'
|
||||
env: >-
|
||||
FILE_ENV="./ci/test/00_setup_env_mac.sh"
|
||||
|
||||
- stage: test
|
||||
name: 'macOS 10.14 native [GOAL: install] [GUI] [no depends]'
|
||||
os: osx
|
||||
# Use the most recent version:
|
||||
# Xcode 11.3.1, macOS 10.14, SDK 10.15
|
||||
# https://docs.travis-ci.com/user/reference/osx/#macos-version
|
||||
osx_image: xcode11.3
|
||||
cache:
|
||||
directories:
|
||||
- $TRAVIS_BUILD_DIR/ci/scratch/.ccache
|
||||
- $TRAVIS_BUILD_DIR/releases/$HOST
|
||||
- $HOME/Library/Caches/Homebrew
|
||||
- /usr/local/Homebrew
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- libtool
|
||||
- berkeley-db4
|
||||
- boost
|
||||
- miniupnpc
|
||||
- qt
|
||||
- qrencode
|
||||
- python3
|
||||
- ccache
|
||||
- zeromq
|
||||
env: >-
|
||||
DANGER_RUN_CI_ON_HOST=true
|
||||
CI_USE_APT_INSTALL=no
|
||||
FILE_ENV="./ci/test/00_setup_env_mac_host.sh"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[bitcoin.qt-translation-020x]
|
||||
[bitcoin.qt-translation-019x]
|
||||
file_filter = src/qt/locale/bitcoin_<lang>.ts
|
||||
source_file = src/qt/locale/bitcoin_en.ts
|
||||
source_lang = en
|
||||
|
||||
@@ -16,7 +16,7 @@ release cycle, overall merging, moderation and appointment of maintainers.
|
||||
|
||||
If you're looking for somewhere to start contributing, check out the
|
||||
[good first issue](https://github.com/bitcoin/bitcoin/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
|
||||
list or participate in a weekly [Bitcoin Core PR Review Club](https://bitcoincore.reviews/) meeting.
|
||||
list.
|
||||
|
||||
Communication Channels
|
||||
----------------------
|
||||
@@ -46,15 +46,15 @@ facilitates social contribution, easy testing and peer review.
|
||||
|
||||
To contribute a patch, the workflow is as follows:
|
||||
|
||||
1. Fork repository ([only for the first time](https://help.github.com/en/articles/fork-a-repo))
|
||||
1. Fork repository
|
||||
1. Create topic branch
|
||||
1. Commit patches
|
||||
|
||||
The project coding conventions in the [developer notes](doc/developer-notes.md)
|
||||
must be followed.
|
||||
must be adhered to.
|
||||
|
||||
In general, [commits should be atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention)
|
||||
and diffs should be easy to read. For this reason, do not mix any formatting
|
||||
In general [commits should be atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention)
|
||||
and diffs should be easy to read. For this reason do not mix any formatting
|
||||
fixes or code moves with actual code changes.
|
||||
|
||||
Commit messages should be verbose by default consisting of a short subject line
|
||||
@@ -88,10 +88,10 @@ the pull request affects. Valid areas as:
|
||||
- `refactor` for structural changes that do not change behavior
|
||||
- `rpc`, `rest` or `zmq` for changes to the RPC, REST or ZMQ APIs
|
||||
- `script` for changes to the scripts and tools
|
||||
- `test`, `qa` or `ci` for changes to the unit tests, QA tests or CI code
|
||||
- `test` for changes to the bitcoin unit tests or QA tests
|
||||
- `util` or `lib` for changes to the utils or libraries
|
||||
- `wallet` for changes to the wallet code
|
||||
- `build` for changes to the GNU Autotools or reproducible builds
|
||||
- `build` for changes to the GNU Autotools, reproducible builds or CI code
|
||||
|
||||
Examples:
|
||||
|
||||
@@ -100,7 +100,7 @@ Examples:
|
||||
qt: Add feed bump button
|
||||
log: Fix typo in log message
|
||||
|
||||
Note that translations should not be submitted as pull requests. Please see
|
||||
Note that translations should not be submitted as pull requests, please see
|
||||
[Translation Process](https://github.com/bitcoin/bitcoin/blob/master/doc/translation_process.md)
|
||||
for more information on helping with translations.
|
||||
|
||||
@@ -113,16 +113,16 @@ patch does together with any justification/reasoning. You should include
|
||||
references to any discussions (for example other tickets or mailing list
|
||||
discussions).
|
||||
|
||||
At this stage, one should expect comments and review from other contributors. You
|
||||
At this stage one should expect comments and review from other contributors. You
|
||||
can add more commits to your pull request by committing them locally and pushing
|
||||
to your fork until you have satisfied all feedback.
|
||||
|
||||
Note: Code review is a burdensome but important part of the development process, and as such, certain types of pull requests are rejected. In general, if the **improvements** do not warrant the **review effort** required, the PR has a high chance of being rejected. It is up to the PR author to convince the reviewers that the changes warrant the review effort, and if reviewers are "Concept NACK'ing" the PR, the author may need to present arguments and/or do research backing their suggested changes.
|
||||
Note: Code review is a burdensome but important part of the development process, and as such, certain types of pull requests are rejected. In general, if the **improvements** do not warrant the **review effort** required, the PR has a high chance of being rejected. It is up to the PR author to convince the reviewers that the changes warrant the review effort, and if reviewers are "Concept NAK'ing" the PR, the author may need to present arguments and/or do research backing their suggested changes.
|
||||
|
||||
### Squashing Commits
|
||||
|
||||
If your pull request contains fixup commits (commits that change the same line of code repeatedly) or too fine-grained
|
||||
commits, you may be asked to [squash](https://git-scm.com/docs/git-rebase#_interactive_mode) your commits
|
||||
Squashing Commits
|
||||
---------------------------
|
||||
If your pull request is accepted for merging, you may be asked by a maintainer
|
||||
to squash and or [rebase](https://git-scm.com/docs/git-rebase) your commits
|
||||
before it will be merged. The basic squashing workflow is shown below.
|
||||
|
||||
git checkout your_branch_name
|
||||
@@ -133,8 +133,8 @@ before it will be merged. The basic squashing workflow is shown below.
|
||||
# Save and quit.
|
||||
git push -f # (force push to GitHub)
|
||||
|
||||
Please update the resulting commit message if needed. It should read as a
|
||||
coherent message. In most cases, this means that you should not just list the
|
||||
Please update the resulting commit message if needed, it should read as a
|
||||
coherent message. In most cases this means that you should not just list the
|
||||
interim commits.
|
||||
|
||||
If you have problems with squashing (or other workflows with `git`), you can
|
||||
@@ -149,20 +149,6 @@ the respective change set.
|
||||
The length of time required for peer review is unpredictable and will vary from
|
||||
pull request to pull request.
|
||||
|
||||
### Rebasing Changes
|
||||
|
||||
When a pull request conflicts with the target branch, you may be asked to rebase it on top of the current target branch.
|
||||
The `git rebase` command will take care of rebuilding your commits on top of the new base.
|
||||
|
||||
This project aims to have a clean git history, where code changes are only made in non-merge commits. This simplifies
|
||||
auditability because merge commits can be assumed to not contain arbitrary code changes. Merge commits should be signed,
|
||||
and the resulting git tree hash must be deterministic and reproducible. The script in
|
||||
[/contrib/verify-commits](/contrib/verify-commits) checks that.
|
||||
|
||||
After a rebase, reviewers are encouraged to sign off on the force push. This should be relatively straightforward with
|
||||
the `git range-diff` tool explained in the [productivity
|
||||
notes](/doc/productivity.md#diff-the-diffs-with-git-range-diff). To avoid needless review churn, maintainers will
|
||||
generally merge pull requests that received the most review attention first.
|
||||
|
||||
Pull Request Philosophy
|
||||
-----------------------
|
||||
@@ -187,9 +173,9 @@ in the future, they may be removed by the Repository Maintainer.
|
||||
Refactoring is a necessary part of any software project's evolution. The
|
||||
following guidelines cover refactoring pull requests for the project.
|
||||
|
||||
There are three categories of refactoring: code-only moves, code style fixes, and
|
||||
code refactoring. In general, refactoring pull requests should not mix these
|
||||
three kinds of activities in order to make refactoring pull requests easy to
|
||||
There are three categories of refactoring, code only moves, code style fixes,
|
||||
code refactoring. In general refactoring pull requests should not mix these
|
||||
three kinds of activity in order to make refactoring pull requests easy to
|
||||
review and uncontroversial. In all cases, refactoring PRs must not change the
|
||||
behaviour of code within the pull request (bugs must be preserved as is).
|
||||
|
||||
@@ -323,31 +309,6 @@ about:
|
||||
when someone else is asking for feedback on their code, and universe balances out.
|
||||
|
||||
|
||||
Backporting
|
||||
-----------
|
||||
|
||||
Security and bug fixes can be backported from `master` to release
|
||||
branches.
|
||||
If the backport is non-trivial, it may be appropriate to open an
|
||||
additional PR, to backport the change, only after the original PR
|
||||
has been merged.
|
||||
Otherwise, backports will be done in batches and
|
||||
the maintainers will use the proper `Needs backport (...)` labels
|
||||
when needed (the original author does not need to worry).
|
||||
|
||||
A backport should contain the following metadata in the commit body:
|
||||
|
||||
```
|
||||
Github-Pull: #<PR number>
|
||||
Rebased-From: <commit hash of the original commit>
|
||||
```
|
||||
|
||||
Have a look at [an example backport PR](
|
||||
https://github.com/bitcoin/bitcoin/pull/16189).
|
||||
|
||||
Also see the [backport.py script](
|
||||
https://github.com/bitcoin-core/bitcoin-maintainer-tools#backport).
|
||||
|
||||
Release Policy
|
||||
--------------
|
||||
|
||||
|
||||
4
COPYING
4
COPYING
@@ -1,7 +1,7 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2009-2020 The Bitcoin Core developers
|
||||
Copyright (c) 2009-2020 Bitcoin Developers
|
||||
Copyright (c) 2009-2019 The Bitcoin Core developers
|
||||
Copyright (c) 2009-2019 Bitcoin Developers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
62
Makefile.am
62
Makefile.am
@@ -1,11 +1,7 @@
|
||||
# Copyright (c) 2013-2020 The Bitcoin Core developers
|
||||
# Copyright (c) 2013-2016 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
# Pattern rule to print variables, e.g. make print-top_srcdir
|
||||
print-%:
|
||||
@echo $* = $($*)
|
||||
|
||||
ACLOCAL_AMFLAGS = -I build-aux/m4
|
||||
SUBDIRS = src
|
||||
if ENABLE_MAN
|
||||
@@ -25,7 +21,7 @@ BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)
|
||||
BITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)
|
||||
BITCOIN_TX_BIN=$(top_builddir)/src/$(BITCOIN_TX_NAME)$(EXEEXT)
|
||||
BITCOIN_WALLET_BIN=$(top_builddir)/src/$(BITCOIN_WALLET_TOOL_NAME)$(EXEEXT)
|
||||
BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win64-setup$(EXEEXT)
|
||||
BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
|
||||
|
||||
empty :=
|
||||
space := $(empty) $(empty)
|
||||
@@ -41,12 +37,15 @@ OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
|
||||
OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
|
||||
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
|
||||
OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
|
||||
OSX_QT_TRANSLATIONS = ar,bg,ca,cs,da,de,es,fa,fi,fr,gd,gl,he,hu,it,ja,ko,lt,lv,pl,pt,ru,sk,sl,sv,uk,zh_CN,zh_TW
|
||||
|
||||
DIST_CONTRIB = \
|
||||
$(top_srcdir)/contrib/linearize/linearize-data.py \
|
||||
$(top_srcdir)/contrib/linearize/linearize-hashes.py
|
||||
OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
|
||||
|
||||
DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
|
||||
DIST_CONTRIB = $(top_srcdir)/contrib/bitcoin-cli.bash-completion \
|
||||
$(top_srcdir)/contrib/bitcoin-tx.bash-completion \
|
||||
$(top_srcdir)/contrib/bitcoind.bash-completion \
|
||||
$(top_srcdir)/contrib/debian/copyright \
|
||||
$(top_srcdir)/contrib/init \
|
||||
$(top_srcdir)/contrib/install_db4.sh
|
||||
DIST_SHARE = \
|
||||
$(top_srcdir)/share/genbuild.sh \
|
||||
$(top_srcdir)/share/rpcauth
|
||||
@@ -68,7 +67,7 @@ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
|
||||
COVERAGE_INFO = baseline.info \
|
||||
test_bitcoin_filtered.info total_coverage.info \
|
||||
baseline_filtered.info functional_test.info functional_test_filtered.info \
|
||||
test_bitcoin_coverage.info test_bitcoin.info fuzz.info fuzz_coverage.info
|
||||
test_bitcoin_coverage.info test_bitcoin.info
|
||||
|
||||
dist-hook:
|
||||
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
|
||||
@@ -90,7 +89,7 @@ $(OSX_APP)/Contents/PkgInfo:
|
||||
|
||||
$(OSX_APP)/Contents/Resources/empty.lproj:
|
||||
$(MKDIR_P) $(@D)
|
||||
@touch $@
|
||||
@touch $@
|
||||
|
||||
$(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
|
||||
$(MKDIR_P) $(@D)
|
||||
@@ -180,17 +179,7 @@ $(BITCOIN_WALLET_BIN): FORCE
|
||||
$(MAKE) -C src $(@F)
|
||||
|
||||
if USE_LCOV
|
||||
LCOV_FILTER_PATTERN = \
|
||||
-p "/usr/include/" \
|
||||
-p "/usr/lib/" \
|
||||
-p "/usr/lib64/" \
|
||||
-p "src/leveldb/" \
|
||||
-p "src/crc32c/" \
|
||||
-p "src/bench/" \
|
||||
-p "src/univalue" \
|
||||
-p "src/crypto/ctaes" \
|
||||
-p "src/secp256k1" \
|
||||
-p "depends"
|
||||
LCOV_FILTER_PATTERN=-p "/usr/include/" -p "/usr/lib/" -p "src/leveldb/" -p "src/bench/" -p "src/univalue" -p "src/crypto/ctaes" -p "src/secp256k1"
|
||||
|
||||
baseline.info:
|
||||
$(LCOV) -c -i -d $(abs_builddir)/src -o $@
|
||||
@@ -199,15 +188,6 @@ baseline_filtered.info: baseline.info
|
||||
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
|
||||
$(LCOV) -a $@ $(LCOV_OPTS) -o $@
|
||||
|
||||
fuzz.info: baseline_filtered.info
|
||||
@TIMEOUT=15 test/fuzz/test_runner.py qa-assets/fuzz_seed_corpus -l DEBUG
|
||||
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t fuzz-tests -o $@
|
||||
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src
|
||||
|
||||
fuzz_filtered.info: fuzz.info
|
||||
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
|
||||
$(LCOV) -a $@ $(LCOV_OPTS) -o $@
|
||||
|
||||
test_bitcoin.info: baseline_filtered.info
|
||||
$(MAKE) -C src/ check
|
||||
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_bitcoin -o $@
|
||||
@@ -226,19 +206,12 @@ functional_test_filtered.info: functional_test.info
|
||||
$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
|
||||
$(LCOV) -a $@ $(LCOV_OPTS) -o $@
|
||||
|
||||
fuzz_coverage.info: fuzz_filtered.info
|
||||
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a fuzz_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
|
||||
|
||||
test_bitcoin_coverage.info: baseline_filtered.info test_bitcoin_filtered.info
|
||||
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -o $@
|
||||
|
||||
total_coverage.info: test_bitcoin_filtered.info functional_test_filtered.info
|
||||
$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
|
||||
|
||||
fuzz.coverage/.dirstamp: fuzz_coverage.info
|
||||
$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
|
||||
@touch $@
|
||||
|
||||
test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
|
||||
$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
|
||||
@touch $@
|
||||
@@ -247,15 +220,13 @@ total.coverage/.dirstamp: total_coverage.info
|
||||
$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
|
||||
@touch $@
|
||||
|
||||
cov_fuzz: fuzz.coverage/.dirstamp
|
||||
|
||||
cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
|
||||
|
||||
endif
|
||||
|
||||
dist_noinst_SCRIPTS = autogen.sh
|
||||
|
||||
EXTRA_DIST = $(DIST_SHARE) $(DIST_CONTRIB) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
|
||||
EXTRA_DIST = $(DIST_SHARE) $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
|
||||
|
||||
EXTRA_DIST += \
|
||||
test/functional \
|
||||
@@ -310,8 +281,6 @@ EXTRA_DIST += \
|
||||
test/util/data/txcreatescript3.json \
|
||||
test/util/data/txcreatescript4.hex \
|
||||
test/util/data/txcreatescript4.json \
|
||||
test/util/data/txcreatescript5.hex \
|
||||
test/util/data/txcreatescript6.hex \
|
||||
test/util/data/txcreatesignv1.hex \
|
||||
test/util/data/txcreatesignv1.json \
|
||||
test/util/data/txcreatesignv2.hex \
|
||||
@@ -339,6 +308,7 @@ clean-docs:
|
||||
rm -rf doc/doxygen
|
||||
|
||||
clean-local: clean-docs
|
||||
rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ fuzz.coverage/ test/tmp/ cache/ $(OSX_APP)
|
||||
rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
|
||||
rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache share/rpcauth/__pycache__
|
||||
rm -rf osx_volname dist/ dpi36.background.tiff dpi72.background.tiff
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ with no central authority: managing transactions and issuing money are carried
|
||||
out collectively by the network. Bitcoin Core is the name of open source
|
||||
software which enables the use of this currency.
|
||||
|
||||
For more information, as well as an immediately usable, binary version of
|
||||
For more information, as well as an immediately useable, binary version of
|
||||
the Bitcoin Core software, see https://bitcoincore.org/en/download/, or read the
|
||||
[original whitepaper](https://bitcoincore.org/bitcoin.pdf).
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2013-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2013-2016 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C
|
||||
set -e
|
||||
srcdir="$(dirname "$0")"
|
||||
srcdir="$(dirname $0)"
|
||||
cd "$srcdir"
|
||||
if [ -z "${LIBTOOLIZE}" ] && GLIBTOOLIZE="$(command -v glibtoolize)"; then
|
||||
if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="$(command -v glibtoolize)"; then
|
||||
LIBTOOLIZE="${GLIBTOOLIZE}"
|
||||
export LIBTOOLIZE
|
||||
fi
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 48
|
||||
#serial 49
|
||||
|
||||
# example boost program (need to pass version)
|
||||
m4_define([_AX_BOOST_BASE_PROGRAM],
|
||||
@@ -123,12 +123,17 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
|
||||
dnl are almost assuredly the ones desired.
|
||||
AS_CASE([${host_cpu}],
|
||||
[i?86],[multiarch_libsubdir="lib/i386-${host_os}"],
|
||||
[armv7l],[multiarch_libsubdir="lib/arm-${host_os}"],
|
||||
[multiarch_libsubdir="lib/${host_cpu}-${host_os}"]
|
||||
)
|
||||
|
||||
dnl some arches may advertise a cpu type that doesn't line up with their
|
||||
dnl prefix's cpu type. For example, uname may report armv7l while libs are
|
||||
dnl installed to /usr/lib/arm-linux-gnueabihf. Try getting the compiler's
|
||||
dnl value for an extra chance of finding the correct path.
|
||||
libsubdirs="lib/`$CXX -dumpmachine 2>/dev/null` $libsubdirs"
|
||||
|
||||
dnl first we check the system location for boost libraries
|
||||
dnl this location ist chosen if boost libraries are installed with the --layout=system option
|
||||
dnl this location is chosen if boost libraries are installed with the --layout=system option
|
||||
dnl or if you install boost with RPM
|
||||
AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"])
|
||||
|
||||
118
build-aux/m4/ax_boost_chrono.m4
Normal file
118
build-aux/m4/ax_boost_chrono.m4
Normal file
@@ -0,0 +1,118 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_chrono.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_BOOST_CHRONO
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Test for Chrono library from the Boost C++ libraries. The macro requires
|
||||
# a preceding call to AX_BOOST_BASE. Further documentation is available at
|
||||
# <http://randspringer.de/boost/index.html>.
|
||||
#
|
||||
# This macro calls:
|
||||
#
|
||||
# AC_SUBST(BOOST_CHRONO_LIB)
|
||||
#
|
||||
# And sets:
|
||||
#
|
||||
# HAVE_BOOST_CHRONO
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2012 Xiyue Deng <manphiz@gmail.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 5
|
||||
|
||||
AC_DEFUN([AX_BOOST_CHRONO],
|
||||
[
|
||||
AC_ARG_WITH([boost-chrono],
|
||||
AS_HELP_STRING([--with-boost-chrono@<:@=special-lib@:>@],
|
||||
[use the Chrono library from boost - it is possible to specify a certain library for the linker
|
||||
e.g. --with-boost-chrono=boost_chrono-gcc-mt ]),
|
||||
[
|
||||
if test "$withval" = "no"; then
|
||||
want_boost="no"
|
||||
elif test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ax_boost_user_chrono_lib=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ax_boost_user_chrono_lib="$withval"
|
||||
fi
|
||||
],
|
||||
[want_boost="yes"]
|
||||
)
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_BUILD])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
|
||||
export LDFLAGS
|
||||
|
||||
AC_CACHE_CHECK(whether the Boost::Chrono library is available,
|
||||
ax_cv_boost_chrono,
|
||||
[AC_LANG_PUSH([C++])
|
||||
CXXFLAGS_SAVE=$CXXFLAGS
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/chrono.hpp>]],
|
||||
[[boost::chrono::system_clock::time_point* time = new boost::chrono::system_clock::time_point; delete time;]])],
|
||||
ax_cv_boost_chrono=yes, ax_cv_boost_chrono=no)
|
||||
CXXFLAGS=$CXXFLAGS_SAVE
|
||||
AC_LANG_POP([C++])
|
||||
])
|
||||
if test "x$ax_cv_boost_chrono" = "xyes"; then
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
|
||||
AC_DEFINE(HAVE_BOOST_CHRONO,,[define if the Boost::Chrono library is available])
|
||||
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
|
||||
|
||||
LDFLAGS_SAVE=$LDFLAGS
|
||||
if test "x$ax_boost_user_chrono_lib" = "x"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/libboost_chrono*.so* $BOOSTLIBDIR/libboost_chrono*.dylib* $BOOSTLIBDIR/libboost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_chrono.*\)\.so.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break],
|
||||
[link_chrono="no"])
|
||||
done
|
||||
if test "x$link_chrono" != "xyes"; then
|
||||
for libextension in `ls $BOOSTLIBDIR/boost_chrono*.dll* $BOOSTLIBDIR/boost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_chrono.*\)\.dll.*$;\1;' -e 's;^\(boost_chrono.*\)\.a.*$;\1;'` ; do
|
||||
ax_lib=${libextension}
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break],
|
||||
[link_chrono="no"])
|
||||
done
|
||||
fi
|
||||
|
||||
else
|
||||
for ax_lib in $ax_boost_user_chrono_lib boost_chrono-$ax_boost_user_chrono_lib; do
|
||||
AC_CHECK_LIB($ax_lib, exit,
|
||||
[BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break],
|
||||
[link_chrono="no"])
|
||||
done
|
||||
|
||||
fi
|
||||
if test "x$ax_lib" = "x"; then
|
||||
AC_MSG_ERROR(Could not find a version of the Boost::Chrono library!)
|
||||
fi
|
||||
if test "x$link_chrono" = "xno"; then
|
||||
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
fi
|
||||
])
|
||||
@@ -116,10 +116,8 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
|
||||
if test "x$bitcoin_cv_static_qt" = xyes; then
|
||||
_BITCOIN_QT_FIND_STATIC_PLUGINS
|
||||
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
|
||||
if test "x$TARGET_OS" != xandroid; then
|
||||
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal])
|
||||
AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists])
|
||||
fi
|
||||
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal])
|
||||
AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists])
|
||||
if test "x$TARGET_OS" = xwindows; then
|
||||
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows])
|
||||
AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])
|
||||
@@ -130,9 +128,6 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
|
||||
AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)])
|
||||
_BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa])
|
||||
AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa])
|
||||
elif test "x$TARGET_OS" = xandroid; then
|
||||
QT_LIBS="-Wl,--export-dynamic,--undefined=JNI_OnLoad -lqtforandroid -ljnigraphics -landroid -lqtfreetype -lQt5EglSupport $QT_LIBS"
|
||||
AC_DEFINE(QT_QPA_PLATFORM_ANDROID, 1, [Define this symbol if the qt platform is android])
|
||||
fi
|
||||
fi
|
||||
CPPFLAGS=$TEMP_CPPFLAGS
|
||||
@@ -350,9 +345,6 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
|
||||
if test -d "$qt_plugin_path/accessible"; then
|
||||
QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
|
||||
fi
|
||||
if test -d "$qt_plugin_path/platforms/android"; then
|
||||
QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL"
|
||||
fi
|
||||
if test "x$use_pkgconfig" = xyes; then
|
||||
: dnl
|
||||
m4_ifdef([PKG_CHECK_MODULES],[
|
||||
|
||||
14
build_msvc/.gitignore
vendored
14
build_msvc/.gitignore
vendored
@@ -8,19 +8,7 @@ packages/*
|
||||
*/Release
|
||||
*/x64
|
||||
*.vcxproj.user
|
||||
|
||||
# .vcxproj files that are auto-generated by the msvc-autogen.py script.
|
||||
libbitcoin_cli/libbitcoin_cli.vcxproj
|
||||
libbitcoin_common/libbitcoin_common.vcxproj
|
||||
libbitcoin_crypto/libbitcoin_crypto.vcxproj
|
||||
libbitcoin_server/libbitcoin_server.vcxproj
|
||||
libbitcoin_util/libbitcoin_util.vcxproj
|
||||
libbitcoin_wallet_tool/libbitcoin_wallet_tool.vcxproj
|
||||
libbitcoin_wallet/libbitcoin_wallet.vcxproj
|
||||
libbitcoin_zmq/libbitcoin_zmq.vcxproj
|
||||
bench_bitcoin/bench_bitcoin.vcxproj
|
||||
libtest_util/libtest_util.vcxproj
|
||||
|
||||
*.vcxproj
|
||||
*/Win32
|
||||
libbitcoin_qt/QtGeneratedFiles/*
|
||||
test_bitcoin-qt/QtGeneratedFiles/*
|
||||
|
||||
@@ -12,8 +12,7 @@ Quick Start
|
||||
The minimal steps required to build Bitcoin Core with the msbuild toolchain are below. More detailed instructions are contained in the following sections.
|
||||
|
||||
```
|
||||
vcpkg install --triplet x64-windows-static berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent[thread] zeromq double-conversion
|
||||
vcpkg integrate install
|
||||
vcpkg install --triplet x64-windows-static boost-filesystem boost-signals2 boost-test libevent openssl zeromq berkeleydb rapidcheck double-conversion
|
||||
py -3 build_msvc\msvc-autogen.py
|
||||
msbuild /m build_msvc\bitcoin.sln /p:Platform=x64 /p:Configuration=Release /t:build
|
||||
```
|
||||
@@ -34,18 +33,24 @@ The [external dependencies](https://github.com/bitcoin/bitcoin/blob/master/doc/d
|
||||
- Boost
|
||||
- DoubleConversion
|
||||
- libevent
|
||||
- OpenSSL
|
||||
- Qt5
|
||||
- RapidCheck
|
||||
- ZeroMQ
|
||||
|
||||
Qt
|
||||
---------------------
|
||||
In order to build the Bitcoin Core a static build of Qt is required. The runtime library version (e.g. v141, v142) and platform type (x86 or x64) must also match.
|
||||
All the Bitcoin Core applications are configured to build with static linking. In order to build the Bitcoin Core Qt applications a static build of Qt is required.
|
||||
|
||||
Some prebuilt x64 versions of Qt can be downloaded from [here](https://github.com/sipsorcery/qt_win_binary/releases). Please be aware these downloads are NOT officially sanctioned by Bitcoin Core and are provided for developer convenience only. They should NOT be used for builds that will be used in a production environment or with real funds.
|
||||
The runtime library version (e.g. v141, v142) and platform type (x86 or x64) must also match. OpenSSL must also be linked into the Qt binaries in order to provide full functionality of the Bitcoin Core Qt programs. An example of the configure command to build Qtv5.9.7 locally to link with Bitcoin Core is shown below (adjust paths accordingly), note it can be expected that the configure and subsequent build will fail numerous times until dependency issues are resolved.
|
||||
|
||||
To determine which Qt prebuilt version to download open the `.appveyor.yml` file and note the `QT_DOWNLOAD_URL`. When extracting the zip file the destination path must be set to `C:\`. This is due to the way that Qt includes, libraries and tools use internal paths.
|
||||
````
|
||||
..\Qtv5.9.7_src\configure -developer-build -confirm-license -debug-and-release -opensource -platform win32-msvc -opengl desktop -no-shared -static -no-static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -ltcg -make libs -make tools -no-libjpeg -nomake examples -no-compile-examples -no-dbus -no-libudev -no-qml-debug -no-icu -no-gtk -no-opengles3 -no-angle -no-sql-sqlite -no-sql-odbc -no-sqlite -no-libudev -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -nomake tests -openssl-linked -IC:\Dev\github\vcpkg\installed\x64-windows-static\include -LC:\Dev\github\vcpkg\installed\x64-windows-static\lib OPENSSL_LIBS="-llibeay32 -lssleay32 -lgdi32 -luser32 -lwsock32 -ladvapi32" -prefix C:\Qt5.9.7_ssl_x64_static_vs2017
|
||||
````
|
||||
|
||||
To build Bitcoin Core without Qt unload or disable the `bitcoin-qt`, `libbitcoin_qt` and `test_bitcoin-qt` projects.
|
||||
A prebuilt version for x64 and Visual C++ runtime v141 (Visual Studio 2017) can be downloaded from [here](https://github.com/sipsorcery/qt_win_binary/releases). Please be aware this download is NOT an officially sanctioned Bitcoin Core distribution and is provided for developer convenience. It should NOT be used for builds that will be used in a production environment or with real funds.
|
||||
|
||||
To build Bitcoin Core without Qt unload or disable the bitcoin-qt, libbitcoin_qt and test_bitcoin-qt projects.
|
||||
|
||||
Building
|
||||
---------------------
|
||||
@@ -56,31 +61,29 @@ The instructions below use `vcpkg` to install the dependencies.
|
||||
|
||||
```
|
||||
PS >.\vcpkg install --triplet x64-windows-static $(Get-Content -Path build_msvc\vcpkg-packages.txt).split()
|
||||
PS >.\vcpkg integrate install
|
||||
```
|
||||
|
||||
- Use Python to generate `*.vcxproj` from Makefile
|
||||
|
||||
```
|
||||
PS >py -3 msvc-autogen.py
|
||||
|
||||
- Use Python to generate *.vcxproj from Makefile
|
||||
|
||||
```
|
||||
PS >py -3 msvc-autogen.py
|
||||
```
|
||||
|
||||
- An optional step is to adjust the settings in the build_msvc directory and the common.init.vcxproj file. This project file contains settings that are common to all projects such as the runtime library version and target Windows SDK version. The Qt directories can also be set.
|
||||
|
||||
- To build from the command line with the Visual Studio 2017 toolchain use:
|
||||
- Build with Visual Studio 2017 or msbuild.
|
||||
|
||||
```
|
||||
msbuild /m bitcoin.sln /p:Platform=x64 /p:Configuration=Release /p:PlatformToolset=v141 /t:build
|
||||
```
|
||||
|
||||
- To build from the command line with the Visual Studio 2019 toolchain use:
|
||||
- Build with Visual Studio 2019 or msbuild.
|
||||
|
||||
```
|
||||
msbuild /m bitcoin.sln /p:Platform=x64 /p:Configuration=Release /t:build
|
||||
```
|
||||
|
||||
- Alternatively open the `build_msvc\bitcoin.sln` file in Visual Studio.
|
||||
|
||||
AppVeyor
|
||||
---------------------
|
||||
The .appveyor.yml in the root directory is suitable to perform builds on [AppVeyor](https://www.appveyor.com/) Continuous Integration servers. The simplest way to perform an AppVeyor build is to fork Bitcoin Core and then configure a new AppVeyor Project pointing to the forked repository.
|
||||
|
||||
@@ -42,9 +42,6 @@
|
||||
<ProjectReference Include="..\libleveldb\libleveldb.vcxproj">
|
||||
<Project>{18430fef-6b61-4c53-b396-718e02850f1b}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libtest_util\libtest_util.vcxproj">
|
||||
<Project>{1e065f03-3566-47d0-8fa9-daa72b084e7d}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Target Name="RawBenchHeaderGen" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(QtIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
@@ -64,7 +64,7 @@
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(QtIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
|
||||
@@ -44,10 +44,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_qt", "libbitcoin
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-qt", "bitcoin-qt\bitcoin-qt.vcxproj", "{7E99172D-7FF2-4CB6-B736-AC9B76ED412A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtest_util", "libtest_util\libtest_util.vcxproj", "{868474FD-35F6-4400-8EED-30A33E7521D4}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_bitcoin-qt", "test_bitcoin-qt\test_bitcoin-qt.vcxproj", "{51201D5E-D939-4854-AE9D-008F03FF518E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@@ -224,29 +220,11 @@ Global
|
||||
{7E99172D-7FF2-4CB6-B736-AC9B76ED412A}.Release|x64.Build.0 = Release|x64
|
||||
{7E99172D-7FF2-4CB6-B736-AC9B76ED412A}.Release|x86.ActiveCfg = Release|Win32
|
||||
{7E99172D-7FF2-4CB6-B736-AC9B76ED412A}.Release|x86.Build.0 = Release|Win32
|
||||
{868474FD-35F6-4400-8EED-30A33E7521D4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{868474FD-35F6-4400-8EED-30A33E7521D4}.Debug|x64.Build.0 = Debug|x64
|
||||
{868474FD-35F6-4400-8EED-30A33E7521D4}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{868474FD-35F6-4400-8EED-30A33E7521D4}.Debug|x86.Build.0 = Debug|Win32
|
||||
{868474FD-35F6-4400-8EED-30A33E7521D4}.Release|x64.ActiveCfg = Release|x64
|
||||
{868474FD-35F6-4400-8EED-30A33E7521D4}.Release|x64.Build.0 = Release|x64
|
||||
{868474FD-35F6-4400-8EED-30A33E7521D4}.Release|x86.ActiveCfg = Release|Win32
|
||||
{868474FD-35F6-4400-8EED-30A33E7521D4}.Release|x86.Build.0 = Release|Win32
|
||||
{51201D5E-D939-4854-AE9D-008F03FF518E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{51201D5E-D939-4854-AE9D-008F03FF518E}.Debug|x64.Build.0 = Debug|x64
|
||||
{51201D5E-D939-4854-AE9D-008F03FF518E}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{51201D5E-D939-4854-AE9D-008F03FF518E}.Debug|x86.Build.0 = Debug|Win32
|
||||
{51201D5E-D939-4854-AE9D-008F03FF518E}.Release|x64.ActiveCfg = Release|x64
|
||||
{51201D5E-D939-4854-AE9D-008F03FF518E}.Release|x64.Build.0 = Release|x64
|
||||
{51201D5E-D939-4854-AE9D-008F03FF518E}.Release|x86.ActiveCfg = Release|Win32
|
||||
{51201D5E-D939-4854-AE9D-008F03FF518E}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8AA72EDA-2CD4-4564-B1E4-688B760EEEE9}
|
||||
SolutionGuid = {8607C0F4-F33D-41B8-8D51-18E366A0F8DF}
|
||||
SolutionGuid = {58AAB032-7274-49BD-845E-5EF4DBB69B70}
|
||||
SolutionGuid = {8AA72EDA-2CD4-4564-B1E4-688B760EEEE9}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
// Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef BITCOIN_BITCOIN_CONFIG_H
|
||||
#define BITCOIN_BITCOIN_CONFIG_H
|
||||
|
||||
@@ -18,7 +14,7 @@
|
||||
#define CLIENT_VERSION_MAJOR 0
|
||||
|
||||
/* Minor version */
|
||||
#define CLIENT_VERSION_MINOR 20
|
||||
#define CLIENT_VERSION_MINOR 19
|
||||
|
||||
/* Build revision */
|
||||
#define CLIENT_VERSION_REVISION 2
|
||||
@@ -47,9 +43,15 @@
|
||||
/* define if the Boost library is available */
|
||||
#define HAVE_BOOST /**/
|
||||
|
||||
/* define if the Boost::Chrono library is available */
|
||||
#define HAVE_BOOST_CHRONO /**/
|
||||
|
||||
/* define if the Boost::Filesystem library is available */
|
||||
#define HAVE_BOOST_FILESYSTEM /**/
|
||||
|
||||
/* define if the Boost::PROGRAM_OPTIONS library is available */
|
||||
#define HAVE_BOOST_PROGRAM_OPTIONS /**/
|
||||
|
||||
/* define if the Boost::System library is available */
|
||||
#define HAVE_BOOST_SYSTEM /**/
|
||||
|
||||
@@ -96,6 +98,10 @@
|
||||
*/
|
||||
#define HAVE_DECL_DAEMON 0
|
||||
|
||||
/* Define to 1 if you have the declaration of `EVP_MD_CTX_new', and to 0 if
|
||||
you don't. */
|
||||
//#define HAVE_DECL_EVP_MD_CTX_NEW 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `htobe16', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_HTOBE16 0
|
||||
@@ -177,6 +183,75 @@
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the `advapi32' library (-ladvapi32). */
|
||||
#define HAVE_LIBADVAPI32 1
|
||||
|
||||
/* Define to 1 if you have the `comctl32' library (-lcomctl32). */
|
||||
#define HAVE_LIBCOMCTL32 1
|
||||
|
||||
/* Define to 1 if you have the `comdlg32' library (-lcomdlg32). */
|
||||
#define HAVE_LIBCOMDLG32 1
|
||||
|
||||
/* Define to 1 if you have the `crypt32' library (-lcrypt32). */
|
||||
#define HAVE_LIBCRYPT32 1
|
||||
|
||||
/* Define to 1 if you have the `gdi32' library (-lgdi32). */
|
||||
#define HAVE_LIBGDI32 1
|
||||
|
||||
/* Define to 1 if you have the `imm32' library (-limm32). */
|
||||
#define HAVE_LIBIMM32 1
|
||||
|
||||
/* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */
|
||||
#define HAVE_LIBIPHLPAPI 1
|
||||
|
||||
/* Define to 1 if you have the `kernel32' library (-lkernel32). */
|
||||
#define HAVE_LIBKERNEL32 1
|
||||
|
||||
/* Define to 1 if you have the `mingwthrd' library (-lmingwthrd). */
|
||||
#define HAVE_LIBMINGWTHRD 1
|
||||
|
||||
/* Define to 1 if you have the `mswsock' library (-lmswsock). */
|
||||
#define HAVE_LIBMSWSOCK 1
|
||||
|
||||
/* Define to 1 if you have the `ole32' library (-lole32). */
|
||||
#define HAVE_LIBOLE32 1
|
||||
|
||||
/* Define to 1 if you have the `oleaut32' library (-loleaut32). */
|
||||
#define HAVE_LIBOLEAUT32 1
|
||||
|
||||
/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */
|
||||
#define HAVE_LIBRPCRT4 1
|
||||
|
||||
/* Define to 1 if you have the `rt' library (-lrt). */
|
||||
/* #undef HAVE_LIBRT */
|
||||
|
||||
/* Define to 1 if you have the `shell32' library (-lshell32). */
|
||||
#define HAVE_LIBSHELL32 1
|
||||
|
||||
/* Define to 1 if you have the `shlwapi' library (-lshlwapi). */
|
||||
#define HAVE_LIBSHLWAPI 1
|
||||
|
||||
/* Define to 1 if you have the `ssp' library (-lssp). */
|
||||
#define HAVE_LIBSSP 1
|
||||
|
||||
/* Define to 1 if you have the `user32' library (-luser32). */
|
||||
#define HAVE_LIBUSER32 1
|
||||
|
||||
/* Define to 1 if you have the `uuid' library (-luuid). */
|
||||
#define HAVE_LIBUUID 1
|
||||
|
||||
/* Define to 1 if you have the `winmm' library (-lwinmm). */
|
||||
#define HAVE_LIBWINMM 1
|
||||
|
||||
/* Define to 1 if you have the `winspool' library (-lwinspool). */
|
||||
#define HAVE_LIBWINSPOOL 1
|
||||
|
||||
/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
|
||||
#define HAVE_LIBWS2_32 1
|
||||
|
||||
/* Define to 1 if you have the `z ' library (-lz ). */
|
||||
#define HAVE_LIBZ_ 1
|
||||
|
||||
/* Define this symbol if you have malloc_info */
|
||||
/* #undef HAVE_MALLOC_INFO */
|
||||
|
||||
@@ -255,6 +330,12 @@
|
||||
/* Define if the visibility attribute is supported. */
|
||||
#define HAVE_VISIBILITY_ATTRIBUTE 1
|
||||
|
||||
/* Define this symbol if boost sleep works */
|
||||
/* #undef HAVE_WORKING_BOOST_SLEEP */
|
||||
|
||||
/* Define this symbol if boost sleep_for works */
|
||||
#define HAVE_WORKING_BOOST_SLEEP_FOR 1
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
@@ -265,7 +346,7 @@
|
||||
#define PACKAGE_NAME "Bitcoin Core"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "Bitcoin Core 0.20.2"
|
||||
#define PACKAGE_STRING "Bitcoin Core 0.19.2"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "bitcoin"
|
||||
@@ -274,7 +355,7 @@
|
||||
#define PACKAGE_URL "https://bitcoincore.org/"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "0.20.2"
|
||||
#define PACKAGE_VERSION "0.19.2"
|
||||
|
||||
/* Define to necessary symbol if this constant uses a non-standard name on
|
||||
your system. */
|
||||
@@ -304,6 +385,9 @@
|
||||
/* Define this symbol to build in assembly routines */
|
||||
//#define USE_ASM 1
|
||||
|
||||
/* Define this symbol if coverage is enabled */
|
||||
/* #undef USE_COVERAGE */
|
||||
|
||||
/* Define if dbus support should be compiled in */
|
||||
/* #undef USE_DBUS */
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<VcpkgTriplet Condition="'$(Platform)'=='Win32'">x86-windows-static</VcpkgTriplet>
|
||||
<VcpkgTriplet Condition="'$(Platform)'=='x64'">x64-windows-static</VcpkgTriplet>
|
||||
<UseNativeEnvironment>true</UseNativeEnvironment>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' and !Exists('$(WindowsSdkDir)\DesignTime\CommonConfiguration\Neutral\Windows.props')">
|
||||
@@ -116,7 +115,7 @@
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>crypt32.lib;Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<Lib>
|
||||
<AdditionalOptions>/ignore:4221</AdditionalOptions>
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
<ClCompile Include="..\..\src\leveldb\db\version_set.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\db\write_batch.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\helpers\memenv\memenv.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\port\port_posix_sse.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\port\port_win.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\table\block.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\table\block_builder.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\table\filter_block.cc" />
|
||||
@@ -40,7 +42,7 @@
|
||||
<ClCompile Include="..\..\src\leveldb\util\comparator.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\util\crc32c.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\util\env.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\util\env_windows.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\util\env_win.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\util\filter_policy.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\util\hash.cc" />
|
||||
<ClCompile Include="..\..\src\leveldb\util\histogram.cc" />
|
||||
@@ -49,11 +51,11 @@
|
||||
<ClCompile Include="..\..\src\leveldb\util\status.cc" />
|
||||
</ItemGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>HAVE_CRC32C=0;HAVE_SNAPPY=0;__STDC_LIMIT_MACROS;LEVELDB_IS_BIG_ENDIAN=0;_UNICODE;UNICODE;_CRT_NONSTDC_NO_DEPRECATE;LEVELDB_PLATFORM_WINDOWS;LEVELDB_ATOMIC_PRESENT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<DisableSpecificWarnings>4244;4267;4312;4722;</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>..\..\src\leveldb;..\..\src\leveldb\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;LEVELDB_PLATFORM_WINDOWS;LEVELDB_ATOMIC_PRESENT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<DisableSpecificWarnings>4244;4267;4312;</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>..\..\src\leveldb;..\..\src\leveldb\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\common.init.vcxproj" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{868474FD-35F6-4400-8EED-30A33E7521D4}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@SOURCE_FILES@
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<Import Project="..\common.vcxproj" />
|
||||
</Project>
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2016-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
import os
|
||||
import re
|
||||
@@ -21,7 +18,6 @@ libs = [
|
||||
'libbitcoin_wallet',
|
||||
'libbitcoin_zmq',
|
||||
'bench_bitcoin',
|
||||
'libtest_util',
|
||||
]
|
||||
|
||||
ignore_list = [
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\common.init.vcxproj" />
|
||||
<Import Project="..\common.qt.init.vcxproj" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{51201D5E-D939-4854-AE9D-008F03FF518E}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\test\util\setup_common.cpp" />
|
||||
<ClCompile Include="..\..\src\test\setup_common.cpp" />
|
||||
<ClCompile Include="..\..\src\qt\test\addressbooktests.cpp" />
|
||||
<ClCompile Include="..\..\src\qt\test\apptests.cpp" />
|
||||
<ClCompile Include="..\..\src\qt\test\compattests.cpp" />
|
||||
@@ -64,32 +66,29 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\libbitcoin_qt\$(GeneratedFilesOutDir)\..\;$(QtIncludeDir)\QtTest;$(QtIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(QtLibraryDir)\Qt5Test.lib;$(QtReleaseLibraries);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>/ignore:4206</AdditionalOptions>
|
||||
<AdditionalDependencies>$(QtReleaseLibaries);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\libbitcoin_qt\$(GeneratedFilesOutDir)\..\;$(QtIncludeDir)\QtTest;$(QtIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(QtDebugLibraries);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>/ignore:4206</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<MocTestFiles Include="..\..\src\qt\test\addressbooktests.h" />
|
||||
<MocTestFiles Include="..\..\src\qt\test\apptests.h" />
|
||||
<MocTestFiles Include="..\..\src\qt\test\compattests.h" />
|
||||
<MocTestFiles Include="..\..\src\qt\test\paymentservertests.h" />
|
||||
<MocTestFiles Include="..\..\src\qt\test\rpcnestedtests.h" />
|
||||
<MocTestFiles Include="..\..\src\qt\test\uritests.h" />
|
||||
<MocTestFiles Include="..\..\src\qt\test\wallettests.h" />
|
||||
@@ -107,6 +106,8 @@
|
||||
<RemoveDir Directories="$(GeneratedFilesOutDir)\moc\*" />
|
||||
<RemoveDir Directories="$(GeneratedFilesOutDir)\moc" />
|
||||
</Target>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<PropertyGroup>
|
||||
<BuildDependsOn>
|
||||
moccode;
|
||||
@@ -119,4 +120,4 @@
|
||||
$(CleanDependsOn);
|
||||
</CleanDependsOn>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\test\*_properties.cpp" />
|
||||
<ClCompile Include="..\..\src\test\*_tests.cpp" />
|
||||
<ClCompile Include="..\..\src\test\*_properties.cpp" />
|
||||
<ClCompile Include="..\..\src\test\gen\*_gen.cpp" />
|
||||
<ClCompile Include="..\..\src\test\main.cpp" />
|
||||
<ClCompile Include="..\..\src\test\util\*.cpp" />
|
||||
<ClCompile Include="..\..\src\wallet\test\*_fixture.cpp" />
|
||||
<ClCompile Include="..\..\src\wallet\test\*_tests.cpp" />
|
||||
<ClCompile Include="..\..\src\test\setup_common.cpp" />
|
||||
<ClCompile Include="..\..\src\test\main.cpp" />
|
||||
<ClCompile Include="..\..\src\wallet\test\*_fixture.cpp" />
|
||||
<ClCompile Include="..\..\src\test\util\*.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\libbitcoinconsensus\libbitcoinconsensus.vcxproj">
|
||||
@@ -42,9 +43,6 @@
|
||||
<ProjectReference Include="..\libbitcoin_zmq\libbitcoin_zmq.vcxproj">
|
||||
<Project>{792d487f-f14c-49fc-a9de-3fc150f31c3f}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libtest_util\libtest_util.vcxproj">
|
||||
<Project>{1e065f03-3566-47d0-8fa9-daa72b084e7d}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\libunivalue\libunivalue.vcxproj">
|
||||
<Project>{5724ba7d-a09a-4ba8-800b-c4c1561b3d69}</Project>
|
||||
</ProjectReference>
|
||||
@@ -61,9 +59,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<JsonTestFile Include="..\..\src\test\data\*.json" />
|
||||
<RawTestFile Include="..\..\src\test\data\*.raw" />
|
||||
</ItemGroup>
|
||||
<HeaderFromHexdump RawFilePath="%(RawTestFile.FullPath)" HeaderFilePath="%(RawTestFile.FullPath).h" SourceHeader="static unsigned const char %(RawTestFile.Filename)_raw[] = {" SourceFooter="};" />
|
||||
<HeaderFromHexdump RawFilePath="%(JsonTestFile.FullPath)" HeaderFilePath="%(JsonTestFile.FullPath).h" SourceHeader="namespace json_tests{ static unsigned const char %(JsonTestFile.Filename)[] = {" SourceFooter="};}" />
|
||||
</Target>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
// Copyright (c) 2018 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// bitcoin includes.
|
||||
|
||||
@@ -1 +1 @@
|
||||
berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent[thread] zeromq double-conversion
|
||||
berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent openssl rapidcheck zeromq double-conversion
|
||||
15
ci/README.md
15
ci/README.md
@@ -8,21 +8,11 @@ and numbered according to which stage and lifecycle step it belongs to.
|
||||
|
||||
### Running a stage locally
|
||||
|
||||
Be aware that the tests will be built and run in-place, so please run at your own risk.
|
||||
If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first.
|
||||
|
||||
The ci needs to perform various sysadmin tasks such as installing packages or writing to the user's home directory.
|
||||
While most of the actions are done inside a docker container, this is not possible for all. Thus, cache directories,
|
||||
such as the depends cache, previous release binaries, or ccache, are mounted as read-write into the docker container. While it should be fine to run
|
||||
the ci system locally on you development box, the ci scripts can generally be assumed to have received less review and
|
||||
testing compared to other parts of the codebase. If you want to keep the work tree clean, you might want to run the ci
|
||||
system in a virtual machine with a Linux operating system of your choice.
|
||||
|
||||
To allow for a wide range of tested environments, but also ensure reproducibility to some extent, the test stage
|
||||
requires `docker` to be installed. To install all requirements on Ubuntu, run
|
||||
|
||||
```
|
||||
sudo apt install docker.io bash
|
||||
sudo apt install docker.io ccache bash git
|
||||
```
|
||||
|
||||
To run the default test stage,
|
||||
@@ -36,3 +26,6 @@ To run the test stage with a specific configuration,
|
||||
```
|
||||
FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh
|
||||
```
|
||||
|
||||
Be aware that the tests will be build and run in-place, so please run at your own risk.
|
||||
If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first.
|
||||
|
||||
12
ci/extended_lint/04_install.sh
Executable file
12
ci/extended_lint/04_install.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
CPPCHECK_VERSION=1.86
|
||||
curl -s https://codeload.github.com/danmar/cppcheck/tar.gz/${CPPCHECK_VERSION} | tar -zxf - --directory /tmp/
|
||||
(cd /tmp/cppcheck-${CPPCHECK_VERSION}/ && make CFGDIR=/tmp/cppcheck-${CPPCHECK_VERSION}/cfg/ > /dev/null)
|
||||
export PATH="$PATH:/tmp/cppcheck-${CPPCHECK_VERSION}/"
|
||||
9
ci/extended_lint/06_script.sh
Executable file
9
ci/extended_lint/06_script.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
test/lint/extended-lint-all.sh
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -8,7 +8,6 @@ export LC_ALL=C
|
||||
|
||||
travis_retry pip3 install codespell==1.15.0
|
||||
travis_retry pip3 install flake8==3.7.8
|
||||
travis_retry pip3 install yq
|
||||
|
||||
SHELLCHECK_VERSION=v0.6.0
|
||||
curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -14,7 +14,6 @@ test/lint/git-subtree-check.sh src/crypto/ctaes
|
||||
test/lint/git-subtree-check.sh src/secp256k1
|
||||
test/lint/git-subtree-check.sh src/univalue
|
||||
test/lint/git-subtree-check.sh src/leveldb
|
||||
test/lint/git-subtree-check.sh src/crc32c
|
||||
test/lint/check-doc.py
|
||||
test/lint/check-rpc-mappings.py .
|
||||
test/lint/lint-all.sh
|
||||
|
||||
@@ -32,8 +32,8 @@ Help:
|
||||
-v, --verbose Verbose output
|
||||
-t, --tries=# Set max retries: Default 10
|
||||
-s, --sleep=secs Constant sleep amount (seconds)
|
||||
-m, --min=secs Exponential Backoff: minimum sleep amount (seconds): Default 0.3
|
||||
-x, --max=secs Exponential Backoff: maximum sleep amount (seconds): Default 60
|
||||
-m, --min=secs Exponenetial Backoff: minimum sleep amount (seconds): Default 0.3
|
||||
-x, --max=secs Exponenetial Backoff: maximum sleep amount (seconds): Default 60
|
||||
-f, --fail="script +cmds" Fail Script: run in case of final failure
|
||||
|
||||
### Examples
|
||||
|
||||
@@ -17,7 +17,7 @@ __log_out() {
|
||||
echo "$1" 1>&2
|
||||
}
|
||||
|
||||
# Parameters: max_tries min_sleep max_sleep constant_sleep fail_script EXECUTION_COMMAND
|
||||
# Paramters: max_tries min_sleep max_sleep constant_sleep fail_script EXECUTION_COMMAND
|
||||
retry()
|
||||
{
|
||||
local max_tries="$1"; shift
|
||||
@@ -83,8 +83,8 @@ Usage: $retry [options] -- execute command
|
||||
-v, --verbose Verbose output
|
||||
-t, --tries=# Set max retries: Default 10
|
||||
-s, --sleep=secs Constant sleep amount (seconds)
|
||||
-m, --min=secs Exponential Backoff: minimum sleep amount (seconds): Default 0.3
|
||||
-x, --max=secs Exponential Backoff: maximum sleep amount (seconds): Default 60
|
||||
-m, --min=secs Exponenetial Backoff: minimum sleep amount (seconds): Default 0.3
|
||||
-x, --max=secs Exponenetial Backoff: maximum sleep amount (seconds): Default 60
|
||||
-f, --fail="script +cmds" Fail Script: run in case of final failure
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -6,12 +6,6 @@
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
# The root dir.
|
||||
# The ci system copies this folder.
|
||||
# This is where the build is done (depends and dist).
|
||||
BASE_ROOT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ >/dev/null 2>&1 && pwd )
|
||||
export BASE_ROOT_DIR
|
||||
|
||||
echo "Setting specific values in env"
|
||||
if [ -n "${FILE_ENV}" ]; then
|
||||
set -o errexit;
|
||||
@@ -19,23 +13,18 @@ if [ -n "${FILE_ENV}" ]; then
|
||||
source "${FILE_ENV}"
|
||||
fi
|
||||
|
||||
BASE_ROOT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ >/dev/null 2>&1 && pwd )
|
||||
export BASE_ROOT_DIR
|
||||
|
||||
echo "Fallback to default values in env (if not yet set)"
|
||||
# The number of parallel jobs to pass down to make and test_runner.py
|
||||
export MAKEJOBS=${MAKEJOBS:--j4}
|
||||
# A folder for the ci system to put temporary files (ccache, datadirs for tests, ...)
|
||||
# This folder only exists on the ci host.
|
||||
export BASE_SCRATCH_DIR=${BASE_SCRATCH_DIR:-$BASE_ROOT_DIR/ci/scratch/}
|
||||
# What host to compile for. See also ./depends/README.md
|
||||
# Tests that need cross-compilation export the appropriate HOST.
|
||||
# Tests that run natively guess the host
|
||||
export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")}
|
||||
# Whether to prefer BusyBox over GNU utilities
|
||||
export USE_BUSY_BOX=${USE_BUSY_BOX:-false}
|
||||
export HOST=${HOST:-x86_64-unknown-linux-gnu}
|
||||
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-true}
|
||||
export RUN_FUNCTIONAL_TESTS=${RUN_FUNCTIONAL_TESTS:-true}
|
||||
export TEST_PREVIOUS_RELEASES=${TEST_PREVIOUS_RELEASES:-false}
|
||||
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
|
||||
export CONTAINER_NAME=${CONTAINER_NAME:-ci_unnamed}
|
||||
export DOCKER_NAME_TAG=${DOCKER_NAME_TAG:-ubuntu:18.04}
|
||||
# Randomize test order.
|
||||
# See https://www.boost.org/doc/libs/1_71_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/random.html
|
||||
@@ -43,19 +32,15 @@ export BOOST_TEST_RANDOM=${BOOST_TEST_RANDOM:-1}
|
||||
export CCACHE_SIZE=${CCACHE_SIZE:-100M}
|
||||
export CCACHE_TEMPDIR=${CCACHE_TEMPDIR:-/tmp/.ccache-temp}
|
||||
export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
|
||||
# The cache dir.
|
||||
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
|
||||
export CCACHE_DIR=${CCACHE_DIR:-$BASE_SCRATCH_DIR/.ccache}
|
||||
# The depends dir.
|
||||
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
|
||||
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}
|
||||
# Folder where the build is done (bin and lib).
|
||||
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST}
|
||||
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/releases/$HOST}
|
||||
# Folder where the build is done (depends and dist). Can not be changed and is equal to the root of the git repo
|
||||
export BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_ROOT_DIR}
|
||||
# Folder where the build is done (bin and lib). Can not be changed.
|
||||
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_BUILD_DIR/out/$HOST}
|
||||
export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
|
||||
export WINEDEBUG=${WINEDEBUG:-fixme-all}
|
||||
export DOCKER_PACKAGES=${DOCKER_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git procps}
|
||||
export DOCKER_PACKAGES=${DOCKER_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3}
|
||||
export GOAL=${GOAL:-install}
|
||||
export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets}
|
||||
export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_BUILD_DIR}/qa-assets}
|
||||
export PATH=${BASE_ROOT_DIR}/ci/retry:$PATH
|
||||
export CI_RETRY_EXE=${CI_RETRY_EXE:retry}
|
||||
|
||||
13
ci/test/00_setup_env_amd64_asan.sh
Normal file
13
ci/test/00_setup_env_amd64_asan.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=x86_64-unknown-linux-gnu
|
||||
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libssl1.0-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
|
||||
export NO_DEPENDS=1
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=address,integer,undefined CC=clang CXX=clang++"
|
||||
@@ -6,9 +6,8 @@
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export DOCKER_NAME_TAG="ubuntu:20.04"
|
||||
export CONTAINER_NAME=ci_native_fuzz
|
||||
export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev"
|
||||
export HOST=x86_64-unknown-linux-gnu
|
||||
export PACKAGES="clang llvm python3 libssl1.0-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev"
|
||||
export NO_DEPENDS=1
|
||||
export RUN_UNIT_TESTS=false
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_native_nowallet
|
||||
export HOST=x86_64-unknown-linux-gnu
|
||||
export PACKAGES="python3-zmq"
|
||||
export DEP_OPTS="NO_WALLET=1"
|
||||
export GOAL="install"
|
||||
@@ -6,12 +6,9 @@
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_native_qt5
|
||||
export HOST=x86_64-unknown-linux-gnu
|
||||
export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
|
||||
export DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1"
|
||||
export TEST_RUNNER_EXTRA="--coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash
|
||||
export RUN_UNIT_TESTS_SEQUENTIAL="true"
|
||||
export RUN_UNIT_TESTS="false"
|
||||
export GOAL="install"
|
||||
export TEST_PREVIOUS_RELEASES=true
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\""
|
||||
15
ci/test/00_setup_env_amd64_trusty.sh
Normal file
15
ci/test/00_setup_env_amd64_trusty.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=x86_64-unknown-linux-gnu
|
||||
export DOCKER_NAME_TAG=ubuntu:14.04
|
||||
export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libicu-dev libpng-dev libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.1++-dev libzmq3-dev libqrencode-dev"
|
||||
export NO_DEPENDS=1
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no"
|
||||
14
ci/test/00_setup_env_amd64_tsan.sh
Normal file
14
ci/test/00_setup_env_amd64_tsan.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=x86_64-unknown-linux-gnu
|
||||
export DOCKER_NAME_TAG=ubuntu:16.04
|
||||
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
|
||||
export NO_DEPENDS=1
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq --disable-wallet --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=thread --disable-hardening --disable-asm CC=clang CXX=clang++"
|
||||
@@ -7,22 +7,10 @@
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=arm-linux-gnueabihf
|
||||
# The host arch is unknown, so we run the tests through qemu.
|
||||
# If the host is arm and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string.
|
||||
if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-arm -L /usr/arm-linux-gnueabihf/"}"; fi
|
||||
export DPKG_ADD_ARCH="armhf"
|
||||
export PACKAGES="python3-zmq g++-arm-linux-gnueabihf busybox libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf"
|
||||
if [ -n "$QEMU_USER_CMD" ]; then
|
||||
# Likely cross-compiling, so install the needed gcc and qemu-user
|
||||
export PACKAGES="$PACKAGES qemu-user"
|
||||
fi
|
||||
export CONTAINER_NAME=ci_arm_linux
|
||||
# Use debian to avoid 404 apt errors when cross compiling
|
||||
export DOCKER_NAME_TAG="debian:buster"
|
||||
export USE_BUSY_BOX=true
|
||||
export RUN_UNIT_TESTS=true
|
||||
export RUN_FUNCTIONAL_TESTS=true
|
||||
export PACKAGES="python3 g++-arm-linux-gnueabihf"
|
||||
export RUN_UNIT_TESTS=false
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
export GOAL="install"
|
||||
# -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
|
||||
# This could be removed once the ABI change warning does not show up by default
|
||||
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CXXFLAGS=-Wno-psabi --enable-werror"
|
||||
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CXXFLAGS=-Wno-psabi"
|
||||
|
||||
14
ci/test/00_setup_env_i686.sh
Normal file
14
ci/test/00_setup_env_i686.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=i686-pc-linux-gnu
|
||||
export DEP_OPTS="PROTOBUF=1"
|
||||
export PACKAGES="g++-multilib python3-zmq"
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-bip70 --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++"
|
||||
export CONFIG_SHELL="/bin/dash"
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2020 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=i686-pc-linux-gnu
|
||||
export CONTAINER_NAME=ci_i686_centos_7
|
||||
export DOCKER_NAME_TAG=centos:7
|
||||
export DOCKER_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python3 python36-zmq which patch lbzip2 dash"
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports"
|
||||
export CONFIG_SHELL="/bin/dash"
|
||||
@@ -6,10 +6,9 @@
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_macos_cross
|
||||
export HOST=x86_64-apple-darwin16
|
||||
export HOST=x86_64-apple-darwin14
|
||||
export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools"
|
||||
export OSX_SDK=10.14
|
||||
export OSX_SDK=10.11
|
||||
export RUN_UNIT_TESTS=false
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
export GOAL="deploy"
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=x86_64-apple-darwin16
|
||||
export PIP_PACKAGES="zmq"
|
||||
export RUN_UNIT_TESTS=true
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --enable-werror"
|
||||
# Run without depends
|
||||
export NO_DEPENDS=1
|
||||
export OSX_SDK=""
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_native_asan
|
||||
export PACKAGES="clang-8 llvm-8 python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
|
||||
# Use clang-8 instead of default clang (which is clang-6 on Bionic) to avoid spurious segfaults when running on ppc64le
|
||||
export NO_DEPENDS=1
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=address,integer,undefined CC=clang-8 CXX=clang++-8"
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export DOCKER_NAME_TAG="ubuntu:20.04"
|
||||
export CONTAINER_NAME=ci_native_fuzz_valgrind
|
||||
export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev valgrind"
|
||||
export NO_DEPENDS=1
|
||||
export RUN_UNIT_TESTS=false
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
export RUN_FUZZ_TESTS=true
|
||||
export FUZZ_TESTS_CONFIG="--valgrind"
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer CC=clang CXX=clang++"
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_native_tsan
|
||||
export DOCKER_NAME_TAG=ubuntu:16.04
|
||||
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
|
||||
export NO_DEPENDS=1
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq --disable-wallet --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=thread --disable-hardening --disable-asm CC=clang CXX=clang++"
|
||||
|
||||
# xenial comes with old clang versions that can not parse the sanitizer suppressions files
|
||||
# Remove unparseable lines as a hacky workaround
|
||||
sed -i '/^implicit-/d' "${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan"
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_native_valgrind
|
||||
export PACKAGES="valgrind clang llvm python3-zmq libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev"
|
||||
export USE_VALGRIND=1
|
||||
export NO_DEPENDS=1
|
||||
export TEST_RUNNER_EXTRA="--exclude rpc_bind" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang CXX=clang++" # TODO enable GUI
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=s390x-linux-gnu
|
||||
# The host arch is unknown, so we run the tests through qemu.
|
||||
# If the host is s390x and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string.
|
||||
if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-s390x"}"; fi
|
||||
export PACKAGES="python3-zmq"
|
||||
if [ -n "$QEMU_USER_CMD" ]; then
|
||||
# Likely cross-compiling, so install the needed gcc and qemu-user
|
||||
export DPKG_ADD_ARCH="s390x"
|
||||
export PACKAGES="$PACKAGES g++-s390x-linux-gnu qemu-user libc6:s390x libstdc++6:s390x libfontconfig1:s390x libxcb1:s390x"
|
||||
fi
|
||||
# Use debian to avoid 404 apt errors
|
||||
export CONTAINER_NAME=ci_s390x
|
||||
export DOCKER_NAME_TAG="debian:buster"
|
||||
export RUN_UNIT_TESTS=true
|
||||
export RUN_FUNCTIONAL_TESTS=true
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-reduce-exports --with-incompatible-bdb"
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export CONTAINER_NAME=ci_win64
|
||||
export HOST=x86_64-w64-mingw32
|
||||
export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64"
|
||||
export RUN_FUNCTIONAL_TESTS=false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -1,109 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2020 The Bitcoin Core developers
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
if [[ $DOCKER_NAME_TAG == centos* ]]; then
|
||||
export LC_ALL=en_US.utf8
|
||||
fi
|
||||
if [[ $QEMU_USER_CMD == qemu-s390* ]]; then
|
||||
export LC_ALL=C
|
||||
fi
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||
${CI_RETRY_EXE} pip3 install $PIP_PACKAGES
|
||||
fi
|
||||
|
||||
mkdir -p "${BASE_SCRATCH_DIR}"
|
||||
mkdir -p "${CCACHE_DIR}"
|
||||
mkdir -p "${PREVIOUS_RELEASES_DIR}"
|
||||
ccache echo "Creating ccache dir if it didn't already exist"
|
||||
|
||||
export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1"
|
||||
export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/lsan"
|
||||
export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:log_path=${BASE_SCRATCH_DIR}/sanitizer-output/tsan"
|
||||
export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
|
||||
env | grep -E '^(BITCOIN_CONFIG|BASE_|QEMU_|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS|TEST_PREVIOUS_RELEASES|PREVIOUS_RELEASES_DIR)' | tee /tmp/env
|
||||
if [ ! -d ${DIR_QA_ASSETS} ]; then
|
||||
git clone https://github.com/bitcoin-core/qa-assets ${DIR_QA_ASSETS}
|
||||
fi
|
||||
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/
|
||||
|
||||
mkdir -p "${BASE_BUILD_DIR}/sanitizer-output/"
|
||||
export ASAN_OPTIONS=""
|
||||
export LSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/lsan"
|
||||
export TSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/tsan:log_path=${BASE_BUILD_DIR}/sanitizer-output/tsan"
|
||||
export UBSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1"
|
||||
env | grep -E '^(BITCOIN_CONFIG|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
|
||||
if [[ $HOST = *-mingw32 ]]; then
|
||||
DOCKER_ADMIN="--cap-add SYS_ADMIN"
|
||||
elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764)
|
||||
DOCKER_ADMIN="--cap-add SYS_PTRACE"
|
||||
fi
|
||||
|
||||
export P_CI_DIR="$PWD"
|
||||
|
||||
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
|
||||
if [ -z "$RUN_CI_ON_HOST" ]; then
|
||||
echo "Creating $DOCKER_NAME_TAG container to run in"
|
||||
${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG"
|
||||
|
||||
DOCKER_ID=$(docker run $DOCKER_ADMIN -idt \
|
||||
--mount type=bind,src=$BASE_ROOT_DIR,dst=/ro_base,readonly \
|
||||
--mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR \
|
||||
--mount type=bind,src=$DEPENDS_DIR,dst=$DEPENDS_DIR \
|
||||
--mount type=bind,src=$PREVIOUS_RELEASES_DIR,dst=$PREVIOUS_RELEASES_DIR \
|
||||
-w $BASE_ROOT_DIR \
|
||||
--env-file /tmp/env \
|
||||
--name $CONTAINER_NAME \
|
||||
$DOCKER_NAME_TAG)
|
||||
DOCKER_ID=$(docker run $DOCKER_ADMIN -idt --mount type=bind,src=$BASE_BUILD_DIR,dst=$BASE_BUILD_DIR --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR -w $BASE_BUILD_DIR --env-file /tmp/env $DOCKER_NAME_TAG)
|
||||
|
||||
DOCKER_EXEC () {
|
||||
docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
|
||||
docker exec $DOCKER_ID bash -c "cd $PWD && $*"
|
||||
}
|
||||
else
|
||||
echo "Running on host system without docker wrapper"
|
||||
DOCKER_EXEC () {
|
||||
bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
|
||||
bash -c "cd $PWD && $*"
|
||||
}
|
||||
fi
|
||||
|
||||
if [ -n "$DPKG_ADD_ARCH" ]; then
|
||||
DOCKER_EXEC dpkg --add-architecture "$DPKG_ADD_ARCH"
|
||||
fi
|
||||
DOCKER_EXEC free -m -h
|
||||
DOCKER_EXEC echo "Number of CPUs \(nproc\): $(nproc)"
|
||||
|
||||
if [[ $DOCKER_NAME_TAG == centos* ]]; then
|
||||
${CI_RETRY_EXE} DOCKER_EXEC yum -y install epel-release
|
||||
${CI_RETRY_EXE} DOCKER_EXEC yum -y install $DOCKER_PACKAGES $PACKAGES
|
||||
elif [ "$CI_USE_APT_INSTALL" != "no" ]; then
|
||||
${CI_RETRY_EXE} DOCKER_EXEC apt-get update
|
||||
${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $DOCKER_PACKAGES
|
||||
fi
|
||||
${CI_RETRY_EXE} DOCKER_EXEC apt-get update
|
||||
${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES $DOCKER_PACKAGES
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
top -l 1 -s 0 | awk ' /PhysMem/ {print}'
|
||||
echo "Number of CPUs: $(sysctl -n hw.logicalcpu)"
|
||||
else
|
||||
DOCKER_EXEC free -m -h
|
||||
DOCKER_EXEC echo "Number of CPUs \(nproc\):" \$\(nproc\)
|
||||
DOCKER_EXEC echo $(lscpu | grep Endian)
|
||||
DOCKER_EXEC echo "Free disk space:"
|
||||
DOCKER_EXEC df -h
|
||||
fi
|
||||
|
||||
if [ ! -d ${DIR_QA_ASSETS} ]; then
|
||||
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
|
||||
DOCKER_EXEC git clone https://github.com/bitcoin-core/qa-assets ${DIR_QA_ASSETS}
|
||||
fi
|
||||
fi
|
||||
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/
|
||||
|
||||
DOCKER_EXEC mkdir -p "${BASE_SCRATCH_DIR}/sanitizer-output/"
|
||||
|
||||
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
|
||||
echo "Create $BASE_ROOT_DIR"
|
||||
DOCKER_EXEC rsync -a /ro_base/ $BASE_ROOT_DIR
|
||||
fi
|
||||
|
||||
if [ "$USE_BUSY_BOX" = "true" ]; then
|
||||
echo "Setup to use BusyBox utils"
|
||||
DOCKER_EXEC mkdir -p $BASE_SCRATCH_DIR/bins/
|
||||
# tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version)
|
||||
# find excluded for now because it does not recognize the -delete option in ./depends (fixed in later BusyBox version)
|
||||
# ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed)
|
||||
# shellcheck disable=SC1010
|
||||
DOCKER_EXEC for util in \$\(busybox --list \| grep -v "^ar$" \| grep -v "^tar$" \| grep -v "^find$"\)\; do ln -s \$\(command -v busybox\) $BASE_SCRATCH_DIR/bins/\$util\; done
|
||||
# Print BusyBox version
|
||||
DOCKER_EXEC patch --help
|
||||
fi
|
||||
|
||||
@@ -1,42 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
# Make sure default datadir does not exist and is never read by creating a dummy file
|
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
echo > $HOME/Library/Application\ Support/Bitcoin
|
||||
else
|
||||
DOCKER_EXEC echo \> \$HOME/.bitcoin
|
||||
fi
|
||||
DOCKER_EXEC echo \> \$HOME/.bitcoin # Make sure default datadir does not exist and is never read by creating a dummy file
|
||||
|
||||
DOCKER_EXEC mkdir -p ${DEPENDS_DIR}/SDKs ${DEPENDS_DIR}/sdk-sources
|
||||
mkdir -p depends/SDKs depends/sdk-sources
|
||||
|
||||
if [ -n "$OSX_SDK" ] && [ ! -f ${DEPENDS_DIR}/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then
|
||||
curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o ${DEPENDS_DIR}/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz
|
||||
if [ -n "$OSX_SDK" ] && [ ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then
|
||||
curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz
|
||||
fi
|
||||
if [ -n "$OSX_SDK" ] && [ -f ${DEPENDS_DIR}/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then
|
||||
DOCKER_EXEC tar -C ${DEPENDS_DIR}/SDKs -xf ${DEPENDS_DIR}/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz
|
||||
if [ -n "$OSX_SDK" ] && [ -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then
|
||||
tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz
|
||||
fi
|
||||
if [[ $HOST = *-mingw32 ]]; then
|
||||
DOCKER_EXEC update-alternatives --set $HOST-g++ \$\(which $HOST-g++-posix\)
|
||||
fi
|
||||
if [ -z "$NO_DEPENDS" ]; then
|
||||
if [[ $DOCKER_NAME_TAG == centos* ]]; then
|
||||
# CentOS has problems building the depends if the config shell is not explicitly set
|
||||
# (i.e. for libevent a Makefile with an empty SHELL variable is generated, leading to
|
||||
# an error as the first command is executed)
|
||||
SHELL_OPTS="CONFIG_SHELL=/bin/bash"
|
||||
else
|
||||
SHELL_OPTS="CONFIG_SHELL="
|
||||
fi
|
||||
DOCKER_EXEC $SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS
|
||||
fi
|
||||
if [ "$TEST_PREVIOUS_RELEASES" = "true" ]; then
|
||||
BEGIN_FOLD previous-versions
|
||||
DOCKER_EXEC contrib/devtools/previous_release.sh -b -t "$PREVIOUS_RELEASES_DIR" v0.17.1 v0.18.1 v0.19.0.1
|
||||
END_FOLD
|
||||
DOCKER_EXEC CONFIG_SHELL= make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS
|
||||
fi
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$DEPENDS_DIR/$HOST --bindir=$BASE_OUTDIR/bin --libdir=$BASE_OUTDIR/lib"
|
||||
BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$BASE_BUILD_DIR/depends/$HOST --bindir=$BASE_OUTDIR/bin --libdir=$BASE_OUTDIR/lib"
|
||||
if [ -z "$NO_DEPENDS" ]; then
|
||||
DOCKER_EXEC ccache --max-size=$CCACHE_SIZE
|
||||
fi
|
||||
@@ -19,28 +19,28 @@ else
|
||||
fi
|
||||
END_FOLD
|
||||
|
||||
DOCKER_EXEC mkdir -p build
|
||||
export P_CI_DIR="$P_CI_DIR/build"
|
||||
mkdir -p build
|
||||
cd build || (echo "could not enter build directory"; exit 1)
|
||||
|
||||
BEGIN_FOLD configure
|
||||
DOCKER_EXEC ../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (DOCKER_EXEC cat config.log) && false)
|
||||
DOCKER_EXEC ../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false)
|
||||
END_FOLD
|
||||
|
||||
BEGIN_FOLD distdir
|
||||
# Create folder on host and docker, so that `cd` works
|
||||
mkdir -p "bitcoin-$HOST"
|
||||
DOCKER_EXEC make distdir VERSION=$HOST
|
||||
END_FOLD
|
||||
|
||||
export P_CI_DIR="$P_CI_DIR/bitcoin-$HOST"
|
||||
cd "bitcoin-$HOST" || (echo "could not enter distdir bitcoin-$HOST"; exit 1)
|
||||
|
||||
BEGIN_FOLD configure
|
||||
DOCKER_EXEC ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (DOCKER_EXEC cat config.log) && false)
|
||||
DOCKER_EXEC ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false)
|
||||
END_FOLD
|
||||
|
||||
set -o errtrace
|
||||
trap 'DOCKER_EXEC "cat ${BASE_SCRATCH_DIR}/sanitizer-output/* 2> /dev/null"' ERR
|
||||
trap 'DOCKER_EXEC "cat ${BASE_BUILD_DIR}/sanitizer-output/* 2> /dev/null"' ERR
|
||||
|
||||
BEGIN_FOLD build
|
||||
DOCKER_EXEC make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make $GOAL V=1 ; false )
|
||||
END_FOLD
|
||||
|
||||
cd ${BASE_BUILD_DIR} || (echo "could not enter travis build dir $BASE_BUILD_DIR"; exit 1)
|
||||
|
||||
@@ -1,37 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
if [ -n "$QEMU_USER_CMD" ]; then
|
||||
BEGIN_FOLD wrap-qemu
|
||||
# Generate all binaries, so that they can be wrapped
|
||||
DOCKER_EXEC make $MAKEJOBS -C src/secp256k1 VERBOSE=1
|
||||
DOCKER_EXEC make $MAKEJOBS -C src/univalue VERBOSE=1
|
||||
DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-qemu.sh"
|
||||
END_FOLD
|
||||
fi
|
||||
|
||||
if [ -n "$USE_VALGRIND" ]; then
|
||||
BEGIN_FOLD wrap-valgrind
|
||||
DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh"
|
||||
END_FOLD
|
||||
fi
|
||||
|
||||
bash -c "${CI_WAIT}" & # Print dots in case the tests take a long time to run
|
||||
cd "build/bitcoin-$HOST" || (echo "could not enter distdir build/bitcoin-$HOST"; exit 1)
|
||||
|
||||
if [ "$RUN_UNIT_TESTS" = "true" ]; then
|
||||
BEGIN_FOLD unit-tests
|
||||
DOCKER_EXEC LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib make $MAKEJOBS check VERBOSE=1
|
||||
END_FOLD
|
||||
fi
|
||||
|
||||
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
|
||||
BEGIN_FOLD unit-tests-seq
|
||||
DOCKER_EXEC LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib "${BASE_ROOT_DIR}/build/bitcoin-*/src/test/test_bitcoin" --catch_system_errors=no -l test_suite
|
||||
DOCKER_EXEC LD_LIBRARY_PATH=$BASE_BUILD_DIR/depends/$HOST/lib make $MAKEJOBS check VERBOSE=1
|
||||
END_FOLD
|
||||
fi
|
||||
|
||||
@@ -43,6 +22,8 @@ fi
|
||||
|
||||
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
|
||||
BEGIN_FOLD fuzz-tests
|
||||
DOCKER_EXEC test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} -l DEBUG ${DIR_FUZZ_IN}
|
||||
DOCKER_EXEC test/fuzz/test_runner.py -l DEBUG ${DIR_FUZZ_IN}
|
||||
END_FOLD
|
||||
fi
|
||||
|
||||
cd ${BASE_BUILD_DIR} || (echo "could not enter travis build dir $BASE_BUILD_DIR"; exit 1)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/univalue/{no_nul,test_json,unitester,object}}; do
|
||||
# shellcheck disable=SC2044
|
||||
for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name $(basename $b_name)); do
|
||||
echo "Wrap $b ..."
|
||||
mv "$b" "${b}_orig"
|
||||
echo '#!/usr/bin/env bash' > "$b"
|
||||
echo "$QEMU_USER_CMD \"${b}_orig\" \"\$@\"" >> "$b"
|
||||
chmod +x "$b"
|
||||
done
|
||||
done
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
for b_name in "${BASE_OUTDIR}/bin"/*; do
|
||||
# shellcheck disable=SC2044
|
||||
for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name $(basename $b_name)); do
|
||||
echo "Wrap $b ..."
|
||||
mv "$b" "${b}_orig"
|
||||
echo '#!/usr/bin/env bash' > "$b"
|
||||
echo "valgrind --gen-suppressions=all --quiet --error-exitcode=1 --suppressions=${BASE_ROOT_DIR}/contrib/valgrind.supp \"${b}_orig\" \"\$@\"" >> "$b"
|
||||
chmod +x "$b"
|
||||
done
|
||||
done
|
||||
530
configure.ac
530
configure.ac
@@ -1,11 +1,12 @@
|
||||
AC_PREREQ([2.69])
|
||||
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
|
||||
AC_PREREQ([2.60])
|
||||
define(_CLIENT_VERSION_MAJOR, 0)
|
||||
define(_CLIENT_VERSION_MINOR, 20)
|
||||
define(_CLIENT_VERSION_MINOR, 19)
|
||||
define(_CLIENT_VERSION_REVISION, 2)
|
||||
define(_CLIENT_VERSION_BUILD, 0)
|
||||
define(_CLIENT_VERSION_RC, 0)
|
||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||
define(_COPYRIGHT_YEAR, 2020)
|
||||
define(_COPYRIGHT_YEAR, 2019)
|
||||
define(_COPYRIGHT_HOLDERS,[The %s developers])
|
||||
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Bitcoin Core]])
|
||||
AC_INIT([Bitcoin Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_REVISION, m4_if(_CLIENT_VERSION_BUILD, [0], [], _CLIENT_VERSION_BUILD))m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://bitcoincore.org/])
|
||||
@@ -36,14 +37,14 @@ dnl faketime breaks configure and is only needed for make. Disable it here.
|
||||
unset FAKETIME
|
||||
|
||||
dnl Automake init set-up and checks
|
||||
AM_INIT_AUTOMAKE([1.13 no-define subdir-objects foreign])
|
||||
AM_INIT_AUTOMAKE([no-define subdir-objects foreign])
|
||||
|
||||
dnl faketime messes with timestamps and causes configure to be re-run.
|
||||
dnl --disable-maintainer-mode can be used to bypass this.
|
||||
AM_MAINTAINER_MODE([enable])
|
||||
|
||||
dnl make the compilation flags quiet unless V=1 is used
|
||||
AM_SILENT_RULES([yes])
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
dnl Compiler checks (here before libtool).
|
||||
if test "x${CXXFLAGS+set}" = "xset"; then
|
||||
@@ -75,10 +76,6 @@ fi
|
||||
AC_PROG_OBJCXX
|
||||
])
|
||||
|
||||
dnl Since libtool 1.5.2 (released 2004-01-25), on Linux libtool no longer
|
||||
dnl sets RPATH for any directories in the dynamic linker search path.
|
||||
dnl See more: https://wiki.debian.org/RpathIssue
|
||||
LT_PREREQ([1.5.2])
|
||||
dnl Libtool init checks.
|
||||
LT_INIT([pic-only])
|
||||
|
||||
@@ -134,6 +131,12 @@ AC_ARG_ENABLE(gui-tests,
|
||||
[use_gui_tests=$enableval],
|
||||
[use_gui_tests=$use_tests])
|
||||
|
||||
AC_ARG_WITH([rapidcheck],
|
||||
[AS_HELP_STRING([--with-rapidcheck],
|
||||
[enable RapidCheck property-based tests (default is yes if librapidcheck is found)])],
|
||||
[use_rapidcheck=$withval],
|
||||
[use_rapidcheck=auto])
|
||||
|
||||
AC_ARG_ENABLE(bench,
|
||||
AS_HELP_STRING([--disable-bench],[do not compile benchmarks (default is to compile)]),
|
||||
[use_bench=$enableval],
|
||||
@@ -219,16 +222,13 @@ AC_ARG_ENABLE([zmq],
|
||||
[disable ZMQ notifications])],
|
||||
[use_zmq=$enableval],
|
||||
[use_zmq=yes])
|
||||
|
||||
AC_ARG_ENABLE([bip70],
|
||||
[AS_HELP_STRING([--enable-bip70],
|
||||
[BIP70 (payment protocol) support in the GUI (no longer supported)])],
|
||||
[enable BIP70 (payment protocol) support in the GUI (default is to disable)])],
|
||||
[enable_bip70=$enableval],
|
||||
[enable_bip70=no])
|
||||
|
||||
if test x$enable_bip70 != xno; then
|
||||
AC_MSG_ERROR([BIP70 is no longer supported!])
|
||||
fi
|
||||
AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], [])
|
||||
|
||||
AC_ARG_ENABLE(man,
|
||||
[AS_HELP_STRING([--disable-man],
|
||||
@@ -236,34 +236,27 @@ AC_ARG_ENABLE(man,
|
||||
enable_man=yes)
|
||||
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
|
||||
|
||||
dnl Enable debug
|
||||
# Enable debug
|
||||
AC_ARG_ENABLE([debug],
|
||||
[AS_HELP_STRING([--enable-debug],
|
||||
[use compiler flags and macros suited for debugging (default is no)])],
|
||||
[enable_debug=$enableval],
|
||||
[enable_debug=no])
|
||||
|
||||
dnl Enable different -fsanitize options
|
||||
# Enable different -fsanitize options
|
||||
AC_ARG_WITH([sanitizers],
|
||||
[AS_HELP_STRING([--with-sanitizers],
|
||||
[comma separated list of extra sanitizers to build with (default is none enabled)])],
|
||||
[use_sanitizers=$withval])
|
||||
|
||||
dnl Enable gprof profiling
|
||||
# Enable gprof profiling
|
||||
AC_ARG_ENABLE([gprof],
|
||||
[AS_HELP_STRING([--enable-gprof],
|
||||
[use gprof profiling compiler flags (default is no)])],
|
||||
[enable_gprof=$enableval],
|
||||
[enable_gprof=no])
|
||||
|
||||
dnl Pass compiler & liner flags that make builds deterministic
|
||||
AC_ARG_ENABLE([determinism],
|
||||
[AS_HELP_STRING([--enable-determinism],
|
||||
[Enable compilation flags that make builds deterministic (default is no)])],
|
||||
[enable_determinism=$enableval],
|
||||
[enable_determinism=no])
|
||||
|
||||
dnl Turn warnings into errors
|
||||
# Turn warnings into errors
|
||||
AC_ARG_ENABLE([werror],
|
||||
[AS_HELP_STRING([--enable-werror],
|
||||
[Treat certain compiler warnings as errors (default is no)])],
|
||||
@@ -274,15 +267,15 @@ AC_LANG_PUSH([C++])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror],[CXXFLAG_WERROR="-Werror"],[CXXFLAG_WERROR=""])
|
||||
|
||||
if test "x$enable_debug" = xyes; then
|
||||
dnl Clear default -g -O2 flags
|
||||
# Clear default -g -O2 flags
|
||||
if test "x$CXXFLAGS_overridden" = xno; then
|
||||
CXXFLAGS=""
|
||||
fi
|
||||
|
||||
dnl Disable all optimizations
|
||||
# Disable all optimizations
|
||||
AX_CHECK_COMPILE_FLAG([-O0], [[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -O0"]],,[[$CXXFLAG_WERROR]])
|
||||
|
||||
dnl Prefer -g3, fall back to -g if that is unavailable.
|
||||
# Prefer -g3, fall back to -g if that is unavailable.
|
||||
AX_CHECK_COMPILE_FLAG(
|
||||
[-g3],
|
||||
[[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -g3"]],
|
||||
@@ -295,19 +288,19 @@ if test "x$enable_debug" = xyes; then
|
||||
fi
|
||||
|
||||
if test x$use_sanitizers != x; then
|
||||
dnl First check if the compiler accepts flags. If an incompatible pair like
|
||||
dnl -fsanitize=address,thread is used here, this check will fail. This will also
|
||||
dnl fail if a bad argument is passed, e.g. -fsanitize=undfeined
|
||||
# First check if the compiler accepts flags. If an incompatible pair like
|
||||
# -fsanitize=address,thread is used here, this check will fail. This will also
|
||||
# fail if a bad argument is passed, e.g. -fsanitize=undfeined
|
||||
AX_CHECK_COMPILE_FLAG(
|
||||
[[-fsanitize=$use_sanitizers]],
|
||||
[[SANITIZER_CXXFLAGS=-fsanitize=$use_sanitizers]],
|
||||
[AC_MSG_ERROR([compiler did not accept requested flags])])
|
||||
|
||||
dnl Some compilers (e.g. GCC) require additional libraries like libasan,
|
||||
dnl libtsan, libubsan, etc. Make sure linking still works with the sanitize
|
||||
dnl flag. This is a separate check so we can give a better error message when
|
||||
dnl the sanitize flags are supported by the compiler but the actual sanitizer
|
||||
dnl libs are missing.
|
||||
# Some compilers (e.g. GCC) require additional libraries like libasan,
|
||||
# libtsan, libubsan, etc. Make sure linking still works with the sanitize
|
||||
# flag. This is a separate check so we can give a better error message when
|
||||
# the sanitize flags are supported by the compiler but the actual sanitizer
|
||||
# libs are missing.
|
||||
AX_CHECK_LINK_FLAG(
|
||||
[[-fsanitize=$use_sanitizers]],
|
||||
[[SANITIZER_LDFLAGS=-fsanitize=$use_sanitizers]],
|
||||
@@ -329,9 +322,6 @@ if test "x$enable_werror" = "xyes"; then
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=vla],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=vla"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=switch],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=switch"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=thread-safety-analysis],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=thread-safety-analysis"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=unused-variable],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=unused-variable"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=date-time],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=date-time"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=return-type],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=return-type"],,[[$CXXFLAG_WERROR]])
|
||||
fi
|
||||
|
||||
if test "x$CXXFLAGS_overridden" = "xno"; then
|
||||
@@ -344,12 +334,10 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
|
||||
AX_CHECK_COMPILE_FLAG([-Wthread-safety-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wthread-safety-analysis"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Wrange-loop-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wrange-loop-analysis"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Wredundant-decls],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wredundant-decls"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-variable],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunused-variable"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Wdate-time],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"],,[[$CXXFLAG_WERROR]])
|
||||
|
||||
dnl Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
|
||||
dnl unknown options if any other warning is produced. Test the -Wfoo case, and
|
||||
dnl set the -Wno-foo case if it works.
|
||||
## Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
|
||||
## unknown options if any other warning is produced. Test the -Wfoo case, and
|
||||
## set the -Wno-foo case if it works.
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-parameter],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-parameter"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Wself-assign],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-self-assign"],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]])
|
||||
@@ -357,18 +345,16 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
|
||||
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-implicit-fallthrough"],,[[$CXXFLAG_WERROR]])
|
||||
fi
|
||||
|
||||
enable_sse42=no
|
||||
enable_hwcrc32=no
|
||||
enable_sse41=no
|
||||
enable_avx2=no
|
||||
enable_shani=no
|
||||
|
||||
if test "x$use_asm" = "xyes"; then
|
||||
|
||||
dnl Check for optional instruction set support. Enabling these does _not_ imply that all code will
|
||||
dnl be compiled with them, rather that specific objects/libs may use them after checking for runtime
|
||||
dnl compatibility.
|
||||
|
||||
dnl x86
|
||||
# Check for optional instruction set support. Enabling these does _not_ imply that all code will
|
||||
# be compiled with them, rather that specific objects/libs may use them after checking for runtime
|
||||
# compatibility.
|
||||
AX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-msse4.1],[[SSE41_CXXFLAGS="-msse4.1"]],,[[$CXXFLAG_WERROR]])
|
||||
AX_CHECK_COMPILE_FLAG([-mavx -mavx2],[[AVX2_CXXFLAGS="-mavx -mavx2"]],,[[$CXXFLAG_WERROR]])
|
||||
@@ -376,7 +362,7 @@ AX_CHECK_COMPILE_FLAG([-msse4 -msha],[[SHANI_CXXFLAGS="-msse4 -msha"]],,[[$CXXFL
|
||||
|
||||
TEMP_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $SSE42_CXXFLAGS"
|
||||
AC_MSG_CHECKING(for SSE4.2 intrinsics)
|
||||
AC_MSG_CHECKING(for assembler crc32 support)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <stdint.h>
|
||||
#if defined(_MSC_VER)
|
||||
@@ -391,7 +377,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
l = _mm_crc32_u64(l, 0);
|
||||
return l;
|
||||
]])],
|
||||
[ AC_MSG_RESULT(yes); enable_sse42=yes],
|
||||
[ AC_MSG_RESULT(yes); enable_hwcrc32=yes],
|
||||
[ AC_MSG_RESULT(no)]
|
||||
)
|
||||
CXXFLAGS="$TEMP_CXXFLAGS"
|
||||
@@ -443,24 +429,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
)
|
||||
CXXFLAGS="$TEMP_CXXFLAGS"
|
||||
|
||||
# ARM
|
||||
AX_CHECK_COMPILE_FLAG([-march=armv8-a+crc+crypto],[[ARM_CRC_CXXFLAGS="-march=armv8-a+crc+crypto"]],,[[$CXXFLAG_WERROR]])
|
||||
|
||||
TEMP_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $ARM_CRC_CXXFLAGS"
|
||||
AC_MSG_CHECKING(for ARM CRC32 intrinsics)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <arm_acle.h>
|
||||
#include <arm_neon.h>
|
||||
]],[[
|
||||
__crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0);
|
||||
vmull_p64(0, 0);
|
||||
]])],
|
||||
[ AC_MSG_RESULT(yes); enable_arm_crc=yes; ],
|
||||
[ AC_MSG_RESULT(no)]
|
||||
)
|
||||
CXXFLAGS="$TEMP_CXXFLAGS"
|
||||
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
|
||||
@@ -505,27 +473,32 @@ use_pkgconfig=yes
|
||||
case $host in
|
||||
*mingw*)
|
||||
|
||||
dnl pkgconfig does more harm than good with MinGW
|
||||
#pkgconfig does more harm than good with MinGW
|
||||
use_pkgconfig=no
|
||||
|
||||
TARGET_OS=windows
|
||||
AC_CHECK_LIB([kernel32], [GetModuleFileNameA],, AC_MSG_ERROR(libkernel32 missing))
|
||||
AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(libuser32 missing))
|
||||
AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(libgdi32 missing))
|
||||
AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(libcomdlg32 missing))
|
||||
AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(libwinmm missing))
|
||||
AC_CHECK_LIB([shell32], [SHGetSpecialFolderPathW],, AC_MSG_ERROR(libshell32 missing))
|
||||
AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(libcomctl32 missing))
|
||||
AC_CHECK_LIB([ole32], [CoCreateInstance],, AC_MSG_ERROR(libole32 missing))
|
||||
AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(liboleaut32 missing))
|
||||
AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(libuuid missing))
|
||||
AC_CHECK_LIB([advapi32], [CryptAcquireContextW],, AC_MSG_ERROR(libadvapi32 missing))
|
||||
AC_CHECK_LIB([ws2_32], [WSAStartup],, AC_MSG_ERROR(libws2_32 missing))
|
||||
AC_CHECK_LIB([shlwapi], [PathRemoveFileSpecW],, AC_MSG_ERROR(libshlwapi missing))
|
||||
AC_CHECK_LIB([iphlpapi], [GetAdaptersAddresses],, AC_MSG_ERROR(libiphlpapi missing))
|
||||
AC_CHECK_LIB([mingwthrd], [main],, AC_MSG_ERROR(libmingwthrd missing))
|
||||
AC_CHECK_LIB([kernel32], [main],, AC_MSG_ERROR(libkernel32 missing))
|
||||
AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(libuser32 missing))
|
||||
AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(libgdi32 missing))
|
||||
AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(libcomdlg32 missing))
|
||||
AC_CHECK_LIB([winspool], [main],, AC_MSG_ERROR(libwinspool missing))
|
||||
AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(libwinmm missing))
|
||||
AC_CHECK_LIB([shell32], [main],, AC_MSG_ERROR(libshell32 missing))
|
||||
AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(libcomctl32 missing))
|
||||
AC_CHECK_LIB([ole32], [main],, AC_MSG_ERROR(libole32 missing))
|
||||
AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(liboleaut32 missing))
|
||||
AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(libuuid missing))
|
||||
AC_CHECK_LIB([rpcrt4], [main],, AC_MSG_ERROR(librpcrt4 missing))
|
||||
AC_CHECK_LIB([advapi32], [main],, AC_MSG_ERROR(libadvapi32 missing))
|
||||
AC_CHECK_LIB([ws2_32], [main],, AC_MSG_ERROR(libws2_32 missing))
|
||||
AC_CHECK_LIB([mswsock], [main],, AC_MSG_ERROR(libmswsock missing))
|
||||
AC_CHECK_LIB([shlwapi], [main],, AC_MSG_ERROR(libshlwapi missing))
|
||||
AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(libiphlpapi missing))
|
||||
AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(libcrypt32 missing))
|
||||
|
||||
dnl -static is interpreted by libtool, where it has a different meaning.
|
||||
dnl In libtool-speak, it's -all-static.
|
||||
# -static is interpreted by libtool, where it has a different meaning.
|
||||
# In libtool-speak, it's -all-static.
|
||||
AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"])
|
||||
|
||||
AC_PATH_PROG([MAKENSIS], [makensis], none)
|
||||
@@ -539,9 +512,16 @@ case $host in
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0601"
|
||||
LEVELDB_TARGET_FLAGS="-DOS_WINDOWS"
|
||||
if test "x$CXXFLAGS_overridden" = "xno"; then
|
||||
CXXFLAGS="$CXXFLAGS -w"
|
||||
fi
|
||||
case $host in
|
||||
i?86-*) WINDOWS_BITS=32 ;;
|
||||
x86_64-*) WINDOWS_BITS=64 ;;
|
||||
*) AC_MSG_ERROR("Could not determine win32/win64 for installer") ;;
|
||||
esac
|
||||
AC_SUBST(WINDOWS_BITS)
|
||||
|
||||
dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.
|
||||
dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override
|
||||
@@ -554,6 +534,7 @@ case $host in
|
||||
;;
|
||||
*darwin*)
|
||||
TARGET_OS=darwin
|
||||
LEVELDB_TARGET_FLAGS="-DOS_MACOSX"
|
||||
if test x$cross_compiling != xyes; then
|
||||
BUILD_OS=darwin
|
||||
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)
|
||||
@@ -565,8 +546,13 @@ case $host in
|
||||
dnl It's safe to add these paths even if the functionality is disabled by
|
||||
dnl the user (--without-wallet or --without-gui for example).
|
||||
|
||||
bdb_prefix=$($BREW --prefix berkeley-db4 2>/dev/null)
|
||||
qt5_prefix=$($BREW --prefix qt5 2>/dev/null)
|
||||
openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
|
||||
bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null`
|
||||
qt5_prefix=`$BREW --prefix qt5 2>/dev/null`
|
||||
if test x$openssl_prefix != x; then
|
||||
PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
export PKG_CONFIG_PATH
|
||||
fi
|
||||
if test x$bdb_prefix != x; then
|
||||
CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
|
||||
LIBS="$LIBS -L$bdb_prefix/lib"
|
||||
@@ -604,10 +590,35 @@ case $host in
|
||||
;;
|
||||
*android*)
|
||||
dnl make sure android stays above linux for hosts like *linux-android*
|
||||
TARGET_OS=android
|
||||
LEVELDB_TARGET_FLAGS="-DOS_ANDROID"
|
||||
;;
|
||||
*linux*)
|
||||
TARGET_OS=linux
|
||||
LEVELDB_TARGET_FLAGS="-DOS_LINUX"
|
||||
;;
|
||||
*kfreebsd*)
|
||||
LEVELDB_TARGET_FLAGS="-DOS_KFREEBSD"
|
||||
;;
|
||||
*freebsd*)
|
||||
LEVELDB_TARGET_FLAGS="-DOS_FREEBSD"
|
||||
;;
|
||||
*openbsd*)
|
||||
LEVELDB_TARGET_FLAGS="-DOS_OPENBSD"
|
||||
;;
|
||||
*netbsd*)
|
||||
LEVELDB_TARGET_FLAGS="-DOS_NETBSD"
|
||||
;;
|
||||
*dragonfly*)
|
||||
LEVELDB_TARGET_FLAGS="-DOS_DRAGONFLYBSD"
|
||||
;;
|
||||
*solaris*)
|
||||
LEVELDB_TARGET_FLAGS="-DOS_SOLARIS"
|
||||
;;
|
||||
*hpux*)
|
||||
LEVELDB_TARGET_FLAGS="-DOS_HPUX"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(Cannot build leveldb for $host. Please file a bug report.)
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -643,6 +654,7 @@ if test x$use_lcov = xyes; then
|
||||
[AC_MSG_ERROR("lcov testing requested but --coverage linker flag does not work")])
|
||||
AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
|
||||
[AC_MSG_ERROR("lcov testing requested but --coverage flag does not work")])
|
||||
AC_DEFINE(USE_COVERAGE, 1, [Define this symbol if coverage is enabled])
|
||||
CXXFLAGS="$CXXFLAGS -Og"
|
||||
fi
|
||||
|
||||
@@ -656,11 +668,11 @@ AC_C_BIGENDIAN
|
||||
dnl Check for pthread compile/link requirements
|
||||
AX_PTHREAD
|
||||
|
||||
dnl The following macro will add the necessary defines to bitcoin-config.h, but
|
||||
dnl they also need to be passed down to any subprojects. Pull the results out of
|
||||
dnl the cache and add them to CPPFLAGS.
|
||||
# The following macro will add the necessary defines to bitcoin-config.h, but
|
||||
# they also need to be passed down to any subprojects. Pull the results out of
|
||||
# the cache and add them to CPPFLAGS.
|
||||
AC_SYS_LARGEFILE
|
||||
dnl detect POSIX or GNU variant of strerror_r
|
||||
# detect POSIX or GNU variant of strerror_r
|
||||
AC_FUNC_STRERROR_R
|
||||
|
||||
if test x$ac_cv_sys_file_offset_bits != x &&
|
||||
@@ -675,14 +687,20 @@ if test x$ac_cv_sys_large_files != x &&
|
||||
CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
|
||||
fi
|
||||
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"])
|
||||
|
||||
AX_GCC_FUNC_ATTRIBUTE([visibility])
|
||||
AX_GCC_FUNC_ATTRIBUTE([dllexport])
|
||||
AX_GCC_FUNC_ATTRIBUTE([dllimport])
|
||||
|
||||
if test x$use_glibc_compat != xno; then
|
||||
|
||||
dnl __fdelt_chk's params and return type have changed from long unsigned int to long int.
|
||||
dnl See which one is present here.
|
||||
#glibc absorbed clock_gettime in 2.17. librt (its previous location) is safe to link
|
||||
#in anyway for back-compat.
|
||||
AC_CHECK_LIB([rt],[clock_gettime],, AC_MSG_ERROR(librt missing))
|
||||
|
||||
#__fdelt_chk's params and return type have changed from long unsigned int to long int.
|
||||
# See which one is present here.
|
||||
AC_MSG_CHECKING(__fdelt_chk type)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE
|
||||
#undef _FORTIFY_SOURCE
|
||||
@@ -718,30 +736,25 @@ if test "x$enable_gprof" = xyes; then
|
||||
fi
|
||||
|
||||
if test x$TARGET_OS != xwindows; then
|
||||
dnl All windows code is PIC, forcing it on just adds useless compile warnings
|
||||
# All windows code is PIC, forcing it on just adds useless compile warnings
|
||||
AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS="-fPIC"])
|
||||
fi
|
||||
|
||||
dnl All versions of gcc that we commonly use for building are subject to bug
|
||||
dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348. To work around that, set
|
||||
dnl -fstack-reuse=none for all gcc builds. (Only gcc understands this flag)
|
||||
# All versions of gcc that we commonly use for building are subject to bug
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348. To work around that, set
|
||||
# -fstack-reuse=none for all gcc builds. (Only gcc understands this flag)
|
||||
AX_CHECK_COMPILE_FLAG([-fstack-reuse=none],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-reuse=none"])
|
||||
if test x$use_hardening != xno; then
|
||||
use_hardening=yes
|
||||
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
|
||||
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
|
||||
|
||||
dnl When enable_debug is yes, all optimizations are disabled.
|
||||
dnl However, FORTIFY_SOURCE requires that there is some level of optimization, otherwise it does nothing and just creates a compiler warning.
|
||||
dnl Since FORTIFY_SOURCE is a no-op without optimizations, do not enable it when enable_debug is yes.
|
||||
if test x$enable_debug != xyes; then
|
||||
AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[
|
||||
AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[
|
||||
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE"
|
||||
])
|
||||
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
|
||||
AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[
|
||||
AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[
|
||||
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE"
|
||||
])
|
||||
fi
|
||||
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
|
||||
])
|
||||
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"])
|
||||
@@ -760,20 +773,12 @@ fi
|
||||
dnl this flag screws up non-darwin gcc even when the check fails. special-case it.
|
||||
if test x$TARGET_OS = xdarwin; then
|
||||
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip_dylibs]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"])
|
||||
AX_CHECK_LINK_FLAG([[-Wl,-bind_at_load]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-bind_at_load"])
|
||||
fi
|
||||
|
||||
if test x$enable_determinism = xyes; then
|
||||
if test x$TARGET_OS = xwindows; then
|
||||
AX_CHECK_LINK_FLAG([[-Wl,--no-insert-timestamp]], [LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"])
|
||||
fi
|
||||
fi
|
||||
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])
|
||||
|
||||
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
|
||||
|
||||
dnl FD_ZERO may be dependent on a declaration of memcpy, e.g. in SmartOS
|
||||
dnl check that it fails to build without memcpy, then that it builds with
|
||||
# FD_ZERO may be dependent on a declaration of memcpy, e.g. in SmartOS
|
||||
# check that it fails to build without memcpy, then that it builds with
|
||||
AC_MSG_CHECKING(FD_ZERO memcpy dependence)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <cstddef>
|
||||
@@ -811,7 +816,7 @@ AC_CHECK_DECLS([getifaddrs, freeifaddrs],,,
|
||||
)
|
||||
AC_CHECK_DECLS([strnlen])
|
||||
|
||||
dnl Check for daemon(3), unrelated to --with-daemon (although used by it)
|
||||
# Check for daemon(3), unrelated to --with-daemon (although used by it)
|
||||
AC_CHECK_DECLS([daemon])
|
||||
|
||||
AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
|
||||
@@ -877,14 +882,19 @@ if test "x$use_thread_local" = xyes || { test "x$use_thread_local" = xauto && te
|
||||
[
|
||||
case $host in
|
||||
*mingw*)
|
||||
dnl mingw32's implementation of thread_local has also been shown to behave
|
||||
dnl erroneously under concurrent usage; see:
|
||||
dnl https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605
|
||||
# mingw32's implementation of thread_local has also been shown to behave
|
||||
# erroneously under concurrent usage; see:
|
||||
# https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*darwin*)
|
||||
# TODO enable thread_local on later versions of Darwin where it is
|
||||
# supported (per https://stackoverflow.com/a/29929949)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*freebsd*)
|
||||
dnl FreeBSD's implementation of thread_local is also buggy (per
|
||||
dnl https://groups.google.com/d/msg/bsdmailinglist/22ncTZAbDp4/Dii_pII5AwAJ)
|
||||
# FreeBSD's implementation of thread_local is also buggy (per
|
||||
# https://groups.google.com/d/msg/bsdmailinglist/22ncTZAbDp4/Dii_pII5AwAJ)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
@@ -900,23 +910,7 @@ if test "x$use_thread_local" = xyes || { test "x$use_thread_local" = xauto && te
|
||||
LDFLAGS="$TEMP_LDFLAGS"
|
||||
fi
|
||||
|
||||
dnl check for gmtime_r(), fallback to gmtime_s() if that is unavailable
|
||||
dnl fail if neither are available.
|
||||
AC_MSG_CHECKING(for gmtime_r)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
|
||||
[[ gmtime_r((const time_t *) nullptr, (struct tm *) nullptr); ]])],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GMTIME_R, 1, [Define this symbol if gmtime_r is available]) ],
|
||||
[ AC_MSG_RESULT(no);
|
||||
AC_MSG_CHECKING(for gmtime_s);
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
|
||||
[[ gmtime_s((struct tm *) nullptr, (const time_t *) nullptr); ]])],
|
||||
[ AC_MSG_RESULT(yes)],
|
||||
[ AC_MSG_RESULT(no); AC_MSG_ERROR(Both gmtime_r and gmtime_s are unavailable) ]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
dnl Check for different ways of gathering OS randomness
|
||||
# Check for different ways of gathering OS randomness
|
||||
AC_MSG_CHECKING(for Linux getrandom syscall)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
@@ -941,24 +935,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
|
||||
[ AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING(for sysctl)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#include <sys/sysctl.h>]],
|
||||
[[ #ifdef __linux__
|
||||
#error "Don't use sysctl on Linux, it's deprecated even when it works"
|
||||
#endif
|
||||
sysctl(nullptr, 2, nullptr, nullptr, nullptr, 0); ]])],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL, 1,[Define this symbol if the BSD sysctl() is available]) ],
|
||||
[ AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING(for sysctl KERN_ARND)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#include <sys/sysctl.h>]],
|
||||
[[ #ifdef __linux__
|
||||
#error "Don't use sysctl on Linux, it's deprecated even when it works"
|
||||
#endif
|
||||
static int name[2] = {CTL_KERN, KERN_ARND};
|
||||
[[ static const int name[2] = {CTL_KERN, KERN_ARND};
|
||||
sysctl(name, 2, nullptr, nullptr, nullptr, 0); ]])],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL_ARND, 1,[Define this symbol if the BSD sysctl(KERN_ARND) is available]) ],
|
||||
[ AC_MSG_RESULT(no)]
|
||||
@@ -972,73 +952,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>
|
||||
[ AC_MSG_RESULT(no)]
|
||||
)
|
||||
|
||||
dnl LevelDB platform checks
|
||||
AC_MSG_CHECKING(for fdatasync)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],
|
||||
[[ fdatasync(0); ]])],
|
||||
[ AC_MSG_RESULT(yes); HAVE_FDATASYNC=1 ],
|
||||
[ AC_MSG_RESULT(no); HAVE_FDATASYNC=0 ]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING(for F_FULLFSYNC)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>]],
|
||||
[[ fcntl(0, F_FULLFSYNC, 0); ]])],
|
||||
[ AC_MSG_RESULT(yes); HAVE_FULLFSYNC=1 ],
|
||||
[ AC_MSG_RESULT(no); HAVE_FULLFSYNC=0 ]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING(for O_CLOEXEC)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>]],
|
||||
[[ open("", O_CLOEXEC); ]])],
|
||||
[ AC_MSG_RESULT(yes); HAVE_O_CLOEXEC=1 ],
|
||||
[ AC_MSG_RESULT(no); HAVE_O_CLOEXEC=0 ]
|
||||
)
|
||||
|
||||
dnl crc32c platform checks
|
||||
AC_MSG_CHECKING(for __builtin_prefetch)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
|
||||
char data = 0;
|
||||
const char* address = &data;
|
||||
__builtin_prefetch(address, 0, 0);
|
||||
]])],
|
||||
[ AC_MSG_RESULT(yes); HAVE_BUILTIN_PREFETCH=1 ],
|
||||
[ AC_MSG_RESULT(no); HAVE_BUILTIN_PREFETCH=0 ]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING(for _mm_prefetch)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xmmintrin.h>]], [[
|
||||
char data = 0;
|
||||
const char* address = &data;
|
||||
_mm_prefetch(address, _MM_HINT_NTA);
|
||||
]])],
|
||||
[ AC_MSG_RESULT(yes); HAVE_MM_PREFETCH=1 ],
|
||||
[ AC_MSG_RESULT(no); HAVE_MM_PREFETCH=0 ]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING(for strong getauxval support in the system headers)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <arm_acle.h>
|
||||
#include <arm_neon.h>
|
||||
#include <sys/auxv.h>
|
||||
]], [[
|
||||
getauxval(AT_HWCAP);
|
||||
]])],
|
||||
[ AC_MSG_RESULT(yes); HAVE_STRONG_GETAUXVAL=1 ],
|
||||
[ AC_MSG_RESULT(no); HAVE_STRONG_GETAUXVAL=0 ]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING(for weak getauxval support in the compiler)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
unsigned long getauxval(unsigned long type) __attribute__((weak));
|
||||
#define AT_HWCAP 16
|
||||
]], [[
|
||||
getauxval(AT_HWCAP);
|
||||
]])],
|
||||
[ AC_MSG_RESULT(yes); HAVE_WEAK_GETAUXVAL=1 ],
|
||||
[ AC_MSG_RESULT(no); HAVE_WEAK_GETAUXVAL=0 ]
|
||||
)
|
||||
|
||||
dnl Check for reduced exports
|
||||
# Check for reduced exports
|
||||
if test x$use_reduce_exports = xyes; then
|
||||
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
|
||||
[AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
|
||||
@@ -1050,7 +964,7 @@ AC_LINK_IFELSE(
|
||||
[[ #include <cstdlib> ]],
|
||||
[[ int nErr = std::system(""); ]]
|
||||
)],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STD__SYSTEM, 1, Define to 1 if std::system is available.)],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STD__SYSTEM, 1, Define to 1 if you have the `std::system' function.)],
|
||||
[ AC_MSG_RESULT(no) ]
|
||||
)
|
||||
|
||||
@@ -1060,10 +974,11 @@ AC_LINK_IFELSE(
|
||||
[[ ]],
|
||||
[[ int nErr = ::_wsystem(""); ]]
|
||||
)],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WSYSTEM, 1, Define to 1 if ::wsystem is available.)],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WSYSTEM, 1, Define to 1 if you have the `::wsystem' function.)],
|
||||
[ AC_MSG_RESULT(no) ]
|
||||
)
|
||||
|
||||
# Define to 1 if std::system or ::wsystem (Windows) is available
|
||||
AC_DEFINE([HAVE_SYSTEM], [HAVE_STD__SYSTEM || HAVE_WSYSTEM], [std::system or ::wsystem])
|
||||
|
||||
LEVELDB_CPPFLAGS=
|
||||
@@ -1150,6 +1065,7 @@ fi
|
||||
AX_BOOST_SYSTEM
|
||||
AX_BOOST_FILESYSTEM
|
||||
AX_BOOST_THREAD
|
||||
AX_BOOST_CHRONO
|
||||
|
||||
dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic
|
||||
dnl counter implementations. In 1.63 and later the std::atomic approach is default.
|
||||
@@ -1216,7 +1132,7 @@ fi
|
||||
|
||||
if test x$use_boost = xyes; then
|
||||
|
||||
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB"
|
||||
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB"
|
||||
|
||||
|
||||
dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums
|
||||
@@ -1254,6 +1170,57 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
LIBS="$TEMP_LIBS"
|
||||
CPPFLAGS="$TEMP_CPPFLAGS"
|
||||
|
||||
dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
|
||||
dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if
|
||||
dnl a working version is available, else fall back to sleep. sleep was removed
|
||||
dnl after 1.56.
|
||||
dnl If neither is available, abort.
|
||||
TEMP_LIBS="$LIBS"
|
||||
LIBS="$BOOST_LIBS $LIBS"
|
||||
TEMP_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/version.hpp>
|
||||
]],[[
|
||||
#if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200)
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(0));
|
||||
#else
|
||||
choke me
|
||||
#endif
|
||||
]])],
|
||||
[boost_sleep=yes;
|
||||
AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],
|
||||
[boost_sleep=no])
|
||||
LIBS="$TEMP_LIBS"
|
||||
CPPFLAGS="$TEMP_CPPFLAGS"
|
||||
|
||||
if test x$boost_sleep != xyes; then
|
||||
TEMP_LIBS="$LIBS"
|
||||
LIBS="$BOOST_LIBS $LIBS"
|
||||
TEMP_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
||||
]],[[
|
||||
#if BOOST_VERSION <= 105600
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(0));
|
||||
#else
|
||||
choke me
|
||||
#endif
|
||||
]])],
|
||||
[boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])],
|
||||
[boost_sleep=no])
|
||||
LIBS="$TEMP_LIBS"
|
||||
CPPFLAGS="$TEMP_CPPFLAGS"
|
||||
fi
|
||||
|
||||
if test x$boost_sleep != xyes; then
|
||||
AC_MSG_ERROR(No working boost sleep implementation found.)
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test x$use_pkgconfig = xyes; then
|
||||
@@ -1261,10 +1228,15 @@ if test x$use_pkgconfig = xyes; then
|
||||
m4_ifdef(
|
||||
[PKG_CHECK_MODULES],
|
||||
[
|
||||
PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
|
||||
PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
|
||||
if test x$enable_bip70 != xno; then
|
||||
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [have_protobuf=no])])
|
||||
fi
|
||||
if test x$use_qr != xno; then
|
||||
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
|
||||
fi
|
||||
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
|
||||
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then
|
||||
PKG_CHECK_MODULES([EVENT], [libevent >= 2.0.21],, [AC_MSG_ERROR(libevent version 2.0.21 or greater not found.)])
|
||||
if test x$TARGET_OS != xwindows; then
|
||||
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads >= 2.0.21],, [AC_MSG_ERROR(libevent_pthreads version 2.0.21 or greater not found.)])
|
||||
@@ -1283,8 +1255,13 @@ if test x$use_pkgconfig = xyes; then
|
||||
]
|
||||
)
|
||||
else
|
||||
AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
|
||||
AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
|
||||
|
||||
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
|
||||
AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
|
||||
AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))
|
||||
|
||||
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then
|
||||
AC_CHECK_HEADER([event2/event.h],, AC_MSG_ERROR(libevent headers missing),)
|
||||
AC_CHECK_LIB([event],[main],EVENT_LIBS=-levent,AC_MSG_ERROR(libevent missing))
|
||||
if test x$TARGET_OS != xwindows; then
|
||||
@@ -1315,12 +1292,38 @@ else
|
||||
esac
|
||||
fi
|
||||
|
||||
if test x$enable_bip70 != xno; then
|
||||
BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], [have_protobuf=no]))
|
||||
fi
|
||||
if test x$use_qr != xno; then
|
||||
BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])
|
||||
BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)])
|
||||
fi
|
||||
fi
|
||||
|
||||
save_CXXFLAGS="${CXXFLAGS}"
|
||||
CXXFLAGS="${CXXFLAGS} ${CRYPTO_CFLAGS} ${SSL_CFLAGS}"
|
||||
AC_CHECK_DECLS([EVP_MD_CTX_new],,,[AC_INCLUDES_DEFAULT
|
||||
#include <openssl/x509_vfy.h>
|
||||
])
|
||||
CXXFLAGS="${save_CXXFLAGS}"
|
||||
|
||||
dnl RapidCheck property-based testing
|
||||
|
||||
enable_property_tests=no
|
||||
if test "x$use_rapidcheck" = xauto; then
|
||||
AC_CHECK_HEADERS([rapidcheck.h], [enable_property_tests=yes])
|
||||
elif test "x$use_rapidcheck" != xno; then
|
||||
enable_property_tests=yes
|
||||
fi
|
||||
|
||||
RAPIDCHECK_LIBS=
|
||||
if test "x$enable_property_tests" = xyes; then
|
||||
RAPIDCHECK_LIBS=-lrapidcheck
|
||||
fi
|
||||
AC_SUBST(RAPIDCHECK_LIBS)
|
||||
AM_CONDITIONAL([ENABLE_PROPERTY_TESTS], [test x$enable_property_tests = xyes])
|
||||
|
||||
dnl univalue check
|
||||
|
||||
need_bundled_univalue=yes
|
||||
@@ -1369,6 +1372,12 @@ AM_CONDITIONAL([EMBEDDED_UNIVALUE],[test x$need_bundled_univalue = xyes])
|
||||
AC_SUBST(UNIVALUE_CFLAGS)
|
||||
AC_SUBST(UNIVALUE_LIBS)
|
||||
|
||||
|
||||
if test x$have_protobuf != xno &&
|
||||
test x$enable_bip70 != xno; then
|
||||
BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether to build bitcoind])
|
||||
AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
|
||||
AC_MSG_RESULT($build_bitcoind)
|
||||
@@ -1466,16 +1475,18 @@ if test x$bitcoin_enable_qt != xno; then
|
||||
AC_MSG_CHECKING([whether to build GUI with support for QR codes])
|
||||
if test x$have_qrencode = xno; then
|
||||
if test x$use_qr = xyes; then
|
||||
AC_MSG_ERROR([QR support requested but cannot be built. Use --without-qrencode])
|
||||
AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode")
|
||||
fi
|
||||
use_qr=no
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
if test x$use_qr != xno; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in])
|
||||
use_qr=yes
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT([$use_qr])
|
||||
|
||||
if test x$XGETTEXT = x; then
|
||||
AC_MSG_WARN("xgettext is required to update qt translations")
|
||||
@@ -1488,6 +1499,23 @@ if test x$bitcoin_enable_qt != xno; then
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether to build BIP70 support])
|
||||
if test x$have_protobuf = xno; then
|
||||
if test x$enable_bip70 = xyes; then
|
||||
AC_MSG_ERROR(protobuf missing)
|
||||
fi
|
||||
enable_bip70=no
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
if test x$enable_bip70 != xno; then
|
||||
AC_DEFINE([ENABLE_BIP70],[1],[Define if BIP70 support should be compiled in])
|
||||
enable_bip70=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"])
|
||||
@@ -1520,18 +1548,17 @@ AM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes])
|
||||
AM_CONDITIONAL([ENABLE_FUZZ],[test x$enable_fuzz = xyes])
|
||||
AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
|
||||
AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes])
|
||||
AM_CONDITIONAL([ENABLE_BIP70],[test x$enable_bip70 = xyes])
|
||||
AM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes])
|
||||
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
|
||||
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
|
||||
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
|
||||
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
|
||||
AM_CONDITIONAL([ENABLE_SSE42],[test x$enable_sse42 = xyes])
|
||||
AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])
|
||||
AM_CONDITIONAL([ENABLE_SSE41],[test x$enable_sse41 = xyes])
|
||||
AM_CONDITIONAL([ENABLE_AVX2],[test x$enable_avx2 = xyes])
|
||||
AM_CONDITIONAL([ENABLE_SHANI],[test x$enable_shani = xyes])
|
||||
AM_CONDITIONAL([ENABLE_ARM_CRC],[test x$enable_arm_crc = xyes])
|
||||
AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])
|
||||
AM_CONDITIONAL([WORDS_BIGENDIAN],[test x$ac_cv_c_bigendian = xyes])
|
||||
|
||||
AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
|
||||
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
|
||||
@@ -1578,32 +1605,26 @@ AC_SUBST(SSE42_CXXFLAGS)
|
||||
AC_SUBST(SSE41_CXXFLAGS)
|
||||
AC_SUBST(AVX2_CXXFLAGS)
|
||||
AC_SUBST(SHANI_CXXFLAGS)
|
||||
AC_SUBST(ARM_CRC_CXXFLAGS)
|
||||
AC_SUBST(LIBTOOL_APP_LDFLAGS)
|
||||
AC_SUBST(USE_UPNP)
|
||||
AC_SUBST(USE_QRCODE)
|
||||
AC_SUBST(BOOST_LIBS)
|
||||
AC_SUBST(TESTDEFS)
|
||||
AC_SUBST(LEVELDB_TARGET_FLAGS)
|
||||
AC_SUBST(MINIUPNPC_CPPFLAGS)
|
||||
AC_SUBST(MINIUPNPC_LIBS)
|
||||
AC_SUBST(CRYPTO_LIBS)
|
||||
AC_SUBST(SSL_LIBS)
|
||||
AC_SUBST(EVENT_LIBS)
|
||||
AC_SUBST(EVENT_PTHREADS_LIBS)
|
||||
AC_SUBST(ZMQ_LIBS)
|
||||
AC_SUBST(PROTOBUF_LIBS)
|
||||
AC_SUBST(QR_LIBS)
|
||||
AC_SUBST(HAVE_GMTIME_R)
|
||||
AC_SUBST(HAVE_FDATASYNC)
|
||||
AC_SUBST(HAVE_FULLFSYNC)
|
||||
AC_SUBST(HAVE_O_CLOEXEC)
|
||||
AC_SUBST(HAVE_BUILTIN_PREFETCH)
|
||||
AC_SUBST(HAVE_MM_PREFETCH)
|
||||
AC_SUBST(HAVE_STRONG_GETAUXVAL)
|
||||
AC_SUBST(HAVE_WEAK_GETAUXVAL)
|
||||
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
|
||||
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
|
||||
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
|
||||
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
|
||||
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
|
||||
AC_CONFIG_LINKS([test/fuzz/test_runner.py:test/fuzz/test_runner.py])
|
||||
AC_CONFIG_LINKS([test/util/bitcoin-util-test.py:test/util/bitcoin-util-test.py])
|
||||
AC_CONFIG_LINKS([test/util/rpcauth-test.py:test/util/rpcauth-test.py])
|
||||
|
||||
@@ -1639,6 +1660,17 @@ AC_CONFIG_SUBDIRS([src/secp256k1])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
dnl Taken from https://wiki.debian.org/RpathIssue
|
||||
case $host in
|
||||
*-*-linux-gnu)
|
||||
AC_MSG_RESULT([Fixing libtool for -rpath problems.])
|
||||
sed < libtool > libtool-2 \
|
||||
's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
|
||||
mv libtool-2 libtool
|
||||
chmod 755 libtool
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows
|
||||
case ${OS} in
|
||||
*Windows*)
|
||||
@@ -1652,11 +1684,13 @@ echo "Options used to compile and link:"
|
||||
echo " with wallet = $enable_wallet"
|
||||
echo " with gui / qt = $bitcoin_enable_qt"
|
||||
if test x$bitcoin_enable_qt != xno; then
|
||||
echo " with bip70 = $enable_bip70"
|
||||
echo " with qr = $use_qr"
|
||||
fi
|
||||
echo " with zmq = $use_zmq"
|
||||
echo " with test = $use_tests"
|
||||
if test x$use_tests != xno; then
|
||||
echo " with prop = $enable_property_tests"
|
||||
echo " with fuzz = $enable_fuzz"
|
||||
fi
|
||||
echo " with bench = $use_bench"
|
||||
@@ -1668,7 +1702,7 @@ echo " gprof enabled = $enable_gprof"
|
||||
echo " werror = $enable_werror"
|
||||
echo
|
||||
echo " target os = $TARGET_OS"
|
||||
echo " build os = $build_os"
|
||||
echo " build os = $BUILD_OS"
|
||||
echo
|
||||
echo " CC = $CC"
|
||||
echo " CFLAGS = $CFLAGS"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# bash programmable completion for bitcoin-cli(1)
|
||||
# Copyright (c) 2012-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2012-2016 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -17,6 +17,13 @@ _bitcoin_rpc() {
|
||||
$bitcoin_cli "${rpcargs[@]}" "$@"
|
||||
}
|
||||
|
||||
# Add wallet accounts to COMPREPLY
|
||||
_bitcoin_accounts() {
|
||||
local accounts
|
||||
accounts=$(_bitcoin_rpc listaccounts | awk -F '"' '{ print $2 }')
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$accounts" -- "$cur" ) )
|
||||
}
|
||||
|
||||
_bitcoin_cli() {
|
||||
local cur prev words=() cword
|
||||
local bitcoin_cli
|
||||
@@ -53,9 +60,10 @@ _bitcoin_cli() {
|
||||
if ((cword > 3)); then
|
||||
case ${words[cword-3]} in
|
||||
addmultisigaddress)
|
||||
_bitcoin_accounts
|
||||
return 0
|
||||
;;
|
||||
getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaddress|listsinceblock)
|
||||
getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaccount|listreceivedbyaddress|listsinceblock)
|
||||
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
@@ -72,10 +80,14 @@ _bitcoin_cli() {
|
||||
COMPREPLY=( $( compgen -W "add remove" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
fundrawtransaction|getblock|getblockheader|getmempoolancestors|getmempooldescendants|getrawtransaction|gettransaction|listreceivedbyaddress|sendrawtransaction)
|
||||
fundrawtransaction|getblock|getblockheader|getmempoolancestors|getmempooldescendants|getrawtransaction|gettransaction|listaccounts|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction)
|
||||
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
move|setaccount)
|
||||
_bitcoin_accounts
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -84,11 +96,12 @@ _bitcoin_cli() {
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
getaddednodeinfo|getrawmempool|lockunspent)
|
||||
getaddednodeinfo|getrawmempool|lockunspent|setgenerate)
|
||||
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
getbalance|getnewaddress|listtransactions|sendmany)
|
||||
getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany)
|
||||
_bitcoin_accounts
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# bash programmable completion for bitcoind(1) and bitcoin-qt(1)
|
||||
# Copyright (c) 2012-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2012-2016 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -15,7 +15,7 @@ _bitcoind() {
|
||||
_get_comp_words_by_ref -n = cur prev words cword
|
||||
|
||||
case "$cur" in
|
||||
-conf=*|-pid=*|-loadblock=*|-rpccookiefile=*|-wallet=*)
|
||||
-conf=*|-pid=*|-loadblock=*|-rootcertificates=*|-rpccookiefile=*|-wallet=*)
|
||||
cur="${cur#*=}"
|
||||
_filedir
|
||||
return 0
|
||||
|
||||
@@ -5,7 +5,7 @@ Upstream-Contact: Satoshi Nakamoto <satoshin@gmx.com>
|
||||
Source: https://github.com/bitcoin/bitcoin
|
||||
|
||||
Files: *
|
||||
Copyright: 2009-2020, Bitcoin Core Developers
|
||||
Copyright: 2009-2019, Bitcoin Core Developers
|
||||
License: Expat
|
||||
Comment: The Bitcoin Core Developers encompasses the current developers listed on bitcoin.org,
|
||||
as well as the numerous contributors to the project.
|
||||
|
||||
@@ -98,26 +98,22 @@ repository (requires pngcrush).
|
||||
security-check.py and test-security-check.py
|
||||
============================================
|
||||
|
||||
Perform basic security checks on a series of executables.
|
||||
Perform basic ELF security checks on a series of executables.
|
||||
|
||||
symbol-check.py
|
||||
===============
|
||||
|
||||
A script to check that the executables produced by gitian only contain
|
||||
certain symbols and are only linked against allowed libraries.
|
||||
|
||||
For Linux this means checking for allowed gcc, glibc and libstdc++ version symbols.
|
||||
This makes sure they are still compatible with the minimum supported distribution versions.
|
||||
|
||||
For macOS and Windows we check that the executables are only linked against libraries we allow.
|
||||
A script to check that the (Linux) executables produced by gitian only contain
|
||||
allowed gcc, glibc and libstdc++ version symbols. This makes sure they are
|
||||
still compatible with the minimum supported Linux distribution versions.
|
||||
|
||||
Example usage after a gitian build:
|
||||
|
||||
find ../gitian-builder/build -type f -executable | xargs python3 contrib/devtools/symbol-check.py
|
||||
|
||||
If no errors occur the return value will be 0 and the output will be empty.
|
||||
If only supported symbols are used the return value will be 0 and the output will be empty.
|
||||
|
||||
If there are any errors the return value will be 1 and output like this will be printed:
|
||||
If there are 'unsupported' symbols, the return value will be 1 a list like this will be printed:
|
||||
|
||||
.../64/test_bitcoin: symbol memcpy from unsupported version GLIBC_2.14
|
||||
.../64/test_bitcoin: symbol __fdelt_chk from unsupported version GLIBC_2.15
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2016-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2016-2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -19,8 +19,6 @@ EXCLUDE = [
|
||||
'src/qt/bitcoinstrings.cpp',
|
||||
'src/chainparamsseeds.h',
|
||||
# other external copyrights:
|
||||
'src/reverse_iterator.h',
|
||||
'src/test/fuzz/FuzzedDataProvider.h',
|
||||
'src/tinyformat.h',
|
||||
'test/functional/test_framework/bignum.py',
|
||||
# python init:
|
||||
@@ -34,10 +32,9 @@ EXCLUDE_DIRS = [
|
||||
"src/leveldb/",
|
||||
"src/secp256k1/",
|
||||
"src/univalue/",
|
||||
"src/crc32c/",
|
||||
]
|
||||
|
||||
INCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.mm', '*.py', '*.sh', '*.bash-completion']
|
||||
INCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.mm', '*.py']
|
||||
INCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in INCLUDE]))
|
||||
|
||||
def applies_to_file(filename):
|
||||
@@ -458,14 +455,14 @@ CPP_HEADER = '''
|
||||
def get_cpp_header_lines_to_insert(start_year, end_year):
|
||||
return reversed(get_header_lines(CPP_HEADER, start_year, end_year))
|
||||
|
||||
SCRIPT_HEADER = '''
|
||||
PYTHON_HEADER = '''
|
||||
# Copyright (c) %s The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
'''
|
||||
|
||||
def get_script_header_lines_to_insert(start_year, end_year):
|
||||
return reversed(get_header_lines(SCRIPT_HEADER, start_year, end_year))
|
||||
def get_python_header_lines_to_insert(start_year, end_year):
|
||||
return reversed(get_header_lines(PYTHON_HEADER, start_year, end_year))
|
||||
|
||||
################################################################################
|
||||
# query git for year of last change
|
||||
@@ -494,18 +491,17 @@ def file_has_hashbang(file_lines):
|
||||
return False
|
||||
return file_lines[0][:2] == '#!'
|
||||
|
||||
def insert_script_header(filename, file_lines, start_year, end_year):
|
||||
def insert_python_header(filename, file_lines, start_year, end_year):
|
||||
if file_has_hashbang(file_lines):
|
||||
insert_idx = 1
|
||||
else:
|
||||
insert_idx = 0
|
||||
header_lines = get_script_header_lines_to_insert(start_year, end_year)
|
||||
header_lines = get_python_header_lines_to_insert(start_year, end_year)
|
||||
for line in header_lines:
|
||||
file_lines.insert(insert_idx, line)
|
||||
write_file_lines(filename, file_lines)
|
||||
|
||||
def insert_cpp_header(filename, file_lines, start_year, end_year):
|
||||
file_lines.insert(0, '\n')
|
||||
header_lines = get_cpp_header_lines_to_insert(start_year, end_year)
|
||||
for line in header_lines:
|
||||
file_lines.insert(0, line)
|
||||
@@ -517,8 +513,8 @@ def exec_insert_header(filename, style):
|
||||
sys.exit('*** %s already has a copyright by The Bitcoin Core developers'
|
||||
% (filename))
|
||||
start_year, end_year = get_git_change_year_range(filename)
|
||||
if style in ['python', 'shell']:
|
||||
insert_script_header(filename, file_lines, start_year, end_year)
|
||||
if style == 'python':
|
||||
insert_python_header(filename, file_lines, start_year, end_year)
|
||||
else:
|
||||
insert_cpp_header(filename, file_lines, start_year, end_year)
|
||||
|
||||
@@ -559,13 +555,11 @@ def insert_cmd(argv):
|
||||
if not os.path.isfile(filename):
|
||||
sys.exit("*** bad filename: %s" % filename)
|
||||
_, extension = os.path.splitext(filename)
|
||||
if extension not in ['.h', '.cpp', '.cc', '.c', '.py', '.sh']:
|
||||
if extension not in ['.h', '.cpp', '.cc', '.c', '.py']:
|
||||
sys.exit("*** cannot insert for file extension %s" % extension)
|
||||
|
||||
if extension == '.py':
|
||||
style = 'python'
|
||||
elif extension == '.sh':
|
||||
style = 'shell'
|
||||
else:
|
||||
style = 'cpp'
|
||||
exec_insert_header(filename, style)
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2016-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
export LC_ALL=C
|
||||
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#
|
||||
# Build previous releases.
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
CONFIG_FLAGS=""
|
||||
FUNCTIONAL_TESTS=0
|
||||
DELETE_EXISTING=0
|
||||
USE_DEPENDS=0
|
||||
DOWNLOAD_BINARY=0
|
||||
CONFIG_FLAGS=""
|
||||
TARGET="releases"
|
||||
|
||||
while getopts ":hfrdbt:" opt; do
|
||||
case $opt in
|
||||
h)
|
||||
echo "Usage: .previous_release.sh [options] tag1 tag2"
|
||||
echo " options:"
|
||||
echo " -h Print this message"
|
||||
echo " -f Configure for functional tests"
|
||||
echo " -r Remove existing directory"
|
||||
echo " -d Use depends"
|
||||
echo " -b Download release binary"
|
||||
echo " -t Target directory (default: releases)"
|
||||
exit 0
|
||||
;;
|
||||
f)
|
||||
FUNCTIONAL_TESTS=1
|
||||
CONFIG_FLAGS="$CONFIG_FLAGS --without-gui --disable-tests --disable-bench"
|
||||
;;
|
||||
r)
|
||||
DELETE_EXISTING=1
|
||||
;;
|
||||
d)
|
||||
USE_DEPENDS=1
|
||||
;;
|
||||
b)
|
||||
DOWNLOAD_BINARY=1
|
||||
;;
|
||||
t)
|
||||
TARGET=$OPTARG
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND-1))
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Specify release tag(s), e.g.: .previous_release v0.15.1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$TARGET" ]; then
|
||||
mkdir -p $TARGET
|
||||
fi
|
||||
|
||||
if [ "$DOWNLOAD_BINARY" -eq "1" ]; then
|
||||
HOST="${HOST:-$(./depends/config.guess)}"
|
||||
case "$HOST" in
|
||||
x86_64-*-linux*)
|
||||
PLATFORM=x86_64-linux-gnu
|
||||
;;
|
||||
x86_64-apple-darwin*)
|
||||
PLATFORM=osx64
|
||||
;;
|
||||
*)
|
||||
echo "Not sure which binary to download for $HOST."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "Releases directory: $TARGET"
|
||||
pushd "$TARGET" || exit 1
|
||||
{
|
||||
for tag in "$@"
|
||||
do
|
||||
if [ "$DELETE_EXISTING" -eq "1" ]; then
|
||||
if [ -d "$tag" ]; then
|
||||
rm -r "$tag"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$DOWNLOAD_BINARY" -eq "0" ]; then
|
||||
|
||||
if [ ! -d "$tag" ]; then
|
||||
if [ -z $(git tag -l "$tag") ]; then
|
||||
echo "Tag $tag not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git clone https://github.com/bitcoin/bitcoin "$tag"
|
||||
pushd "$tag" || exit 1
|
||||
{
|
||||
git checkout "$tag"
|
||||
if [ "$USE_DEPENDS" -eq "1" ]; then
|
||||
pushd depends || exit 1
|
||||
{
|
||||
if [ "$FUNCTIONAL_TESTS" -eq "1" ]; then
|
||||
make NO_QT=1
|
||||
else
|
||||
make
|
||||
fi
|
||||
HOST="${HOST:-$(./config.guess)}"
|
||||
}
|
||||
popd || exit 1
|
||||
CONFIG_FLAGS="--prefix=$PWD/depends/$HOST $CONFIG_FLAGS"
|
||||
fi
|
||||
./autogen.sh
|
||||
./configure $CONFIG_FLAGS
|
||||
make
|
||||
# Move binaries, so they're in the same place as in the release download:
|
||||
mkdir bin
|
||||
mv src/bitcoind src/bitcoin-cli src/bitcoin-tx bin
|
||||
if [ "$FUNCTIONAL_TESTS" -eq "0" ]; then
|
||||
mv src/qt/bitcoin-qt bin
|
||||
fi
|
||||
}
|
||||
popd || exit 1
|
||||
fi
|
||||
else
|
||||
if [ -d "$tag" ]; then
|
||||
echo "Using cached $tag"
|
||||
else
|
||||
mkdir "$tag"
|
||||
if [[ "$tag" =~ v(.*)(rc[0-9]+)$ ]]; then
|
||||
BIN_PATH="bin/bitcoin-core-${BASH_REMATCH[1]}/test.${BASH_REMATCH[2]}"
|
||||
else
|
||||
BIN_PATH="bin/bitcoin-core-${tag:1}"
|
||||
fi
|
||||
URL="https://bitcoin.org/$BIN_PATH/bitcoin-${tag:1}-$PLATFORM.tar.gz"
|
||||
echo "Fetching: $URL"
|
||||
if ! curl -O -f $URL; then
|
||||
echo "Download failed."
|
||||
exit 1
|
||||
fi
|
||||
tar -zxf "bitcoin-${tag:1}-$PLATFORM.tar.gz" -C "$tag" --strip-components=1 "bitcoin-${tag:1}"
|
||||
rm "bitcoin-${tag:1}-$PLATFORM.tar.gz"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
popd || exit 1
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
||||
# Copyright (c) 2015-2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
'''
|
||||
Perform basic security checks on a series of executables.
|
||||
Perform basic ELF security checks on a series of executables.
|
||||
Exit status will be 0 if successful, and the program will be silent.
|
||||
Otherwise the exit status will be 1 and it will log which executables failed which checks.
|
||||
Needs `readelf` (for ELF), `objdump` (for PE) and `otool` (for MACHO).
|
||||
Needs `readelf` (for ELF) and `objdump` (for PE).
|
||||
'''
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -14,7 +14,6 @@ import os
|
||||
|
||||
READELF_CMD = os.getenv('READELF', '/usr/bin/readelf')
|
||||
OBJDUMP_CMD = os.getenv('OBJDUMP', '/usr/bin/objdump')
|
||||
OTOOL_CMD = os.getenv('OTOOL', '/usr/bin/otool')
|
||||
NONFATAL = {} # checks which are non-fatal for now but only generate a warning
|
||||
|
||||
def check_ELF_PIE(executable):
|
||||
@@ -163,66 +162,6 @@ def check_PE_NX(executable):
|
||||
(arch,bits) = get_PE_dll_characteristics(executable)
|
||||
return (bits & IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) == IMAGE_DLL_CHARACTERISTICS_NX_COMPAT
|
||||
|
||||
def get_MACHO_executable_flags(executable):
|
||||
p = subprocess.Popen([OTOOL_CMD, '-vh', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
|
||||
(stdout, stderr) = p.communicate()
|
||||
if p.returncode:
|
||||
raise IOError('Error opening file')
|
||||
|
||||
flags = []
|
||||
for line in stdout.splitlines():
|
||||
tokens = line.split()
|
||||
# filter first two header lines
|
||||
if 'magic' in tokens or 'Mach' in tokens:
|
||||
continue
|
||||
# filter ncmds and sizeofcmds values
|
||||
flags += [t for t in tokens if not t.isdigit()]
|
||||
return flags
|
||||
|
||||
def check_MACHO_PIE(executable) -> bool:
|
||||
'''
|
||||
Check for position independent executable (PIE), allowing for address space randomization.
|
||||
'''
|
||||
flags = get_MACHO_executable_flags(executable)
|
||||
if 'PIE' in flags:
|
||||
return True
|
||||
return False
|
||||
|
||||
def check_MACHO_NOUNDEFS(executable) -> bool:
|
||||
'''
|
||||
Check for no undefined references.
|
||||
'''
|
||||
flags = get_MACHO_executable_flags(executable)
|
||||
if 'NOUNDEFS' in flags:
|
||||
return True
|
||||
return False
|
||||
|
||||
def check_MACHO_NX(executable) -> bool:
|
||||
'''
|
||||
Check for no stack execution
|
||||
'''
|
||||
flags = get_MACHO_executable_flags(executable)
|
||||
if 'ALLOW_STACK_EXECUTION' in flags:
|
||||
return False
|
||||
return True
|
||||
|
||||
def check_MACHO_LAZY_BINDINGS(executable) -> bool:
|
||||
'''
|
||||
Check for no lazy bindings.
|
||||
We don't use or check for MH_BINDATLOAD. See #18295.
|
||||
'''
|
||||
p = subprocess.Popen([OTOOL_CMD, '-l', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
|
||||
(stdout, stderr) = p.communicate()
|
||||
if p.returncode:
|
||||
raise IOError('Error opening file')
|
||||
|
||||
for line in stdout.splitlines():
|
||||
tokens = line.split()
|
||||
if 'lazy_bind_off' in tokens or 'lazy_bind_size' in tokens:
|
||||
if tokens[1] != '0':
|
||||
return False
|
||||
return True
|
||||
|
||||
CHECKS = {
|
||||
'ELF': [
|
||||
('PIE', check_ELF_PIE),
|
||||
@@ -234,12 +173,6 @@ CHECKS = {
|
||||
('DYNAMIC_BASE', check_PE_DYNAMIC_BASE),
|
||||
('HIGH_ENTROPY_VA', check_PE_HIGH_ENTROPY_VA),
|
||||
('NX', check_PE_NX)
|
||||
],
|
||||
'MACHO': [
|
||||
('PIE', check_MACHO_PIE),
|
||||
('NOUNDEFS', check_MACHO_NOUNDEFS),
|
||||
('NX', check_MACHO_NX),
|
||||
('LAZY_BINDINGS', check_MACHO_LAZY_BINDINGS)
|
||||
]
|
||||
}
|
||||
|
||||
@@ -250,8 +183,6 @@ def identify_executable(executable):
|
||||
return 'PE'
|
||||
elif magic.startswith(b'\x7fELF'):
|
||||
return 'ELF'
|
||||
elif magic.startswith(b'\xcf\xfa'):
|
||||
return 'MACHO'
|
||||
return None
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
'''
|
||||
A script to check that the executables produced by gitian only contain
|
||||
certain symbols and are only linked against allowed libraries.
|
||||
A script to check that the (Linux) executables produced by gitian only contain
|
||||
allowed gcc, glibc and libstdc++ version symbols. This makes sure they are
|
||||
still compatible with the minimum supported Linux distribution versions.
|
||||
|
||||
Example usage:
|
||||
|
||||
@@ -14,32 +15,31 @@ import subprocess
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
from typing import List, Optional, Tuple
|
||||
|
||||
# Debian 8 (Jessie) EOL: 2020. https://wiki.debian.org/DebianReleases#Production_Releases
|
||||
# Debian 6.0.9 (Squeeze) has:
|
||||
#
|
||||
# - g++ version 4.9.2 (https://packages.debian.org/search?suite=jessie&arch=any&searchon=names&keywords=g%2B%2B)
|
||||
# - libc version 2.19 (https://packages.debian.org/search?suite=jessie&arch=any&searchon=names&keywords=libc6)
|
||||
# - g++ version 4.4.5 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=g%2B%2B)
|
||||
# - libc version 2.11.3 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=libc6)
|
||||
# - libstdc++ version 4.4.5 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=libstdc%2B%2B6)
|
||||
#
|
||||
# Ubuntu 16.04 (Xenial) EOL: 2024. https://wiki.ubuntu.com/Releases
|
||||
# Ubuntu 10.04.4 (Lucid Lynx) has:
|
||||
#
|
||||
# - g++ version 5.3.1 (https://packages.ubuntu.com/search?keywords=g%2B%2B&searchon=names&suite=xenial§ion=all)
|
||||
# - libc version 2.23.0 (https://packages.ubuntu.com/search?keywords=libc6&searchon=names&suite=xenial§ion=all)
|
||||
#
|
||||
# CentOS 7 EOL: 2024. https://wiki.centos.org/FAQ/General
|
||||
#
|
||||
# - g++ version 4.8.5 (http://mirror.centos.org/centos/7/os/x86_64/Packages/)
|
||||
# - libc version 2.17 (http://mirror.centos.org/centos/7/os/x86_64/Packages/)
|
||||
# - g++ version 4.4.3 (http://packages.ubuntu.com/search?keywords=g%2B%2B&searchon=names&suite=lucid§ion=all)
|
||||
# - libc version 2.11.1 (http://packages.ubuntu.com/search?keywords=libc6&searchon=names&suite=lucid§ion=all)
|
||||
# - libstdc++ version 4.4.3 (http://packages.ubuntu.com/search?suite=lucid§ion=all&arch=any&keywords=libstdc%2B%2B&searchon=names)
|
||||
#
|
||||
# Taking the minimum of these as our target.
|
||||
#
|
||||
# According to GNU ABI document (https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) this corresponds to:
|
||||
# GCC 4.8.5: GCC_4.8.0
|
||||
# (glibc) GLIBC_2_17
|
||||
# According to GNU ABI document (http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) this corresponds to:
|
||||
# GCC 4.4.0: GCC_4.4.0
|
||||
# GCC 4.4.2: GLIBCXX_3.4.13, CXXABI_1.3.3
|
||||
# (glibc) GLIBC_2_11
|
||||
#
|
||||
MAX_VERSIONS = {
|
||||
'GCC': (4,8,0),
|
||||
'GLIBC': (2,17),
|
||||
'GCC': (4,4,0),
|
||||
'CXXABI': (1,3,3),
|
||||
'GLIBCXX': (3,4,13),
|
||||
'GLIBC': (2,11),
|
||||
'LIBATOMIC': (1,0)
|
||||
}
|
||||
# See here for a description of _IO_stdin_used:
|
||||
@@ -47,20 +47,17 @@ MAX_VERSIONS = {
|
||||
|
||||
# Ignore symbols that are exported as part of every executable
|
||||
IGNORE_EXPORTS = {
|
||||
'_edata', '_end', '__end__', '_init', '__bss_start', '__bss_start__', '_bss_end__', '__bss_end__', '_fini', '_IO_stdin_used', 'stdin', 'stdout', 'stderr',
|
||||
'environ', '_environ', '__environ',
|
||||
'_edata', '_end', '__end__', '_init', '__bss_start', '__bss_start__', '_bss_end__', '__bss_end__', '_fini', '_IO_stdin_used', 'stdin', 'stdout', 'stderr'
|
||||
}
|
||||
READELF_CMD = os.getenv('READELF', '/usr/bin/readelf')
|
||||
CPPFILT_CMD = os.getenv('CPPFILT', '/usr/bin/c++filt')
|
||||
OBJDUMP_CMD = os.getenv('OBJDUMP', '/usr/bin/objdump')
|
||||
OTOOL_CMD = os.getenv('OTOOL', '/usr/bin/otool')
|
||||
|
||||
# Allowed NEEDED libraries
|
||||
ELF_ALLOWED_LIBRARIES = {
|
||||
ALLOWED_LIBRARIES = {
|
||||
# bitcoind and bitcoin-qt
|
||||
'libgcc_s.so.1', # GCC base support
|
||||
'libc.so.6', # C library
|
||||
'libpthread.so.0', # threading
|
||||
'libanl.so.1', # DNS resolve
|
||||
'libm.so.6', # math library
|
||||
'librt.so.1', # real-time (clock)
|
||||
'libatomic.so.1',
|
||||
@@ -82,45 +79,6 @@ ARCH_MIN_GLIBC_VER = {
|
||||
'AArch64':(2,17),
|
||||
'RISC-V': (2,27)
|
||||
}
|
||||
|
||||
MACHO_ALLOWED_LIBRARIES = {
|
||||
# bitcoind and bitcoin-qt
|
||||
'libc++.1.dylib', # C++ Standard Library
|
||||
'libSystem.B.dylib', # libc, libm, libpthread, libinfo
|
||||
# bitcoin-qt only
|
||||
'AppKit', # user interface
|
||||
'ApplicationServices', # common application tasks.
|
||||
'Carbon', # deprecated c back-compat API
|
||||
'CoreFoundation', # low level func, data types
|
||||
'CoreGraphics', # 2D rendering
|
||||
'CoreServices', # operating system services
|
||||
'CoreText', # interface for laying out text and handling fonts.
|
||||
'Foundation', # base layer functionality for apps/frameworks
|
||||
'ImageIO', # read and write image file formats.
|
||||
'IOKit', # user-space access to hardware devices and drivers.
|
||||
'libobjc.A.dylib', # Objective-C runtime library
|
||||
}
|
||||
|
||||
PE_ALLOWED_LIBRARIES = {
|
||||
'ADVAPI32.dll', # security & registry
|
||||
'IPHLPAPI.DLL', # IP helper API
|
||||
'KERNEL32.dll', # win32 base APIs
|
||||
'msvcrt.dll', # C standard library for MSVC
|
||||
'SHELL32.dll', # shell API
|
||||
'USER32.dll', # user interface
|
||||
'WS2_32.dll', # sockets
|
||||
# bitcoin-qt only
|
||||
'dwmapi.dll', # desktop window manager
|
||||
'GDI32.dll', # graphics device interface
|
||||
'IMM32.dll', # input method editor
|
||||
'ole32.dll', # component object model
|
||||
'OLEAUT32.dll', # OLE Automation API
|
||||
'SHLWAPI.dll', # light weight shell API
|
||||
'UxTheme.dll',
|
||||
'VERSION.dll', # version checking
|
||||
'WINMM.dll', # WinMM audio API
|
||||
}
|
||||
|
||||
class CPPFilt(object):
|
||||
'''
|
||||
Demangle C++ symbol names.
|
||||
@@ -140,15 +98,15 @@ class CPPFilt(object):
|
||||
self.proc.stdout.close()
|
||||
self.proc.wait()
|
||||
|
||||
def read_symbols(executable, imports=True) -> List[Tuple[str, str, str]]:
|
||||
def read_symbols(executable, imports=True):
|
||||
'''
|
||||
Parse an ELF executable and return a list of (symbol,version, arch) tuples
|
||||
Parse an ELF executable and return a list of (symbol,version) tuples
|
||||
for dynamic, imported symbols.
|
||||
'''
|
||||
p = subprocess.Popen([READELF_CMD, '--dyn-syms', '-W', '-h', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
|
||||
(stdout, stderr) = p.communicate()
|
||||
if p.returncode:
|
||||
raise IOError('Could not read symbols for {}: {}'.format(executable, stderr.strip()))
|
||||
raise IOError('Could not read symbols for %s: %s' % (executable, stderr.strip()))
|
||||
syms = []
|
||||
for line in stdout.splitlines():
|
||||
line = line.split()
|
||||
@@ -163,7 +121,7 @@ def read_symbols(executable, imports=True) -> List[Tuple[str, str, str]]:
|
||||
syms.append((sym, version, arch))
|
||||
return syms
|
||||
|
||||
def check_version(max_versions, version, arch) -> bool:
|
||||
def check_version(max_versions, version, arch):
|
||||
if '_' in version:
|
||||
(lib, _, ver) = version.rpartition('_')
|
||||
else:
|
||||
@@ -174,7 +132,7 @@ def check_version(max_versions, version, arch) -> bool:
|
||||
return False
|
||||
return ver <= max_versions[lib] or lib == 'GLIBC' and ver <= ARCH_MIN_GLIBC_VER[arch]
|
||||
|
||||
def elf_read_libraries(filename) -> List[str]:
|
||||
def read_libraries(filename):
|
||||
p = subprocess.Popen([READELF_CMD, '-d', '-W', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
|
||||
(stdout, stderr) = p.communicate()
|
||||
if p.returncode:
|
||||
@@ -190,117 +148,26 @@ def elf_read_libraries(filename) -> List[str]:
|
||||
raise ValueError('Unparseable (NEEDED) specification')
|
||||
return libraries
|
||||
|
||||
def check_imported_symbols(filename) -> bool:
|
||||
cppfilt = CPPFilt()
|
||||
ok = True
|
||||
for sym, version, arch in read_symbols(filename, True):
|
||||
if version and not check_version(MAX_VERSIONS, version, arch):
|
||||
print('{}: symbol {} from unsupported version {}'.format(filename, cppfilt(sym), version))
|
||||
ok = False
|
||||
return ok
|
||||
|
||||
def check_exported_symbols(filename) -> bool:
|
||||
cppfilt = CPPFilt()
|
||||
ok = True
|
||||
for sym,version,arch in read_symbols(filename, False):
|
||||
if arch == 'RISC-V' or sym in IGNORE_EXPORTS:
|
||||
continue
|
||||
print('{}: export of symbol {} not allowed'.format(filename, cppfilt(sym)))
|
||||
ok = False
|
||||
return ok
|
||||
|
||||
def check_ELF_libraries(filename) -> bool:
|
||||
ok = True
|
||||
for library_name in elf_read_libraries(filename):
|
||||
if library_name not in ELF_ALLOWED_LIBRARIES:
|
||||
print('{}: NEEDED library {} is not allowed'.format(filename, library_name))
|
||||
ok = False
|
||||
return ok
|
||||
|
||||
def macho_read_libraries(filename) -> List[str]:
|
||||
p = subprocess.Popen([OTOOL_CMD, '-L', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
|
||||
(stdout, stderr) = p.communicate()
|
||||
if p.returncode:
|
||||
raise IOError('Error opening file')
|
||||
libraries = []
|
||||
for line in stdout.splitlines():
|
||||
tokens = line.split()
|
||||
if len(tokens) == 1: # skip executable name
|
||||
continue
|
||||
libraries.append(tokens[0].split('/')[-1])
|
||||
return libraries
|
||||
|
||||
def check_MACHO_libraries(filename) -> bool:
|
||||
ok = True
|
||||
for dylib in macho_read_libraries(filename):
|
||||
if dylib not in MACHO_ALLOWED_LIBRARIES:
|
||||
print('{} is not in ALLOWED_LIBRARIES!'.format(dylib))
|
||||
ok = False
|
||||
return ok
|
||||
|
||||
def pe_read_libraries(filename) -> List[str]:
|
||||
p = subprocess.Popen([OBJDUMP_CMD, '-x', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
|
||||
(stdout, stderr) = p.communicate()
|
||||
if p.returncode:
|
||||
raise IOError('Error opening file')
|
||||
libraries = []
|
||||
for line in stdout.splitlines():
|
||||
if 'DLL Name:' in line:
|
||||
tokens = line.split(': ')
|
||||
libraries.append(tokens[1])
|
||||
return libraries
|
||||
|
||||
def check_PE_libraries(filename) -> bool:
|
||||
ok = True
|
||||
for dylib in pe_read_libraries(filename):
|
||||
if dylib not in PE_ALLOWED_LIBRARIES:
|
||||
print('{} is not in ALLOWED_LIBRARIES!'.format(dylib))
|
||||
ok = False
|
||||
return ok
|
||||
|
||||
CHECKS = {
|
||||
'ELF': [
|
||||
('IMPORTED_SYMBOLS', check_imported_symbols),
|
||||
('EXPORTED_SYMBOLS', check_exported_symbols),
|
||||
('LIBRARY_DEPENDENCIES', check_ELF_libraries)
|
||||
],
|
||||
'MACHO': [
|
||||
('DYNAMIC_LIBRARIES', check_MACHO_libraries)
|
||||
],
|
||||
'PE' : [
|
||||
('DYNAMIC_LIBRARIES', check_PE_libraries)
|
||||
]
|
||||
}
|
||||
|
||||
def identify_executable(executable) -> Optional[str]:
|
||||
with open(filename, 'rb') as f:
|
||||
magic = f.read(4)
|
||||
if magic.startswith(b'MZ'):
|
||||
return 'PE'
|
||||
elif magic.startswith(b'\x7fELF'):
|
||||
return 'ELF'
|
||||
elif magic.startswith(b'\xcf\xfa'):
|
||||
return 'MACHO'
|
||||
return None
|
||||
|
||||
if __name__ == '__main__':
|
||||
cppfilt = CPPFilt()
|
||||
retval = 0
|
||||
for filename in sys.argv[1:]:
|
||||
try:
|
||||
etype = identify_executable(filename)
|
||||
if etype is None:
|
||||
print('{}: unknown format'.format(filename))
|
||||
# Check imported symbols
|
||||
for sym,version,arch in read_symbols(filename, True):
|
||||
if version and not check_version(MAX_VERSIONS, version, arch):
|
||||
print('%s: symbol %s from unsupported version %s' % (filename, cppfilt(sym), version))
|
||||
retval = 1
|
||||
# Check exported symbols
|
||||
if arch != 'RISC-V':
|
||||
for sym,version,arch in read_symbols(filename, False):
|
||||
if sym in IGNORE_EXPORTS:
|
||||
continue
|
||||
print('%s: export of symbol %s not allowed' % (filename, cppfilt(sym)))
|
||||
retval = 1
|
||||
# Check dependency libraries
|
||||
for library_name in read_libraries(filename):
|
||||
if library_name not in ALLOWED_LIBRARIES:
|
||||
print('%s: NEEDED library %s is not allowed' % (filename, library_name))
|
||||
retval = 1
|
||||
continue
|
||||
|
||||
failed = []
|
||||
for (name, func) in CHECKS[etype]:
|
||||
if not func(filename):
|
||||
failed.append(name)
|
||||
if failed:
|
||||
print('{}: failed {}'.format(filename, ' '.join(failed)))
|
||||
retval = 1
|
||||
except IOError:
|
||||
print('{}: cannot open'.format(filename))
|
||||
retval = 1
|
||||
sys.exit(retval)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2015-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2015-2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
'''
|
||||
@@ -43,35 +43,16 @@ class TestSecurityChecks(unittest.TestCase):
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE']),
|
||||
(0, ''))
|
||||
|
||||
def test_PE(self):
|
||||
def test_64bit_PE(self):
|
||||
source = 'test1.c'
|
||||
executable = 'test1.exe'
|
||||
cc = 'x86_64-w64-mingw32-gcc'
|
||||
write_testcode(source)
|
||||
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--no-nxcompat','-Wl,--no-dynamicbase','-Wl,--no-high-entropy-va']),
|
||||
(1, executable+': failed DYNAMIC_BASE HIGH_ENTROPY_VA NX'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--no-dynamicbase','-Wl,--no-high-entropy-va']),
|
||||
(1, executable+': failed DYNAMIC_BASE HIGH_ENTROPY_VA'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--dynamicbase','-Wl,--no-high-entropy-va']),
|
||||
(1, executable+': failed HIGH_ENTROPY_VA'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--dynamicbase','-Wl,--high-entropy-va']),
|
||||
(0, ''))
|
||||
|
||||
def test_MACHO(self):
|
||||
source = 'test1.c'
|
||||
executable = 'test1'
|
||||
cc = 'clang'
|
||||
write_testcode(source)
|
||||
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace', '-Wl,-allow_stack_execute']),
|
||||
(1, executable+': failed PIE NOUNDEFS NX'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace']),
|
||||
(1, executable+': failed PIE NOUNDEFS'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie']),
|
||||
(1, executable+': failed PIE'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie']),
|
||||
(0, ''))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--no-nxcompat','-Wl,--no-dynamicbase','-Wl,--no-high-entropy-va']), (1, executable+': failed DYNAMIC_BASE HIGH_ENTROPY_VA NX'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--no-dynamicbase','-Wl,--no-high-entropy-va']), (1, executable+': failed DYNAMIC_BASE HIGH_ENTROPY_VA'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--dynamicbase','-Wl,--no-high-entropy-va']), (1, executable+': failed HIGH_ENTROPY_VA'))
|
||||
self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--dynamicbase','-Wl,--high-entropy-va']), (0, ''))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -21,8 +21,8 @@ NON_DETERMINISTIC_TESTS=(
|
||||
"miner_tests/CreateNewBlock_validity" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"scheduler_tests/manythreads" # scheduler.cpp: CScheduler::serviceQueue()
|
||||
"scheduler_tests/singlethreadedscheduler_ordered" # scheduler.cpp: CScheduler::serviceQueue()
|
||||
"txvalidationcache_tests/checkinputs_test" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"txvalidationcache_tests/tx_mempool_block_doublespend" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"tx_validationcache_tests/checkinputs_test" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"tx_validationcache_tests/tx_mempool_block_doublespend" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"txindex_tests/txindex_initial_sync" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"txvalidation_tests/tx_mempool_reject_coinbase" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
"validation_block_tests/processnewblock_signals_ordering" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10)
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#
|
||||
export LC_ALL=C
|
||||
|
||||
set -ueo pipefail
|
||||
|
||||
if (( $# < 3 )); then
|
||||
echo 'Usage: utxo_snapshot.sh <generate-at-height> <snapshot-out-path> <bitcoin-cli-call ...>'
|
||||
echo
|
||||
echo " if <snapshot-out-path> is '-', don't produce a snapshot file but instead print the "
|
||||
echo " expected assumeutxo hash"
|
||||
echo
|
||||
echo 'Examples:'
|
||||
echo
|
||||
echo " ./contrib/devtools/utxo_snapshot.sh 570000 utxo.dat ./src/bitcoin-cli -datadir=\$(pwd)/testdata"
|
||||
echo ' ./contrib/devtools/utxo_snapshot.sh 570000 - ./src/bitcoin-cli'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GENERATE_AT_HEIGHT="${1}"; shift;
|
||||
OUTPUT_PATH="${1}"; shift;
|
||||
# Most of the calls we make take a while to run, so pad with a lengthy timeout.
|
||||
BITCOIN_CLI_CALL="${*} -rpcclienttimeout=9999999"
|
||||
|
||||
# Block we'll invalidate/reconsider to rewind/fast-forward the chain.
|
||||
PIVOT_BLOCKHASH=$($BITCOIN_CLI_CALL getblockhash $(( GENERATE_AT_HEIGHT + 1 )) )
|
||||
|
||||
(>&2 echo "Rewinding chain back to height ${GENERATE_AT_HEIGHT} (by invalidating ${PIVOT_BLOCKHASH}); this may take a while")
|
||||
${BITCOIN_CLI_CALL} invalidateblock "${PIVOT_BLOCKHASH}"
|
||||
|
||||
if [[ "${OUTPUT_PATH}" = "-" ]]; then
|
||||
(>&2 echo "Generating txoutset info...")
|
||||
${BITCOIN_CLI_CALL} gettxoutsetinfo | grep hash_serialized_2 | sed 's/^.*: "\(.\+\)\+",/\1/g'
|
||||
else
|
||||
(>&2 echo "Generating UTXO snapshot...")
|
||||
${BITCOIN_CLI_CALL} dumptxoutset "${OUTPUT_PATH}"
|
||||
fi
|
||||
|
||||
(>&2 echo "Restoring chain to original height; this may take a while")
|
||||
${BITCOIN_CLI_CALL} reconsiderblock "${PIVOT_BLOCKHASH}"
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2017-2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
import argparse
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
@@ -54,8 +51,10 @@ def build():
|
||||
os.chdir('gitian-builder')
|
||||
os.makedirs('inputs', exist_ok=True)
|
||||
|
||||
subprocess.check_call(['wget', '-O', 'inputs/osslsigncode-2.0.tar.gz', 'https://github.com/mtrojnar/osslsigncode/archive/2.0.tar.gz'])
|
||||
subprocess.check_call(["echo '5a60e0a4b3e0b4d655317b2f12a810211c50242138322b16e7e01c6fbb89d92f inputs/osslsigncode-2.0.tar.gz' | sha256sum -c"], shell=True)
|
||||
subprocess.check_call(['wget', '-N', '-P', 'inputs', 'https://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz'])
|
||||
subprocess.check_call(['wget', '-N', '-P', 'inputs', 'https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch'])
|
||||
subprocess.check_call(["echo 'a8c4e9cafba922f89de0df1f2152e7be286aba73f78505169bc351a7938dd911 inputs/osslsigncode-Backports-to-1.7.1.patch' | sha256sum -c"], shell=True)
|
||||
subprocess.check_call(["echo 'f9a8cdb38b9c309326764ebc937cba1523a3a751a7ab05df3ecc99d18ae466c9 inputs/osslsigncode-1.7.1.tar.gz' | sha256sum -c"], shell=True)
|
||||
subprocess.check_call(['make', '-C', '../bitcoin/depends', 'download', 'SOURCES_PATH=' + os.getcwd() + '/cache/common'])
|
||||
|
||||
if args.linux:
|
||||
@@ -209,7 +208,7 @@ def main():
|
||||
args.macos = 'm' in args.os
|
||||
|
||||
# Disable for MacOS if no SDK found
|
||||
if args.macos and not os.path.isfile('gitian-builder/inputs/MacOSX10.14.sdk.tar.gz'):
|
||||
if args.macos and not os.path.isfile('gitian-builder/inputs/MacOSX10.11.sdk.tar.gz'):
|
||||
print('Cannot build for MacOS, SDK does not exist. Will build for other OSes')
|
||||
args.macos = False
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: "bitcoin-core-linux-0.20"
|
||||
name: "bitcoin-core-linux-0.19"
|
||||
enable_cache: true
|
||||
distro: "ubuntu"
|
||||
suites:
|
||||
@@ -40,18 +40,18 @@ script: |
|
||||
set -e -o pipefail
|
||||
|
||||
WRAP_DIR=$HOME/wrapped
|
||||
HOSTS="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu"
|
||||
HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu"
|
||||
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
|
||||
FAKETIME_HOST_PROGS="gcc g++"
|
||||
FAKETIME_PROGS="date ar ranlib nm"
|
||||
HOST_CFLAGS="-O2 -g"
|
||||
HOST_CXXFLAGS="-O2 -g"
|
||||
HOST_LDFLAGS_BASE="-static-libstdc++"
|
||||
HOST_LDFLAGS=-static-libstdc++
|
||||
|
||||
export QT_RCC_TEST=1
|
||||
export QT_RCC_SOURCE_DATE_OVERRIDE=1
|
||||
export TZ="UTC"
|
||||
export BUILD_DIR="$PWD"
|
||||
export BUILD_DIR=`pwd`
|
||||
mkdir -p ${WRAP_DIR}
|
||||
if test -n "$GBUILD_CACHE_ENABLED"; then
|
||||
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
|
||||
@@ -59,12 +59,11 @@ script: |
|
||||
mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
|
||||
fi
|
||||
|
||||
# Use $LIB in LD_PRELOAD to avoid hardcoding the dir (See `man ld.so`)
|
||||
function create_global_faketime_wrappers {
|
||||
for prog in ${FAKETIME_PROGS}; do
|
||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
|
||||
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
|
||||
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
|
||||
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
|
||||
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
|
||||
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
|
||||
chmod +x ${WRAP_DIR}/${prog}
|
||||
@@ -78,7 +77,7 @@ script: |
|
||||
then
|
||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
|
||||
echo "REAL=\`which -a ${i}-${prog}-8 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
|
||||
chmod +x ${WRAP_DIR}/${i}-${prog}
|
||||
@@ -108,7 +107,7 @@ script: |
|
||||
rm -f ${WRAP_DIR}/${prog}
|
||||
cat << EOF > ${WRAP_DIR}/${prog}
|
||||
#!/usr/bin/env bash
|
||||
REAL="$(which -a ${prog}-8 | grep -v ${WRAP_DIR}/${prog} | head -1)"
|
||||
REAL="`which -a ${prog}-8 | grep -v ${WRAP_DIR}/${prog} | head -1`"
|
||||
for var in "\$@"
|
||||
do
|
||||
if [ "\$var" = "-m32" ]; then
|
||||
@@ -123,7 +122,7 @@ script: |
|
||||
done
|
||||
|
||||
cd bitcoin
|
||||
BASEPREFIX="${PWD}/depends"
|
||||
BASEPREFIX=`pwd`/depends
|
||||
# Build dependencies for each host
|
||||
for i in $HOSTS; do
|
||||
EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
|
||||
@@ -142,10 +141,16 @@ script: |
|
||||
|
||||
# Create the release tarball using (arbitrarily) the first host
|
||||
./autogen.sh
|
||||
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
|
||||
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
|
||||
make dist
|
||||
SOURCEDIST=$(echo bitcoin-*.tar.gz)
|
||||
DISTNAME=${SOURCEDIST/%.tar.gz}
|
||||
SOURCEDIST=`echo bitcoin-*.tar.gz`
|
||||
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
|
||||
# Correct tar file order
|
||||
mkdir -p temp
|
||||
pushd temp
|
||||
tar -xf ../$SOURCEDIST
|
||||
find bitcoin-* | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
|
||||
popd
|
||||
|
||||
# Workaround for tarball not building with the bare tag version (prep)
|
||||
make -C src obj/build.h
|
||||
@@ -154,16 +159,9 @@ script: |
|
||||
# Extract the release tarball into a dir for each host and build
|
||||
for i in ${HOSTS}; do
|
||||
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
|
||||
if [ "${i}" = "riscv64-linux-gnu" ]; then
|
||||
# Workaround for https://bugs.launchpad.net/ubuntu/+source/gcc-8-cross-ports/+bug/1853740
|
||||
# TODO: remove this when no longer needed
|
||||
HOST_LDFLAGS="${HOST_LDFLAGS_BASE} -Wl,-z,noexecstack"
|
||||
else
|
||||
HOST_LDFLAGS="${HOST_LDFLAGS_BASE}"
|
||||
fi
|
||||
mkdir -p distsrc-${i}
|
||||
cd distsrc-${i}
|
||||
INSTALLPATH="${PWD}/installed/${DISTNAME}"
|
||||
INSTALLPATH=`pwd`/installed/${DISTNAME}
|
||||
mkdir -p ${INSTALLPATH}
|
||||
tar --strip-components=1 -xf ../$SOURCEDIST
|
||||
|
||||
@@ -183,12 +181,11 @@ script: |
|
||||
rm -rf ${DISTNAME}/lib/pkgconfig
|
||||
find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
|
||||
find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
|
||||
cp ../../README.md ${DISTNAME}/
|
||||
cp ../doc/README.md ${DISTNAME}/
|
||||
find ${DISTNAME} -not -name "*.dbg" | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
|
||||
find ${DISTNAME} -name "*.dbg" | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz
|
||||
cd ../../
|
||||
rm -rf distsrc-${i}
|
||||
done
|
||||
|
||||
mkdir -p ${OUTDIR}/src
|
||||
git archive --prefix="${DISTNAME}/" --output=${OUTDIR}/src/${DISTNAME}.tar.gz HEAD
|
||||
mkdir -p $OUTDIR/src
|
||||
mv $SOURCEDIST $OUTDIR/src
|
||||
|
||||
@@ -7,13 +7,9 @@ architectures:
|
||||
- "amd64"
|
||||
packages:
|
||||
- "faketime"
|
||||
- "python3-pip"
|
||||
remotes:
|
||||
- "url": "https://github.com/bitcoin-core/bitcoin-detached-sigs.git"
|
||||
"dir": "signature"
|
||||
- "url": "https://github.com/achow101/signapple.git"
|
||||
"dir": "signapple"
|
||||
"commit": "b084cbbf44d5330448ffce0c7d118f75781b64bd"
|
||||
files:
|
||||
- "bitcoin-osx-unsigned.tar.gz"
|
||||
script: |
|
||||
@@ -21,32 +17,24 @@ script: |
|
||||
|
||||
WRAP_DIR=$HOME/wrapped
|
||||
mkdir -p ${WRAP_DIR}
|
||||
export PATH="$PWD":$PATH
|
||||
export PATH=`pwd`:$PATH
|
||||
FAKETIME_PROGS="dmg genisoimage"
|
||||
|
||||
# Create global faketime wrappers
|
||||
for prog in ${FAKETIME_PROGS}; do
|
||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
|
||||
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
|
||||
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
|
||||
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
|
||||
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog}
|
||||
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
|
||||
chmod +x ${WRAP_DIR}/${prog}
|
||||
done
|
||||
|
||||
# Install signapple
|
||||
cd signapple
|
||||
python3 -m pip install -U pip setuptools
|
||||
python3 -m pip install .
|
||||
export PATH="$HOME/.local/bin":$PATH
|
||||
cd ..
|
||||
|
||||
UNSIGNED_TARBALL=bitcoin-osx-unsigned.tar.gz
|
||||
UNSIGNED_APP=dist/Bitcoin-Qt.app
|
||||
UNSIGNED=bitcoin-osx-unsigned.tar.gz
|
||||
SIGNED=bitcoin-osx-signed.dmg
|
||||
|
||||
tar -xf ${UNSIGNED_TARBALL}
|
||||
tar -xf ${UNSIGNED}
|
||||
OSX_VOLNAME="$(cat osx_volname)"
|
||||
./detached-sig-apply.sh ${UNSIGNED_APP} signature/osx/dist
|
||||
./detached-sig-apply.sh ${UNSIGNED} signature/osx
|
||||
${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "${OSX_VOLNAME}" -no-pad -r -dir-mode 0755 -apple -o uncompressed.dmg signed-app
|
||||
${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: "bitcoin-core-osx-0.20"
|
||||
name: "bitcoin-core-osx-0.19"
|
||||
enable_cache: true
|
||||
distro: "ubuntu"
|
||||
suites:
|
||||
@@ -32,12 +32,12 @@ remotes:
|
||||
- "url": "https://github.com/bitcoin/bitcoin.git"
|
||||
"dir": "bitcoin"
|
||||
files:
|
||||
- "MacOSX10.14.sdk.tar.gz"
|
||||
- "MacOSX10.11.sdk.tar.gz"
|
||||
script: |
|
||||
set -e -o pipefail
|
||||
|
||||
WRAP_DIR=$HOME/wrapped
|
||||
HOSTS="x86_64-apple-darwin16"
|
||||
HOSTS="x86_64-apple-darwin14"
|
||||
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage"
|
||||
FAKETIME_HOST_PROGS=""
|
||||
FAKETIME_PROGS="ar ranlib date dmg genisoimage"
|
||||
@@ -45,7 +45,7 @@ script: |
|
||||
export QT_RCC_TEST=1
|
||||
export QT_RCC_SOURCE_DATE_OVERRIDE=1
|
||||
export TZ="UTC"
|
||||
export BUILD_DIR="$PWD"
|
||||
export BUILD_DIR=`pwd`
|
||||
mkdir -p ${WRAP_DIR}
|
||||
if test -n "$GBUILD_CACHE_ENABLED"; then
|
||||
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
|
||||
@@ -55,12 +55,11 @@ script: |
|
||||
|
||||
export ZERO_AR_DATE=1
|
||||
|
||||
# Use $LIB in LD_PRELOAD to avoid hardcoding the dir (See `man ld.so`)
|
||||
function create_global_faketime_wrappers {
|
||||
for prog in ${FAKETIME_PROGS}; do
|
||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
|
||||
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
|
||||
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
|
||||
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
|
||||
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
|
||||
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
|
||||
chmod +x ${WRAP_DIR}/${prog}
|
||||
@@ -72,7 +71,7 @@ script: |
|
||||
for prog in ${FAKETIME_HOST_PROGS}; do
|
||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
|
||||
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
|
||||
chmod +x ${WRAP_DIR}/${i}-${prog}
|
||||
@@ -87,10 +86,10 @@ script: |
|
||||
export PATH=${WRAP_DIR}:${PATH}
|
||||
|
||||
cd bitcoin
|
||||
BASEPREFIX="${PWD}/depends"
|
||||
BASEPREFIX=`pwd`/depends
|
||||
|
||||
mkdir -p ${BASEPREFIX}/SDKs
|
||||
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.14.sdk.tar.gz
|
||||
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz
|
||||
|
||||
# Build dependencies for each host
|
||||
for i in $HOSTS; do
|
||||
@@ -105,10 +104,17 @@ script: |
|
||||
|
||||
# Create the release tarball using (arbitrarily) the first host
|
||||
./autogen.sh
|
||||
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
|
||||
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
|
||||
make dist
|
||||
SOURCEDIST=$(echo bitcoin-*.tar.gz)
|
||||
DISTNAME=${SOURCEDIST/%.tar.gz}
|
||||
SOURCEDIST=`echo bitcoin-*.tar.gz`
|
||||
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
|
||||
|
||||
# Correct tar file order
|
||||
mkdir -p temp
|
||||
pushd temp
|
||||
tar -xf ../$SOURCEDIST
|
||||
find bitcoin-* | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
|
||||
popd
|
||||
|
||||
# Workaround for tarball not building with the bare tag version (prep)
|
||||
make -C src obj/build.h
|
||||
@@ -119,7 +125,7 @@ script: |
|
||||
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
|
||||
mkdir -p distsrc-${i}
|
||||
cd distsrc-${i}
|
||||
INSTALLPATH="${PWD}/installed/${DISTNAME}"
|
||||
INSTALLPATH=`pwd`/installed/${DISTNAME}
|
||||
mkdir -p ${INSTALLPATH}
|
||||
tar --strip-components=1 -xf ../$SOURCEDIST
|
||||
|
||||
@@ -130,8 +136,6 @@ script: |
|
||||
|
||||
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
|
||||
make ${MAKEOPTS}
|
||||
make ${MAKEOPTS} -C src check-security
|
||||
make ${MAKEOPTS} -C src check-symbols
|
||||
make install-strip DESTDIR=${INSTALLPATH}
|
||||
|
||||
make osx_volname
|
||||
@@ -142,6 +146,8 @@ script: |
|
||||
cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}
|
||||
cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}
|
||||
cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}
|
||||
cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate
|
||||
cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff
|
||||
mv dist unsigned-app-${i}
|
||||
pushd unsigned-app-${i}
|
||||
find . | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-osx-unsigned.tar.gz
|
||||
@@ -157,8 +163,6 @@ script: |
|
||||
find ${DISTNAME} | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
|
||||
cd ../../
|
||||
done
|
||||
|
||||
mkdir -p ${OUTDIR}/src
|
||||
git archive --prefix="${DISTNAME}/" --output=${OUTDIR}/src/${DISTNAME}.tar.gz HEAD
|
||||
|
||||
mkdir -p $OUTDIR/src
|
||||
mv $SOURCEDIST $OUTDIR/src
|
||||
mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz
|
||||
|
||||
@@ -6,37 +6,37 @@ suites:
|
||||
architectures:
|
||||
- "amd64"
|
||||
packages:
|
||||
- "libssl-dev"
|
||||
# Once osslsigncode supports openssl 1.1, we can change this back to libssl-dev
|
||||
- "libssl1.0-dev"
|
||||
- "autoconf"
|
||||
- "automake"
|
||||
- "libtool"
|
||||
- "pkg-config"
|
||||
remotes:
|
||||
- "url": "https://github.com/bitcoin-core/bitcoin-detached-sigs.git"
|
||||
"dir": "signature"
|
||||
files:
|
||||
- "osslsigncode-2.0.tar.gz"
|
||||
- "osslsigncode-1.7.1.tar.gz"
|
||||
- "osslsigncode-Backports-to-1.7.1.patch"
|
||||
- "bitcoin-win-unsigned.tar.gz"
|
||||
script: |
|
||||
set -e -o pipefail
|
||||
|
||||
BUILD_DIR="$PWD"
|
||||
BUILD_DIR=`pwd`
|
||||
SIGDIR=${BUILD_DIR}/signature/win
|
||||
UNSIGNED_DIR=${BUILD_DIR}/unsigned
|
||||
|
||||
echo "5a60e0a4b3e0b4d655317b2f12a810211c50242138322b16e7e01c6fbb89d92f osslsigncode-2.0.tar.gz" | sha256sum -c
|
||||
echo "f9a8cdb38b9c309326764ebc937cba1523a3a751a7ab05df3ecc99d18ae466c9 osslsigncode-1.7.1.tar.gz" | sha256sum -c
|
||||
echo "a8c4e9cafba922f89de0df1f2152e7be286aba73f78505169bc351a7938dd911 osslsigncode-Backports-to-1.7.1.patch" | sha256sum -c
|
||||
|
||||
mkdir -p ${UNSIGNED_DIR}
|
||||
tar -C ${UNSIGNED_DIR} -xf bitcoin-win-unsigned.tar.gz
|
||||
|
||||
tar xf osslsigncode-2.0.tar.gz
|
||||
cd osslsigncode-2.0
|
||||
tar xf osslsigncode-1.7.1.tar.gz
|
||||
cd osslsigncode-1.7.1
|
||||
patch -p1 < ${BUILD_DIR}/osslsigncode-Backports-to-1.7.1.patch
|
||||
|
||||
./autogen.sh
|
||||
./configure --without-gsf --without-curl --disable-dependency-tracking
|
||||
make
|
||||
find ${UNSIGNED_DIR} -name "*-unsigned.exe" | while read i; do
|
||||
INFILE="$(basename "${i}")"
|
||||
OUTFILE="${INFILE/-unsigned}"
|
||||
INFILE="`basename "${i}"`"
|
||||
OUTFILE="`echo "${INFILE}" | sed s/-unsigned//`"
|
||||
./osslsigncode attach-signature -in "${i}" -out "${OUTDIR}/${OUTFILE}" -sigin "${SIGDIR}/${INFILE}.pem"
|
||||
done
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: "bitcoin-core-win-0.20"
|
||||
name: "bitcoin-core-win-0.19"
|
||||
enable_cache: true
|
||||
distro: "ubuntu"
|
||||
suites:
|
||||
@@ -22,6 +22,7 @@ packages:
|
||||
- "zip"
|
||||
- "ca-certificates"
|
||||
- "python3"
|
||||
- "rename"
|
||||
remotes:
|
||||
- "url": "https://github.com/bitcoin/bitcoin.git"
|
||||
"dir": "bitcoin"
|
||||
@@ -34,13 +35,13 @@ script: |
|
||||
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests"
|
||||
FAKETIME_HOST_PROGS="ar ranlib nm windres strip objcopy"
|
||||
FAKETIME_PROGS="date makensis zip"
|
||||
HOST_CFLAGS="-O2 -g -fno-ident"
|
||||
HOST_CXXFLAGS="-O2 -g -fno-ident"
|
||||
HOST_CFLAGS="-O2 -g"
|
||||
HOST_CXXFLAGS="-O2 -g"
|
||||
|
||||
export QT_RCC_TEST=1
|
||||
export QT_RCC_SOURCE_DATE_OVERRIDE=1
|
||||
export TZ="UTC"
|
||||
export BUILD_DIR="$PWD"
|
||||
export BUILD_DIR=`pwd`
|
||||
mkdir -p ${WRAP_DIR}
|
||||
if test -n "$GBUILD_CACHE_ENABLED"; then
|
||||
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
|
||||
@@ -48,12 +49,11 @@ script: |
|
||||
mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
|
||||
fi
|
||||
|
||||
# Use $LIB in LD_PRELOAD to avoid hardcoding the dir (See `man ld.so`)
|
||||
function create_global_faketime_wrappers {
|
||||
for prog in ${FAKETIME_PROGS}; do
|
||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
|
||||
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
|
||||
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
|
||||
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
|
||||
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
|
||||
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
|
||||
chmod +x ${WRAP_DIR}/${prog}
|
||||
@@ -65,7 +65,7 @@ script: |
|
||||
for prog in ${FAKETIME_HOST_PROGS}; do
|
||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
|
||||
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
|
||||
chmod +x ${WRAP_DIR}/${i}-${prog}
|
||||
@@ -73,14 +73,22 @@ script: |
|
||||
done
|
||||
}
|
||||
|
||||
function create_per-host_compiler_wrapper {
|
||||
# -posix variant is required for c++11 threading.
|
||||
function create_per-host_linker_wrapper {
|
||||
# This is only needed for trusty, as the mingw linker leaks a few bytes of
|
||||
# heap, causing non-determinism. See discussion in https://github.com/bitcoin/bitcoin/pull/6900
|
||||
for i in $HOSTS; do
|
||||
mkdir -p ${WRAP_DIR}/${i}
|
||||
for prog in collect2; do
|
||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}/${prog}
|
||||
REAL=$(${i}-gcc -print-prog-name=${prog})
|
||||
echo "export MALLOC_PERTURB_=255" >> ${WRAP_DIR}/${i}/${prog}
|
||||
echo "${REAL} \$@" >> $WRAP_DIR/${i}/${prog}
|
||||
chmod +x ${WRAP_DIR}/${i}/${prog}
|
||||
done
|
||||
for prog in gcc g++; do
|
||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
|
||||
echo "REAL=\`which -a ${i}-${prog}-posix | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "export COMPILER_PATH=${WRAP_DIR}/${i}" >> ${WRAP_DIR}/${i}-${prog}
|
||||
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
|
||||
@@ -93,11 +101,11 @@ script: |
|
||||
export PATH_orig=${PATH}
|
||||
create_global_faketime_wrappers "2000-01-01 12:00:00"
|
||||
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
|
||||
create_per-host_compiler_wrapper "2000-01-01 12:00:00"
|
||||
create_per-host_linker_wrapper "2000-01-01 12:00:00"
|
||||
export PATH=${WRAP_DIR}:${PATH}
|
||||
|
||||
cd bitcoin
|
||||
BASEPREFIX="${PWD}/depends"
|
||||
BASEPREFIX=`pwd`/depends
|
||||
# Build dependencies for each host
|
||||
for i in $HOSTS; do
|
||||
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
|
||||
@@ -107,15 +115,24 @@ script: |
|
||||
export PATH=${PATH_orig}
|
||||
create_global_faketime_wrappers "${REFERENCE_DATETIME}"
|
||||
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
|
||||
create_per-host_compiler_wrapper "${REFERENCE_DATETIME}"
|
||||
create_per-host_linker_wrapper "${REFERENCE_DATETIME}"
|
||||
export PATH=${WRAP_DIR}:${PATH}
|
||||
|
||||
# Create the release tarball using (arbitrarily) the first host
|
||||
./autogen.sh
|
||||
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
|
||||
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
|
||||
make dist
|
||||
SOURCEDIST=$(echo bitcoin-*.tar.gz)
|
||||
DISTNAME=${SOURCEDIST/%.tar.gz}
|
||||
SOURCEDIST=`echo bitcoin-*.tar.gz`
|
||||
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
|
||||
|
||||
# Correct tar file order
|
||||
mkdir -p temp
|
||||
pushd temp
|
||||
tar -xf ../$SOURCEDIST
|
||||
find bitcoin-* | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
|
||||
mkdir -p $OUTDIR/src
|
||||
cp ../$SOURCEDIST $OUTDIR/src
|
||||
popd
|
||||
|
||||
# Workaround for tarball not building with the bare tag version (prep)
|
||||
make -C src obj/build.h
|
||||
@@ -126,7 +143,7 @@ script: |
|
||||
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
|
||||
mkdir -p distsrc-${i}
|
||||
cd distsrc-${i}
|
||||
INSTALLPATH="${PWD}/installed/${DISTNAME}"
|
||||
INSTALLPATH=`pwd`/installed/${DISTNAME}
|
||||
mkdir -p ${INSTALLPATH}
|
||||
tar --strip-components=1 -xf ../$SOURCEDIST
|
||||
|
||||
@@ -138,29 +155,26 @@ script: |
|
||||
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}"
|
||||
make ${MAKEOPTS}
|
||||
make ${MAKEOPTS} -C src check-security
|
||||
make ${MAKEOPTS} -C src check-symbols
|
||||
make deploy
|
||||
make install DESTDIR=${INSTALLPATH}
|
||||
cp -f --target-directory="${OUTDIR}" ./bitcoin-*-setup-unsigned.exe
|
||||
rename 's/-setup\.exe$/-setup-unsigned.exe/' *-setup.exe
|
||||
cp -f bitcoin-*setup*.exe $OUTDIR/
|
||||
cd installed
|
||||
mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/
|
||||
find . -name "lib*.la" -delete
|
||||
find . -name "lib*.a" -delete
|
||||
rm -rf ${DISTNAME}/lib/pkgconfig
|
||||
find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
|
||||
find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
|
||||
cp ../doc/README_windows.txt ${DISTNAME}/readme.txt
|
||||
find ${DISTNAME} -not -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i//x86_64-w64-mingw32/win64}.zip
|
||||
find ${DISTNAME} -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i//x86_64-w64-mingw32/win64}-debug.zip
|
||||
find ${DISTNAME}/bin -type f -executable -exec ${i}-objcopy --only-keep-debug {} {}.dbg \; -exec ${i}-strip -s {} \; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \;
|
||||
find ${DISTNAME}/lib -type f -exec ${i}-objcopy --only-keep-debug {} {}.dbg \; -exec ${i}-strip -s {} \; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \;
|
||||
find ${DISTNAME} -not -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip
|
||||
find ${DISTNAME} -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}-debug.zip
|
||||
cd ../../
|
||||
rm -rf distsrc-${i}
|
||||
done
|
||||
|
||||
mkdir -p ${OUTDIR}/src
|
||||
git archive --prefix="${DISTNAME}/" --output=${OUTDIR}/src/${DISTNAME}.tar.gz HEAD
|
||||
|
||||
cp -rf contrib/windeploy $BUILD_DIR
|
||||
cd $BUILD_DIR/windeploy
|
||||
mkdir unsigned
|
||||
cp $OUTDIR/bitcoin-*setup-unsigned.exe unsigned/
|
||||
find . | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-win-unsigned.tar.gz
|
||||
mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.zip ${OUTDIR}/${DISTNAME}-win64-debug.zip
|
||||
mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip
|
||||
|
||||
@@ -27,7 +27,6 @@ D62A803E27E7F43486035ADBBCD04D8E9CCCAC2A Paul Rabahy
|
||||
37EC7D7B0A217CDB4B4E007E7FAB114267E4FA04 Peter Todd
|
||||
D762373D24904A3E42F33B08B9A408E71DAAC974 Pieter Wuille (Location: Leuven, Belgium)
|
||||
133EAC179436F14A5CF1B794860FEB804E669320 Pieter Wuille
|
||||
A8FC55F3B04BA3146F3492E79303B33A305224CB Sebastian Kung (TheCharlatan)
|
||||
ED9BDF7AD6A55E232E84524257FF9BDBCC301009 Sjors Provoost
|
||||
AEC1884398647C47413C1C3FB1179EB7347DC10D Warren Togami
|
||||
79D00BAC68B56D422F945A8F8E3A8F3247DBCBBF Willy Ko
|
||||
|
||||
@@ -62,16 +62,15 @@ Likewise, to perform a bootstrapped build (takes even longer):
|
||||
export ADDITIONAL_GUIX_ENVIRONMENT_FLAGS='--bootstrap --no-substitutes'
|
||||
```
|
||||
|
||||
### Using a version of Guix with `guix time-machine` capabilities
|
||||
### Using the right Guix
|
||||
|
||||
> Note: This entire section can be skipped if you are already using a version of
|
||||
> Guix that has [the `guix time-machine` command][guix/time-machine].
|
||||
|
||||
Once Guix is installed, if it doesn't have the `guix time-machine` command, pull
|
||||
the latest `guix`.
|
||||
Once Guix is installed, deploy our patched version into your current Guix
|
||||
profile. The changes there are slowly being upstreamed.
|
||||
|
||||
```sh
|
||||
guix pull --max-jobs=4 # change number of jobs accordingly
|
||||
guix pull --url=https://github.com/dongcarl/guix.git \
|
||||
--commit=82c77e52b8b46e0a3aad2cb12307c2e30547deec \
|
||||
--max-jobs=4 # change accordingly
|
||||
```
|
||||
|
||||
Make sure that you are using your current profile. (You are prompted to do this
|
||||
@@ -81,6 +80,9 @@ at the end of the `guix pull`)
|
||||
export PATH="${HOME}/.config/guix/current/bin${PATH:+:}$PATH"
|
||||
```
|
||||
|
||||
> Note: There is ongoing work to eliminate this entire section using Guix
|
||||
> [inferiors][guix/inferiors] and [channels][guix/channels].
|
||||
|
||||
## Usage
|
||||
|
||||
### As a Development Environment
|
||||
@@ -114,7 +116,7 @@ find output/ -type f -print0 | sort -z | xargs -r0 sha256sum
|
||||
* _**HOSTS**_
|
||||
|
||||
Override the space-separated list of platform triples for which to perform a
|
||||
bootstrappable build. _(defaults to "x86\_64-linux-gnu
|
||||
bootstrappable build. _(defaults to "i686-linux-gnu x86\_64-linux-gnu
|
||||
arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu")_
|
||||
|
||||
> Windows and OS X platform triplet support are WIP.
|
||||
@@ -222,7 +224,6 @@ repository and will likely put one up soon.
|
||||
[guix/substitute-server-auth]: https://www.gnu.org/software/guix/manual/en/html_node/Substitute-Server-Authorization.html
|
||||
[guix/inferiors]: https://www.gnu.org/software/guix/manual/en/html_node/Inferiors.html
|
||||
[guix/channels]: https://www.gnu.org/software/guix/manual/en/html_node/Channels.html
|
||||
[guix/time-machine]: https://guix.gnu.org/manual/en/html_node/Invoking-guix-time_002dmachine.html
|
||||
|
||||
[debian/guix-package]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850644
|
||||
[fanquake/guix-docker]: https://github.com/fanquake/core-review/tree/master/guix
|
||||
|
||||
@@ -13,14 +13,8 @@ make -C "${PWD}/depends" -j"$MAX_JOBS" download ${V:+V=1} ${SOURCES_PATH:+SOURCE
|
||||
# Determine the reference time used for determinism (overridable by environment)
|
||||
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}"
|
||||
|
||||
time-machine() {
|
||||
guix time-machine --url=https://github.com/dongcarl/guix.git \
|
||||
--commit=b3a7c72c8b2425f8ddb0fc6e3b1caeed40f86dee \
|
||||
-- "$@"
|
||||
}
|
||||
|
||||
# Deterministically build Bitcoin Core for HOSTs (overriable by environment)
|
||||
for host in ${HOSTS=x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu}; do
|
||||
for host in ${HOSTS=i686-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu}; do
|
||||
|
||||
# Display proper warning when the user interrupts the build
|
||||
trap 'echo "** INT received while building ${host}, you may want to clean up the relevant output and distsrc-* directories before rebuilding"' INT
|
||||
@@ -28,18 +22,18 @@ for host in ${HOSTS=x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv
|
||||
# Run the build script 'contrib/guix/libexec/build.sh' in the build
|
||||
# container specified by 'contrib/guix/manifest.scm'
|
||||
# shellcheck disable=SC2086
|
||||
time-machine environment --manifest="${PWD}/contrib/guix/manifest.scm" \
|
||||
--container \
|
||||
--pure \
|
||||
--no-cwd \
|
||||
--share="$PWD"=/bitcoin \
|
||||
${SOURCES_PATH:+--share="$SOURCES_PATH"} \
|
||||
${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
|
||||
-- env HOST="$host" \
|
||||
MAX_JOBS="$MAX_JOBS" \
|
||||
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \
|
||||
${V:+V=1} \
|
||||
${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \
|
||||
bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh"
|
||||
guix environment --manifest="${PWD}/contrib/guix/manifest.scm" \
|
||||
--container \
|
||||
--pure \
|
||||
--no-cwd \
|
||||
--share="$PWD"=/bitcoin \
|
||||
${SOURCES_PATH:+--share="$SOURCES_PATH"} \
|
||||
${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
|
||||
-- env HOST="$host" \
|
||||
MAX_JOBS="$MAX_JOBS" \
|
||||
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \
|
||||
${V:+V=1} \
|
||||
${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \
|
||||
bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh"
|
||||
|
||||
done
|
||||
|
||||
@@ -21,6 +21,17 @@
|
||||
(guix profiles)
|
||||
(guix utils))
|
||||
|
||||
(define (make-ssp-fixed-gcc xgcc)
|
||||
"Given a XGCC package, return a modified package that uses the SSP function
|
||||
from glibc instead of from libssp.so. Taken from:
|
||||
http://www.linuxfromscratch.org/hlfs/view/development/chapter05/gcc-pass1.html"
|
||||
(package
|
||||
(inherit xgcc)
|
||||
(arguments
|
||||
(substitute-keyword-arguments (package-arguments xgcc)
|
||||
((#:make-flags flags)
|
||||
`(cons "gcc_cv_libc_provides_ssp=yes" ,flags))))))
|
||||
|
||||
(define (make-gcc-rpath-link xgcc)
|
||||
"Given a XGCC package, return a modified package that replace each instance of
|
||||
-rpath in the default system spec that's inserted by Guix with -rpath-link"
|
||||
@@ -93,8 +104,9 @@ chain for " target " development."))
|
||||
(base-gcc-for-libc gcc-5)
|
||||
(base-kernel-headers linux-libre-headers-4.19)
|
||||
(base-libc glibc-2.27)
|
||||
(base-gcc (make-gcc-rpath-link gcc-9)))
|
||||
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
|
||||
(base-gcc (make-gcc-rpath-link
|
||||
(make-ssp-fixed-gcc gcc-9))))
|
||||
"Convienience wrapper around MAKE-CROSS-TOOLCHAIN with default values
|
||||
desirable for building Bitcoin Core release binaries."
|
||||
(make-cross-toolchain target
|
||||
base-gcc-for-libc
|
||||
|
||||
@@ -16,7 +16,7 @@ expect fork
|
||||
|
||||
respawn
|
||||
respawn limit 5 120
|
||||
kill timeout 600
|
||||
kill timeout 60
|
||||
|
||||
pre-start script
|
||||
# this will catch non-existent config files
|
||||
|
||||
@@ -39,7 +39,7 @@ start() {
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
killproc $prog -t600
|
||||
killproc $prog
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f $lockfile
|
||||
|
||||
@@ -30,4 +30,4 @@
|
||||
# Note that this will be mapped as argument to start-stop-daemon's
|
||||
# '--retry' option, which means you can specify a retry schedule
|
||||
# here. For more information see man 8 start-stop-daemon.
|
||||
BITCOIND_SIGTERM_TIMEOUT=600
|
||||
BITCOIND_SIGTERM_TIMEOUT=60
|
||||
|
||||
@@ -29,7 +29,6 @@ ExecStartPre=/bin/chgrp bitcoin /etc/bitcoin
|
||||
Type=forking
|
||||
PIDFile=/run/bitcoind/bitcoind.pid
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=600
|
||||
|
||||
# Directory creation and permissions
|
||||
####################################
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2017-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
# Install libdb4.8 (Berkeley DB).
|
||||
|
||||
|
||||
@@ -28,11 +28,6 @@ input=/home/example/.bitcoin/blocks
|
||||
#genesis=000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
|
||||
#input=/home/example/.bitcoin/testnet3/blocks
|
||||
|
||||
# regtest
|
||||
#netmagic=fabfb5da
|
||||
#genesis=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206
|
||||
#input=/home/example/.bitcoin/regtest/blocks
|
||||
|
||||
# "output" option causes blockchain files to be written to the given location,
|
||||
# with "output_file" ignored. If not used, "output_file" is used instead.
|
||||
# output=/home/example/blockchain_directory
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# linearize-data.py: Construct a linear, no-fork version of the chain.
|
||||
#
|
||||
# Copyright (c) 2013-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2013-2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#
|
||||
@@ -15,7 +15,6 @@ import sys
|
||||
import hashlib
|
||||
import datetime
|
||||
import time
|
||||
import glob
|
||||
from collections import namedtuple
|
||||
from binascii import unhexlify
|
||||
|
||||
@@ -93,30 +92,6 @@ def mkblockmap(blkindex):
|
||||
blkmap[hash] = height
|
||||
return blkmap
|
||||
|
||||
# This gets the first block file ID that exists from the input block
|
||||
# file directory.
|
||||
def getFirstBlockFileId(block_dir_path):
|
||||
# First, this sets up a pattern to search for block files, for
|
||||
# example 'blkNNNNN.dat'.
|
||||
blkFilePattern = os.path.join(block_dir_path, "blk[0-9][0-9][0-9][0-9][0-9].dat")
|
||||
|
||||
# This search is done with glob
|
||||
blkFnList = glob.glob(blkFilePattern)
|
||||
|
||||
if len(blkFnList) == 0:
|
||||
print("blocks not pruned - starting at 0")
|
||||
return 0
|
||||
# We then get the lexicographic minimum, which should be the first
|
||||
# block file name.
|
||||
firstBlkFilePath = min(blkFnList)
|
||||
firstBlkFn = os.path.basename(firstBlkFilePath)
|
||||
|
||||
# now, the string should be ['b','l','k','N','N','N','N','N','.','d','a','t']
|
||||
# So get the ID by choosing: 3 4 5 6 7
|
||||
# The ID is not necessarily 0 if this is a pruned node.
|
||||
blkId = int(firstBlkFn[3:8])
|
||||
return blkId
|
||||
|
||||
# Block header and extent on disk
|
||||
BlockExtent = namedtuple('BlockExtent', ['fn', 'offset', 'inhdr', 'blkhdr', 'size'])
|
||||
|
||||
@@ -126,9 +101,7 @@ class BlockDataCopier:
|
||||
self.blkindex = blkindex
|
||||
self.blkmap = blkmap
|
||||
|
||||
# Get first occurring block file id - for pruned nodes this
|
||||
# will not necessarily be 0
|
||||
self.inFn = getFirstBlockFileId(self.settings['input'])
|
||||
self.inFn = 0
|
||||
self.inF = None
|
||||
self.outFn = 0
|
||||
self.outsz = 0
|
||||
@@ -240,11 +213,8 @@ class BlockDataCopier:
|
||||
|
||||
inMagic = inhdr[:4]
|
||||
if (inMagic != self.settings['netmagic']):
|
||||
# Seek backwards 7 bytes (skipping the first byte in the previous search)
|
||||
# and continue searching from the new position if the magic bytes are not
|
||||
# found.
|
||||
self.inF.seek(-7, os.SEEK_CUR)
|
||||
continue
|
||||
print("Invalid magic: " + inMagic.hex())
|
||||
return
|
||||
inLenLE = inhdr[4:]
|
||||
su = struct.unpack("<I", inLenLE)
|
||||
inLen = su[0] - 80 # length without header
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
|
||||
#
|
||||
# Copyright (c) 2013-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2013-2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#
|
||||
|
||||
@@ -1,139 +1,15 @@
|
||||
# MacOS Deployment
|
||||
### MacDeploy ###
|
||||
|
||||
The `macdeployqtplus` script should not be run manually. Instead, after building as usual:
|
||||
For Snow Leopard (which uses [Python 2.6](http://www.python.org/download/releases/2.6/)), you will need the param_parser package:
|
||||
|
||||
```bash
|
||||
make deploy
|
||||
```
|
||||
sudo easy_install argparse
|
||||
|
||||
During the deployment process, the disk image window will pop up briefly
|
||||
when the fancy settings are applied. This is normal, please do not interfere,
|
||||
the process will unmount the DMG and cleanup before finishing.
|
||||
This script should not be run manually, instead, after building as usual:
|
||||
|
||||
When complete, it will have produced `Bitcoin-Qt.dmg`.
|
||||
make deploy
|
||||
|
||||
## SDK Extraction
|
||||
During the process, the disk image window will pop up briefly where the fancy
|
||||
settings are applied. This is normal, please do not interfere.
|
||||
|
||||
Our current macOS SDK (`macOSX10.14.sdk`) can be extracted from
|
||||
[Xcode_10.2.1.xip](https://download.developer.apple.com/Developer_Tools/Xcode_10.2.1/Xcode_10.2.1.xip).
|
||||
An Apple ID is needed to download this.
|
||||
When finished, it will produce `Bitcoin-Core.dmg`.
|
||||
|
||||
`Xcode.app` is packaged in a `.xip` archive.
|
||||
This makes the SDK less-trivial to extract on non-macOS machines.
|
||||
One approach (tested on Debian Buster) is outlined below:
|
||||
|
||||
```bash
|
||||
|
||||
apt install clang cpio git liblzma-dev libxml2-dev libssl-dev make
|
||||
|
||||
git clone https://github.com/tpoechtrager/xar
|
||||
pushd xar/xar
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
popd
|
||||
|
||||
git clone https://github.com/NiklasRosenstein/pbzx
|
||||
pushd pbzx
|
||||
clang -llzma -lxar pbzx.c -o pbzx -Wl,-rpath=/usr/local/lib
|
||||
popd
|
||||
|
||||
xar -xf Xcode_10.2.1.xip -C .
|
||||
|
||||
./pbzx/pbzx -n Content | cpio -i
|
||||
|
||||
find Xcode.app -type d -name MacOSX.sdk -exec sh -c 'tar --transform="s/MacOSX.sdk/MacOSX10.14.sdk/" -c -C$(dirname {}) MacOSX.sdk/ | gzip -9n > MacOSX10.14.sdk.tar.gz' \;
|
||||
```
|
||||
|
||||
on macOS the process is more straightforward:
|
||||
|
||||
```bash
|
||||
xip -x Xcode_10.2.1.xip
|
||||
tar -s "/MacOSX.sdk/MacOSX10.14.sdk/" -C Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.14.sdk.tar.gz MacOSX.sdk
|
||||
```
|
||||
|
||||
Our previously used macOS SDK (`MacOSX10.11.sdk`) can be extracted from
|
||||
[Xcode 7.3.1 dmg](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg).
|
||||
The script [`extract-osx-sdk.sh`](./extract-osx-sdk.sh) automates this. First
|
||||
ensure the DMG file is in the current directory, and then run the script. You
|
||||
may wish to delete the `intermediate 5.hfs` file and `MacOSX10.11.sdk` (the
|
||||
directory) when you've confirmed the extraction succeeded.
|
||||
|
||||
```bash
|
||||
apt-get install p7zip-full sleuthkit
|
||||
contrib/macdeploy/extract-osx-sdk.sh
|
||||
rm -rf 5.hfs MacOSX10.11.sdk
|
||||
```
|
||||
|
||||
## Deterministic macOS DMG Notes
|
||||
Working macOS DMGs are created in Linux by combining a recent `clang`, the Apple
|
||||
`binutils` (`ld`, `ar`, etc) and DMG authoring tools.
|
||||
|
||||
Apple uses `clang` extensively for development and has upstreamed the necessary
|
||||
functionality so that a vanilla clang can take advantage. It supports the use of `-F`,
|
||||
`-target`, `-mmacosx-version-min`, and `--sysroot`, which are all necessary when
|
||||
building for macOS.
|
||||
|
||||
Apple's version of `binutils` (called `cctools`) contains lots of functionality missing in the
|
||||
FSF's `binutils`. In addition to extra linker options for frameworks and sysroots, several
|
||||
other tools are needed as well such as `install_name_tool`, `lipo`, and `nmedit`. These
|
||||
do not build under Linux, so they have been patched to do so. The work here was used as
|
||||
a starting point: [mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4).
|
||||
|
||||
In order to build a working toolchain, the following source packages are needed from
|
||||
Apple: `cctools`, `dyld`, and `ld64`.
|
||||
|
||||
These tools inject timestamps by default, which produce non-deterministic binaries. The
|
||||
`ZERO_AR_DATE` environment variable is used to disable that.
|
||||
|
||||
This version of `cctools` has been patched to use the current version of `clang`'s headers
|
||||
and its `libLTO.so` rather than those from `llvmgcc`, as it was originally done in `toolchain4`.
|
||||
|
||||
To complicate things further, all builds must target an Apple SDK. These SDKs are free to
|
||||
download, but not redistributable. To obtain it, register for an Apple Developer Account,
|
||||
then download [Xcode 10.2.1](https://download.developer.apple.com/Developer_Tools/Xcode_10.2.1/Xcode_10.2.1.xip).
|
||||
|
||||
This file is many gigabytes in size, but most (but not all) of what we need is
|
||||
contained only in a single directory:
|
||||
|
||||
```bash
|
||||
Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
|
||||
```
|
||||
|
||||
See the SDK Extraction notes above for how to obtain it.
|
||||
|
||||
The Gitian descriptors build 2 sets of files: Linux tools, then Apple binaries which are
|
||||
created using these tools. The build process has been designed to avoid including the
|
||||
SDK's files in Gitian's outputs. All interim tarballs are fully deterministic and may be freely
|
||||
redistributed.
|
||||
|
||||
`genisoimage` is used to create the initial DMG. It is not deterministic as-is, so it has been
|
||||
patched. A system `genisoimage` will work fine, but it will not be deterministic because
|
||||
the file-order will change between invocations. The patch can be seen here: [cdrkit-deterministic.patch](https://github.com/bitcoin/bitcoin/blob/master/depends/patches/native_cdrkit/cdrkit-deterministic.patch).
|
||||
No effort was made to fix this cleanly, so it likely leaks memory badly, however it's only used for
|
||||
a single invocation, so that's no real concern.
|
||||
|
||||
`genisoimage` cannot compress DMGs, so afterwards, the DMG tool from the
|
||||
`libdmg-hfsplus` project is used to compress it. There are several bugs in this tool and its
|
||||
maintainer has seemingly abandoned the project.
|
||||
|
||||
The DMG tool has the ability to create DMGs from scratch as well, but this functionality is
|
||||
broken. Only the compression feature is currently used. Ideally, the creation could be fixed
|
||||
and `genisoimage` would no longer be necessary.
|
||||
|
||||
Background images and other features can be added to DMG files by inserting a
|
||||
`.DS_Store` before creation. This is generated by the script `contrib/macdeploy/custom_dsstore.py`.
|
||||
|
||||
As of OS X 10.9 Mavericks, using an Apple-blessed key to sign binaries is a requirement in
|
||||
order to satisfy the new Gatekeeper requirements. Because this private key cannot be
|
||||
shared, we'll have to be a bit creative in order for the build process to remain somewhat
|
||||
deterministic. Here's how it works:
|
||||
|
||||
- Builders use Gitian to create an unsigned release. This outputs an unsigned DMG which
|
||||
users may choose to bless and run. It also outputs an unsigned app structure in the form
|
||||
of a tarball, which also contains all of the tools that have been previously (deterministically)
|
||||
built in order to create a final DMG.
|
||||
- The Apple keyholder uses this unsigned app to create a detached signature, using the
|
||||
script that is also included there. Detached signatures are available from this [repository](https://github.com/bitcoin-core/bitcoin-detached-sigs).
|
||||
- Builders feed the unsigned app + detached signature back into Gitian. It uses the
|
||||
pre-built tools to recombine the pieces into a deterministic DMG.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-2015 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -8,9 +8,10 @@ set -e
|
||||
|
||||
UNSIGNED="$1"
|
||||
SIGNATURE="$2"
|
||||
ARCH=x86_64
|
||||
ROOTDIR=dist
|
||||
TEMPDIR=signed.temp
|
||||
OUTDIR=signed-app
|
||||
SIGNAPPLE=signapple
|
||||
|
||||
if [ -z "$UNSIGNED" ]; then
|
||||
echo "usage: $0 <unsigned app> <signature>"
|
||||
@@ -22,6 +23,35 @@ if [ -z "$SIGNATURE" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${SIGNAPPLE} apply ${UNSIGNED} ${SIGNATURE}
|
||||
mv ${ROOTDIR} ${OUTDIR}
|
||||
rm -rf ${TEMPDIR} && mkdir -p ${TEMPDIR}
|
||||
tar -C ${TEMPDIR} -xf ${UNSIGNED}
|
||||
cp -rf "${SIGNATURE}"/* ${TEMPDIR}
|
||||
|
||||
if [ -z "${PAGESTUFF}" ]; then
|
||||
PAGESTUFF=${TEMPDIR}/pagestuff
|
||||
fi
|
||||
|
||||
if [ -z "${CODESIGN_ALLOCATE}" ]; then
|
||||
CODESIGN_ALLOCATE=${TEMPDIR}/codesign_allocate
|
||||
fi
|
||||
|
||||
find ${TEMPDIR} -name "*.sign" | while read i; do
|
||||
SIZE=$(stat -c %s "${i}")
|
||||
TARGET_FILE="$(echo "${i}" | sed 's/\.sign$//')"
|
||||
|
||||
echo "Allocating space for the signature of size ${SIZE} in ${TARGET_FILE}"
|
||||
${CODESIGN_ALLOCATE} -i "${TARGET_FILE}" -a ${ARCH} ${SIZE} -o "${i}.tmp"
|
||||
|
||||
OFFSET=$(${PAGESTUFF} "${i}.tmp" -p | tail -2 | grep offset | sed 's/[^0-9]*//g')
|
||||
if [ -z ${QUIET} ]; then
|
||||
echo "Attaching signature at offset ${OFFSET}"
|
||||
fi
|
||||
|
||||
dd if="$i" of="${i}.tmp" bs=1 seek=${OFFSET} count=${SIZE} 2>/dev/null
|
||||
mv "${i}.tmp" "${TARGET_FILE}"
|
||||
rm "${i}"
|
||||
echo "Success."
|
||||
done
|
||||
mv ${TEMPDIR}/${ROOTDIR} ${OUTDIR}
|
||||
rm -rf ${TEMPDIR}
|
||||
echo "Signed: ${OUTDIR}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-2015 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -8,21 +8,44 @@ set -e
|
||||
|
||||
ROOTDIR=dist
|
||||
BUNDLE="${ROOTDIR}/Bitcoin-Qt.app"
|
||||
SIGNAPPLE=signapple
|
||||
CODESIGN=codesign
|
||||
TEMPDIR=sign.temp
|
||||
TEMPLIST=${TEMPDIR}/signatures.txt
|
||||
OUT=signature-osx.tar.gz
|
||||
OUTROOT=osx/dist
|
||||
OUTROOT=osx
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: $0 <signapple args>"
|
||||
echo "example: $0 <path to key>"
|
||||
echo "usage: $0 <codesign args>"
|
||||
echo "example: $0 -s MyIdentity"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf ${TEMPDIR}
|
||||
rm -rf ${TEMPDIR} ${TEMPLIST}
|
||||
mkdir -p ${TEMPDIR}
|
||||
|
||||
${SIGNAPPLE} sign -f --detach "${TEMPDIR}/${OUTROOT}" "$@" "${BUNDLE}"
|
||||
${CODESIGN} -f --file-list ${TEMPLIST} "$@" "${BUNDLE}"
|
||||
|
||||
grep -v CodeResources < "${TEMPLIST}" | while read i; do
|
||||
TARGETFILE="${BUNDLE}/$(echo "${i}" | sed "s|.*${BUNDLE}/||")"
|
||||
SIZE=$(pagestuff "$i" -p | tail -2 | grep size | sed 's/[^0-9]*//g')
|
||||
OFFSET=$(pagestuff "$i" -p | tail -2 | grep offset | sed 's/[^0-9]*//g')
|
||||
SIGNFILE="${TEMPDIR}/${OUTROOT}/${TARGETFILE}.sign"
|
||||
DIRNAME="$(dirname "${SIGNFILE}")"
|
||||
mkdir -p "${DIRNAME}"
|
||||
echo "Adding detached signature for: ${TARGETFILE}. Size: ${SIZE}. Offset: ${OFFSET}"
|
||||
dd if="$i" of="${SIGNFILE}" bs=1 skip=${OFFSET} count=${SIZE} 2>/dev/null
|
||||
done
|
||||
|
||||
grep CodeResources < "${TEMPLIST}" | while read i; do
|
||||
TARGETFILE="${BUNDLE}/$(echo "${i}" | sed "s|.*${BUNDLE}/||")"
|
||||
RESOURCE="${TEMPDIR}/${OUTROOT}/${TARGETFILE}"
|
||||
DIRNAME="$(dirname "${RESOURCE}")"
|
||||
mkdir -p "${DIRNAME}"
|
||||
echo "Adding resource for: \"${TARGETFILE}\""
|
||||
cp "${i}" "${RESOURCE}"
|
||||
done
|
||||
|
||||
rm ${TEMPLIST}
|
||||
|
||||
tar -C "${TEMPDIR}" -czf "${OUT}" .
|
||||
rm -rf "${TEMPDIR}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2016-2019 The Bitcoin Core developers
|
||||
# Copyright (c) 2016 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
||||
@@ -586,8 +586,7 @@ if len(config.fancy) == 1:
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
with open(p, 'rb') as fp:
|
||||
fancy = plistlib.load(fp, fmt=plistlib.FMT_XML)
|
||||
fancy = plistlib.readPlist(p)
|
||||
except:
|
||||
if verbose >= 1:
|
||||
sys.stderr.write("Error: Could not parse fancy disk image plist at \"{}\"\n".format(p))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user