Page MenuHomePhabricator

[CMAKE] Migrate linux gitian build to cmake and ninja
ClosedPublic

Authored by Fabien on Nov 2 2019, 11:34.

Details

Summary

Replace autotools by cmake for the linux gitian builds, and use
ninja as a generator.

Note 1:
The test_bitcoin binary is no longer part of the gitian output.

Note 2: There are some more dependencies required.
This is because CMake is run for the native platform in order to build a
couple helper binaries for secp256k1 and univalue. CMake is run from the
project root and check for all the dependencies despite only a compiler
is required. This is a minor inconvenience which can be reworked later.

Test Plan

Run the Linux gitian build twice.
Check the hashes are identical between the builds.
Run the binaries on all the platforms.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
gitian_linux_cmake
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7958
Build 13919: Bitcoin ABC Buildbot (legacy)
Build 13918: arc lint + arc unit

Event Timeline

deadalnix requested changes to this revision.Nov 10 2019, 12:56

You need to be using the libs from depends and not the system libs.

This revision now requires changes to proceed.Nov 10 2019, 12:56

Reduce the amount of dependencies required by rebasing on top of D4425.
Disable ccache for the build.

deadalnix requested changes to this revision.Nov 17 2019, 23:04

Overall it looks good. A few details needs to be changed, though.

contrib/gitian-descriptors/gitian-linux.yml
33 ↗(On Diff #14046)

I'm not sure if yaml supports comments, but it would be useful to isolate the libraries that are in fact not strictly required, but end up being necessary due to the way the build system works.

There is always a danger that these end up being used by mistake and make the build not reproducible. It's much better than it used to, but the trap needs to be made explicit.

55 ↗(On Diff #14046)

It is probably worth fixing. It doesn't looks like there is any blocker there.

57 ↗(On Diff #14046)

Avoid moving stuff around unless there is a good reason. This seems to be defined in the same place for all builds, so it's all good.

122 ↗(On Diff #14046)

It is usually a good idea to use pushd and popd in scripts. Using a better name than build would also be useful, as there are numerous build folder in there, so it means nothing in this context.

This revision now requires changes to proceed.Nov 17 2019, 23:04

Rebase and address comments.

This revision is now accepted and ready to land.Nov 18 2019, 13:59
contrib/gitian-descriptors/gitian-linux.yml
55 ↗(On Diff #14046)

This is something I plan to do soon, but I don't think it should block this diff as it doesn't remove anything from current state.