Skip to content

Conversation

@theuni
Copy link
Member

@theuni theuni commented Jul 1, 2013

Changes since Round 1:

  • Rebased on current master
  • Moved configure to root srcdir, and added a Makefile there
  • Split into several Makefile.am's with recursive build [1]
  • Work towards building correctly under gitian
  • Fixed/verified several build scenarios
  • Fixed up 'make dist' to work as a viable end-result packaging mechanism [2]
  1. Personally I believe that splitting up the build is a major regression from RFC1. This was done by request here. Most projects end up spending lots of time moving in the opposite direction, as a recursive build tends to be slower, more complicated, and more-error prone. That proves to be the case here as well, but I've attempted to handle it as gracefully as possible.
  2. 'make dist' can be used to produce a bootstrapped tarball with git information included, intended for distribution as an 'official source release'. This is the equivalent of taking a fresh git clone, running './autogen.sh', and tar'ing up the result. This is the common procedure for autotools projects.

At this point I consider it to be merge-ready, with the exception of verification of gitian descriptors and documentation. Presumably removal of the old makefile.* would coincide with updated documentation. Several things can be improved and cleaned up after merge (dealing with versioning, for example), but I've tried to ignore these things as much as possible for the sake of a quick merge.

Edit: Removed crazy markup that looked like yelling -- sorry.

Here is the second go at an Autotools build system replacement. It is meant to be a drop-in replacement for the current system(s), providing the same features with no net changes. It can also live side-by-side with the old system while sharing the same build-related variables in order to facilitate a smooth transition.

I hope the benefits are obvious enough: A single/shared build procedure, portability, ease of packaging, ease for downstreams, ease for repository maintainers, cross-compilation, etc. I don't vouch for Autotools in any way, in fact, this configure.am is downright ugly (mainly just because of mingw though), but it's portable and well-established.

I've opted not to write the documentation yet, because I would like to see what comments/concerns come out of the first round of review before committing to anything.

This does away with the need for qmake, as the Makefile is capable of generating everything it needs in a portable way.

Qt-creator can be used with the Autotools plugin, and is working nicely. For those who wish to use it this way, install the Autotools plugin from the 'about' menu, then open Makefile.am as a project. It handles the build procedure, so there is no need to mess with the command-line procedures listed below.

Building from CLI:
For Linux, assuming the dependencies have been met, the build procedure looks like this:

./autogen.sh
./configure
make

Same for OS X, but the pkg-config path needs to be hooked up from macports first:

echo "/opt/local/share/aclocal" | sudo tee -a /usr/share/aclocal/dirlist

For mingw it's the same, but you will need to provide lots of paths in the form of:

./autogen.sh
CPPFLAGS="-I/path/to/include -I/path/to/other/include" LDFLAGS="-L/path/to/libs -L/path/to/other/libs" ./configure
make

In addition, there are helpers for qt and boost to help with finding some locations.
Use ./configure --help to see the available options.

Native windows built is untested, as I don't have a windows environment at my disposal.

Gitian should be working for win32 builds. I've guessed at Linux but have not yet verified.

'make check' will run the unit tests and print the results.

I've done my best to avoid adding any new behavior or features, and I would much prefer to aim for feature-parity before making any improvements.

TODO:

  • Verify gitian descriptors.
  • Add documentation

Cory Fields added 5 commits June 30, 2013 16:22
This is Part of an autotools buildsystem port.

Previously MSG_NOSIGNAL was defined in a few places, and -DMSG_NOSIGNAL=0 was
passed by the osx build to signify that it was unavailable there. For Win32, it
was assumed to be unavailable.

This commit flips the logic so that the unix build declares the feature. The
HAVE_MSG_NOSIGNAL define will be (automatically detected and) set by autotools
as well, so that both build methods will give the same results.

There should be no observable changes in functionality here.
This allows us to search for .git, so that we can make a guess as to whether
we're in a repository or just an extracted tarball.

TODO: might want to check for GIT_DIR env var as well.
For example, CC="ccache gcc" or CXX="ccache g++"
@theuni
Copy link
Member Author

theuni commented Jul 5, 2013

@jgarzik @laanwj @sipa ping. Any comments?

@sipa
Copy link
Member

sipa commented Jul 7, 2013

Changes look good to me, except that I do not want to maintain two build systems in parallel. If we switch to autotools, we switch, and the existing makefiles go away. Gitian determinism can be fixed later (though just builds should be verified to work). Unfortunately; I can't test myself now (I'm not at home).

About -Qt, you'll want an ACK from @laanwj

I have no opinion about recursive makefiles or not.

configure.ac Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AC_ARG_WITH is for dependencies.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change.

@theuni
Copy link
Member Author

theuni commented Jul 18, 2013

So then you still have to add it for each one you want to build, but you've disabled the default for what (arguably) most builders will want. I still don't see how it's a step up in any way from --with-qt (or --with-bitcoin-qt) or --without-qt.

If we're talking >5 or so front-ends in the future, sure. But presumably at that point they'd have to be split into separate projects by then anyway.

This whole discussion smells of an over-engineered bikeshed to me ;)

@luke-jr
Copy link
Member

luke-jr commented Jul 18, 2013

--with-qt implies it's the same client being built with or without Qt, which isn't exactly the case here.
You may have a point with regard to prioritizing splitting up the repositories before too many implementations grow on it.

@theuni
Copy link
Member Author

theuni commented Jul 18, 2013

Compromise at --with-qt-frontend ?

@theuni
Copy link
Member Author

theuni commented Jul 18, 2013

or even --enable-qt-frontend, since qt-frontend would be a feature in this case rather than a library for inclusion.

@luke-jr
Copy link
Member

luke-jr commented Jul 18, 2013

Would it be hard to leave it out entirely so the builder just does:
make bitcoin-qt
make bitcoind
make all
?

@theuni
Copy link
Member Author

theuni commented Jul 18, 2013

Sure, those already work.

They're awkward with the recursive makefiles, which is one of the reasons I was against. You have to be in the correct dir for them to work:

make (makes all)
cd src; make bitcoind
cd src/qt; make bitcoin-qt

But some phony targets would be no-brainers to add, then they'd work anywhere.

However you still need to be able to check for things. If you didn't, you could try to make bitcoind, only to find qrcode missing, and we wouldn't know if that was on purpose or an error. Then you've just negated the purpose of the buildsystem :)

So the options and checks in configure need to stay. As implemented, they're what any package maintainer would expect to see.

@luke-jr
Copy link
Member

luke-jr commented Jul 18, 2013

If qrencode is missing, it should be a warning (and disable itself), not an error, unless --with-qrencode is specified ;)

@theuni
Copy link
Member Author

theuni commented Jul 18, 2013

It is, but qrencode is never checked unless qt is enabled. Nor should it be.

This discussion has gone way off track, and this is the kind of thing I was afraid of. This thing will never be merged if the points of contention are cosmetic. I'm happy to change those to whatever makes you guys happy and argue them post-merge.

@luke-jr
Copy link
Member

luke-jr commented Jul 18, 2013

I don't think anyone considers this an obstacle to merging. I believe that is just waiting on @laanwj at this point.

@laanwj
Copy link
Member

laanwj commented Jul 22, 2013

I preferred a non-recursive makefile as well, but I don't want to bikeshed about this.

ACK after squash

@jgarzik
Copy link
Contributor

jgarzik commented Jul 24, 2013

Looks really, really good.

The only issue I found during review: bitcoin-config.h should normally be the -very- first include, because it may need to change the behavior of certain includes that follow. This may or may not be needed with bitcoin, but it is general practice when coding autotools code.

Also, make sure bitcoin-config.h includes the standard header #ifndef FOO_H ... guard at the top and bottom. Google claims AH_TOP and AH_BOTTOM may be used for this.

ACK once these issues are resolved.

Pull tester want any changes for this?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these updated in the future (adding new ones to Bitcoin-Qt happens sometimes, when I create a Transifex sync pull)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add them to QT_TS and QT_QM here. Is that what you meant?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean currently the files need to be listed in src/qt/bitcoin.qrc to be usable by Bitcoin-Qt. Does this whole pull move completely away from our bitcoin-qt.pro file and qmake? If that is a dumb question, sorry I'm that Windows guy and makefiles are magic for me ^^.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem.

Yes, this does away with the need for qmake, instead we run the same tools that qmake uses, but we run them ourselves instead of describing the process in a .pro file.

@theuni
Copy link
Member Author

theuni commented Jul 24, 2013

@jgarzik good suggestion on bitcoin-configh.h, thanks. Done. As for the header order, I've changed it as requested, though I would disagree and say that if (in-project) include order matters, something else is broken somewhere. But that's way out of scope here :)

@theuni
Copy link
Member Author

theuni commented Jul 24, 2013

@jgarzik as for BitcoinPullTester, I'm not sure. It seems to have a hard-coded build process. If that's the case, it should change to:

./autogen.sh && ./configure && make check

@gavinandresen
Copy link
Contributor

RE: the pull tester:

The pull tester build/test script lives at:
https://github.com/TheBlueMatt/test-scripts/blob/master/build-script.sh

A patch that checks for configure.ac (or whatever) and Does the Right Thing in the right places would be nifty.

Cory Fields added 2 commits July 25, 2013 16:50
This uses makensis to create the win32 installer exe.

Usage: make windows-deploy
@BitcoinPullTester
Copy link

Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/bad255871be523773c07fc3ac64f7d5f03032041 for binaries and test log.

This could happen for one of several reasons:

  1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in contrib/test-scripts)
  2. It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time
  3. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
  4. The test suite fails on either Linux i386 or Win32
  5. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)

If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here.

This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

@wtogami
Copy link
Contributor

wtogami commented Aug 18, 2013

What needs to be done to move this forward?

@sipa
Copy link
Member

sipa commented Aug 18, 2013

I believe all that is left is rebasing, squashing, removing the old makefiles, and updating some documentation?

Fixing determinism can be done after merge, IMHO, but the build should work on all supported environments. Fixing pulltester can only be done after merging as well.

@theuni
Copy link
Member Author

theuni commented Aug 19, 2013

I have a bunch of work in a local branch that needs to be cleaned up and pushed here.

I'll have this merge-ready without fail by this time next week (my schedule is back to normal then).

@theuni
Copy link
Member Author

theuni commented Aug 27, 2013

Closing in favor of a new (final) PR.

@theuni theuni closed this Aug 27, 2013
@theuni theuni mentioned this pull request Aug 27, 2013
@theuni
Copy link
Member Author

theuni commented Aug 27, 2013

Edit: Whoops, fixed link.
Continued at #2943.

Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Apr 5, 2019
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants