Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Regular rebasing of the cmake-staging branch #220

Closed
wants to merge 102 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
08e08a7
cmake: Add root `CMakeLists.txt` file
hebasto Apr 16, 2024
fb4908e
cmake: Introduce core interface libraries to encapsulate common flags
hebasto Mar 23, 2024
1433ff4
cmake: Add `config/bitcoin-config.h` support
hebasto Mar 23, 2024
2158673
cmake: Check system headers
hebasto Mar 23, 2024
2afbf28
cmake: Check system symbols
hebasto Apr 29, 2024
874d812
cmake: Check compiler features
hebasto Mar 23, 2024
a0d66f1
cmake: Add position independent code support
hebasto Jan 9, 2024
8c56ec7
cmake: Add platform-specific definitions and properties
hebasto Mar 23, 2024
402e35c
cmake: Build `crc32c` static library
hebasto Mar 23, 2024
7182bf4
cmake: Build `leveldb` static library
hebasto Mar 23, 2024
912c96e
cmake: Build `minisketch` static library
hebasto Mar 23, 2024
a550815
cmake: Build `secp256k1` static library
hebasto Jun 4, 2024
6cc1d2d
cmake: Build `univalue` static library
hebasto Jan 9, 2024
5b27271
cmake: Build `bitcoin_crypto` library
hebasto Mar 8, 2024
f95ced3
cmake: Build `bitcoin_util` static library
hebasto Apr 3, 2024
235950f
cmake: Build `bitcoin_consensus` library
hebasto Jan 9, 2024
3c4d878
depends: Fix Autotools-generated `libevent*.pc` files
hebasto Apr 22, 2024
5e37f11
cmake: Add `FindLibevent` module
hebasto May 17, 2024
2d820b4
cmake: Build `bitcoind` executable
hebasto May 4, 2024
74e6bbe
depends: Amend handling flags environment variables
hebasto Feb 4, 2024
61c69f5
build: Generate `toolchain.cmake` in depends
hebasto Jun 4, 2024
b7ed165
cmake: Add cross-compiling support
hebasto May 20, 2024
2956ca4
cmake: Add `TristateOption` module
hebasto Jan 9, 2024
a111659
cmake: Add `ccache` support
hebasto Jun 4, 2024
8b1b629
cmake: Add `libnatpmp` optional package support
hebasto Jun 4, 2024
0cac5dc
cmake: Add `libminiupnpc` optional package support
hebasto Apr 29, 2024
7bbbd06
depends: Fix Autotools-generated `libzmq.pc` file
hebasto Mar 20, 2024
7ebccae
cmake: Add `libzmq` optional package support
hebasto Apr 29, 2024
6155192
cmake: Add `systemtap-sdt` optional package support
hebasto Apr 29, 2024
54d5667
cmake: Build `bitcoin-cli` executable
hebasto May 20, 2024
68e68fd
cmake: Build `bitcoin-tx` executable
hebasto Jan 9, 2024
c26deba
cmake: Build `bitcoin-util` executable
hebasto Jan 9, 2024
756ccfc
cmake: Add wallet functionality
hebasto Jun 4, 2024
4e8db00
cmake: Add test config and runners
hebasto May 20, 2024
ec22b45
cmake: Build `bench_bitcoin` executable
hebasto Jun 4, 2024
26df8b8
cmake: Build `test_bitcoin` executable
hebasto Jun 4, 2024
9d1c537
cmake: Make `BUILD_<util>` defaults dependent on `BUILD_TESTS`
hebasto Jun 4, 2024
83b3490
cmake: Include CTest
hebasto Jan 9, 2024
83cca06
cmake: Add `TryAppendCXXFlags` module
hebasto Jan 9, 2024
1651a68
cmake: Add `TryAppendLinkerFlag` module
hebasto Jan 9, 2024
af44e12
cmake: Add platform-specific compiler flags
hebasto Mar 23, 2024
aa13fa9
cmake: Add platform-specific linker flags
hebasto Jan 9, 2024
e728baa
cmake: Redefine/adjust per-configuration flags
hebasto Apr 3, 2024
90a0a17
cmake: Add general compile options
hebasto Mar 23, 2024
a66dc7f
cmake: Add `HARDENING` option
hebasto Jun 4, 2024
604b13b
cmake: Add `REDUCE_EXPORTS` option
hebasto Mar 23, 2024
97e1624
cmake: Add `WERROR` option
hebasto Mar 23, 2024
95e7cc5
cmake: Implement `make install`
hebasto Jan 9, 2024
376019a
cmake: Generate `obj/build.h` header
hebasto Jan 9, 2024
8b60bd0
Revert "build, qt: Do not install *.prl files"
hebasto Jan 17, 2024
378f8b9
qt, build: Drop `QT_STATICPLUGIN` macro
hebasto Mar 1, 2024
cfb8a41
cmake: Build `bitcoin-qt` executable
hebasto May 4, 2024
9d1913a
cmake: Build `test_bitcoin-qt` executable
hebasto Mar 9, 2024
5cce952
qt: Drop `Q_IMPORT_PLUGIN` macros
hebasto Mar 1, 2024
9f71360
cmake: Add `libqrencode` optional package support
hebasto Apr 29, 2024
bf0885d
cmake: Add `SANITIZERS` option
hebasto Mar 23, 2024
1785f94
cmake: Add external signer support
hebasto Jun 4, 2024
5ac5216
cmake: Add fuzzing options
hebasto Jun 4, 2024
4ec174f
cmake: Add `AddWindowsResources` module
hebasto Jan 27, 2024
3249b63
cmake: Add `Maintenance` module
hebasto Jun 4, 2024
fd3c8b5
cmake: Migrate Guix build scripts to CMake
hebasto Jun 4, 2024
e36ae27
cmake: Add vcpkg manifest file
hebasto Jun 4, 2024
aec2084
cmake, vcpkg: Pin `libevent` version
hebasto May 13, 2024
8a902d3
cmake: Add preset for MSVC build
hebasto Feb 8, 2024
4edf431
Fix MSVC warning C4273 "inconsistent dll linkage"
hebasto Feb 26, 2024
8113eac
cmake: Add compiler diagnostic flags
hebasto Mar 25, 2024
1207200
test: Fix MSVC warning C4101 "unreferenced local variable"
hebasto Feb 26, 2024
1b5cf65
cmake: Build `bitcoinkernel` library
hebasto May 20, 2024
4847b61
cmake: Build `bitcoin-chainstate` executable
hebasto Apr 1, 2024
97f642f
cmake: Remove legacy MSVC build system
hebasto Mar 8, 2024
55d2ddc
depends: Bump libmultiprocess source
hebasto Mar 30, 2024
b731ba2
cmake: Add `MULTIPROCESS` option
hebasto Jun 4, 2024
99593b0
cmake: Add `docs` build target
hebasto Apr 23, 2024
f748110
cmake [KILL 3-STATE]: Switch `WITH_NATPMP` to boolean w/ default OFF
hebasto Apr 21, 2024
f52af92
cmake [KILL 3-STATE]: Switch `WITH_MINIUPNPC` to boolean w/ default OFF
hebasto Apr 21, 2024
e2c390d
cmake [KILL 3-STATE]: Switch `WITH_ZMQ` to boolean w/ default OFF
hebasto Apr 29, 2024
4408d6f
cmake [KILL 3-STATE]: Switch `MULTIPROCESS` to boolean w/ default OFF
hebasto Apr 21, 2024
dd44dfa
cmake [KILL 3-STATE]: Switch `WITH_QRENCODE` to boolean w/ default ON
hebasto Apr 24, 2024
aa80e36
cmake [KILL 3-STATE]: Switch `WITH_USDT` to boolean w/ default OFF
hebasto Apr 22, 2024
9f57186
cmake [KILL 3-STATE]: Switch `WITH_{SQLITE,BDB}` to boolean
hebasto Apr 22, 2024
b18c934
cmake [KILL 3-STATE]: Make WITH_GUI binary option w/ default OFF
hebasto Jun 4, 2024
8c99680
cmake [KILL 3-STATE]: Rename WITH_GUI to BUILD_GUI
hebasto Jun 4, 2024
47f252d
cmake: Add `WITH_DBUS` option
hebasto Apr 28, 2024
a4383c8
cmake, doc: Update `release-process.md`
hebasto Feb 26, 2024
5b702d8
cmake, docs: Update MSVC build docs
hebasto May 20, 2024
8db83cd
cmake, doc: Update `build-osx.md`
hebasto May 20, 2024
7b93750
cmake, doc: Update `build-freebsd.md`
hebasto May 20, 2024
bd01dd1
cmake, doc: Update `build-openbsd.md`
hebasto May 20, 2024
1ff2274
cmake, doc: Update `build-netbsd.md`
hebasto May 20, 2024
ef0398d
cmake, doc: Update `build-unix.md`
hebasto May 22, 2024
98346f8
cmake, doc: Update `depends/README.md`
hebasto Apr 27, 2024
2562a5b
cmake, doc: Switch fuzzing docs to CMake
hebasto Jun 4, 2024
84b83b3
cmake: Add `APPEND_{CPP,C,CXX,LD}FLAGS` cache variables
hebasto Apr 26, 2024
4dd97a8
cmake: Display `APPEND_{CPP,C,CXX,LD}FLAGS` in summary
hebasto May 9, 2024
b8987ab
depends: Rename `cmake_system` > `cmake_system_name`
hebasto May 15, 2024
a4f4817
depends: Add `CMAKE_SYSTEM_VERSION` to CMake toolchain file
hebasto May 15, 2024
7aae550
cmake: Add CI-specific presets
hebasto Jun 4, 2024
dec4ca3
ci: Test CMake edge cases
hebasto Jun 4, 2024
5825234
cmake, ci: Skip `miniupnpc` package in depends
hebasto May 22, 2024
e3f0f1d
ci: Migrate CI scripts to CMake
hebasto Jun 4, 2024
b333f6a
cmake, lint: Adjust `lint_includes_build_config`
hebasto Apr 28, 2024
597da83
Remove unused `#include <config/bitcoin-config.h>`
hebasto Apr 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 47 additions & 103 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,17 @@ jobs:

env:
CCACHE_MAXSIZE: '200M'
CI_CCACHE_VERSION: '4.7.5'
CI_QT_CONF: '-release -silent -opensource -confirm-license -opengl desktop -static -static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -nomake examples -nomake tests -nomake tools -no-angle -no-dbus -no-gif -no-gtk -no-ico -no-icu -no-libjpeg -no-libudev -no-sql-sqlite -no-sql-odbc -no-sqlite -no-vulkan -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip doc -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -no-openssl -no-feature-bearermanagement -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sql -no-feature-sqlmodel -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-xml'
CI_QT_DIR: 'qt-everywhere-src-5.15.11'
CI_QT_URL: 'https://download.qt.io/official_releases/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip'
PYTHONUTF8: 1
TEST_RUNNER_TIMEOUT_FACTOR: 40

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Remove non-MSVC tool installations
run: |
Remove-Item -Path "$env:ProgramFiles/CMake" -Recurse -Force

- name: Configure Developer Command Prompt for Microsoft Visual C++
# Using microsoft/setup-msbuild is not enough.
uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -153,122 +153,67 @@ jobs:

- name: Get tool information
run: |
cmake --version | Out-File -FilePath "cmake_version"
Get-Content -Path "cmake_version"
Write-Output "---"
msbuild -version | Out-File -FilePath "$env:GITHUB_WORKSPACE\msbuild_version"
Get-Content -Path "$env:GITHUB_WORKSPACE\msbuild_version"
$env:VCToolsVersion | Out-File -FilePath "$env:GITHUB_WORKSPACE\toolset_version"
Write-Host "VCToolsVersion $(Get-Content -Path "$env:GITHUB_WORKSPACE\toolset_version")"
$env:CI_QT_URL | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_url"
$env:CI_QT_CONF | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_conf"
py -3 --version
Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())"

- name: Restore static Qt cache
id: static-qt-cache
uses: actions/cache/restore@v4
with:
path: C:\Qt_static
key: ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}

- name: Build static Qt. Download
if: steps.static-qt-cache.outputs.cache-hit != 'true'
shell: cmd
run: |
curl --location --output C:\qt-src.zip %CI_QT_URL%
choco install --yes --no-progress jom

- name: Build static Qt. Expand source archive
if: steps.static-qt-cache.outputs.cache-hit != 'true'
shell: cmd
run: tar -xf C:\qt-src.zip -C C:\

- name: Build static Qt. Create build directory
if: steps.static-qt-cache.outputs.cache-hit != 'true'
run: |
Rename-Item -Path "C:\$env:CI_QT_DIR" -NewName "C:\qt-src"
New-Item -ItemType Directory -Path "C:\qt-src\build"

- name: Build static Qt. Configure
if: steps.static-qt-cache.outputs.cache-hit != 'true'
working-directory: C:\qt-src\build
shell: cmd
run: ..\configure %CI_QT_CONF% -prefix C:\Qt_static

- name: Build static Qt. Build
if: steps.static-qt-cache.outputs.cache-hit != 'true'
working-directory: C:\qt-src\build
shell: cmd
run: jom

- name: Build static Qt. Install
if: steps.static-qt-cache.outputs.cache-hit != 'true'
working-directory: C:\qt-src\build
shell: cmd
run: jom install

- name: Save static Qt cache
if: steps.static-qt-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: C:\Qt_static
key: ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }}

- name: Ccache installation cache
id: ccache-installation-cache
uses: actions/cache@v4
with:
path: |
C:\ProgramData\chocolatey\lib\ccache
C:\ProgramData\chocolatey\bin\ccache.exe
C:\ccache\cl.exe
key: ${{ github.job }}-ccache-installation-${{ env.CI_CCACHE_VERSION }}

- name: Install Ccache
if: steps.ccache-installation-cache.outputs.cache-hit != 'true'
run: |
choco install --yes --no-progress ccache --version=$env:CI_CCACHE_VERSION
New-Item -ItemType Directory -Path "C:\ccache"
Copy-Item -Path "$env:ChocolateyInstall\lib\ccache\tools\ccache-$env:CI_CCACHE_VERSION-windows-x86_64\ccache.exe" -Destination "C:\ccache\cl.exe"

- name: Restore Ccache cache
id: ccache-cache
uses: actions/cache/restore@v4
with:
path: ~/AppData/Local/ccache
key: ${{ github.job }}-ccache-${{ github.run_id }}
restore-keys: ${{ github.job }}-ccache-
choco install --yes --no-progress ccache

- name: Using vcpkg with MSBuild
run: |
Set-Location "$env:VCPKG_INSTALLATION_ROOT"
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"
.\vcpkg.exe --vcpkg-root "$env:VCPKG_INSTALLATION_ROOT" integrate install
git rev-parse HEAD | Out-File -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit"
Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit"
Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_PLATFORM_TOOLSET_VERSION $env:VCToolsVersion)"

- name: vcpkg tools cache
uses: actions/cache@v4
with:
path: C:/vcpkg/downloads/tools
key: ${{ github.job }}-vcpkg-tools

- name: vcpkg binary cache
uses: actions/cache@v4
- name: Restore vcpkg binary cache
uses: actions/cache/restore@v4
id: vcpkg-binary-cache
with:
path: ~/AppData/Local/vcpkg/archives
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'toolset_version', 'build_msvc/vcpkg.json') }}
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}

- name: Generate build system
run: |
cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON

- name: Generate project files
run: py -3 build_msvc\msvc-autogen.py
- name: Save vcpkg binary cache
uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.vcpkg-binary-cache.outputs.cache-hit != 'true'
with:
path: ~/AppData/Local/vcpkg/archives
key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}

- name: Restore Ccache cache
id: ccache-cache
uses: actions/cache/restore@v4
with:
path: ~/AppData/Local/ccache
key: ${{ github.job }}-ccache-

- name: Build
shell: cmd
working-directory: build
run: |
ccache --zero-stats
msbuild build_msvc\bitcoin.sln -property:CLToolPath=C:\ccache;CLToolExe=cl.exe;UseMultiToolTask=true;Configuration=Release -maxCpuCount -verbosity:minimal -noLogo
cmake --build . -j $env:NUMBER_OF_PROCESSORS --config Release

- name: Ccache stats
run: ccache --show-stats
run: |
ccache --version | head -n 1
ccache --show-stats --verbose

- name: Save Ccache cache
uses: actions/cache/save@v4
Expand All @@ -278,20 +223,18 @@ jobs:
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
key: ${{ github.job }}-ccache-${{ github.run_id }}

- name: Run unit tests
run: src\test_bitcoin.exe -l test_suite

- name: Run benchmarks
run: src\bench_bitcoin.exe -sanity-check

- name: Run util tests
run: py -3 test\util\test_runner.py

- name: Run rpcauth test
run: py -3 test\util\rpcauth-test.py
- name: Run test suite
working-directory: build
run: |
ctest -j $env:NUMBER_OF_PROCESSORS -C Release

- name: Run functional tests
working-directory: build
env:
BITCOIND: '${{ github.workspace }}\build\src\Release\bitcoind.exe'
BITCOINCLI: '${{ github.workspace }}\build\src\Release\bitcoin-cli.exe'
BITCOINUTIL: '${{ github.workspace }}\build\src\Release\bitcoin-util.exe'
BITCOINWALLET: '${{ github.workspace }}\build\src\Release\bitcoin-wallet.exe'
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
shell: cmd
run: py -3 test\functional\test_runner.py --jobs %NUMBER_OF_PROCESSORS% --ci --quiet --tmpdirprefix=%RUNNER_TEMP% --combinedlogslen=99999999 --timeout-factor=%TEST_RUNNER_TIMEOUT_FACTOR% %TEST_RUNNER_EXTRA%
Expand All @@ -304,7 +247,8 @@ jobs:
git log -1

- name: Run fuzz binaries
working-directory: build
env:
BITCOINFUZZ: "${{ github.workspace}}\\src\\fuzz.exe"
BITCOINFUZZ: '${{ github.workspace }}\build\src\test\fuzz\Release\fuzz.exe'
shell: cmd
run: py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_seed_corpus
Loading
Loading