build: Move m4 scripts (incl. auto-generated m4s) out of src. #4719

pull randy-waterhouse wants to merge 1 commits into bitcoin:master from randy-waterhouse:out-of-src changing 17 files +40 −35
  1. randy-waterhouse commented at 10:33 AM on August 18, 2014: contributor

    Create build-aux/m4 dir. Move m4 scripts for out-of-src builds. Tidy away pkg.m4 script. Readibility and fixes AC_CONFIG macro calls in configure.ac. Add warnings for autoreconf.

    Move m4 to standard location. Beginning of out-of-src build work but useful on its own. Tested on linux RH-derivative, ubuntu and OSX 10.7. Needs further cross-platform testing.

  2. laanwj commented at 10:35 AM on August 18, 2014: member

    Isn't the problem with out-of-source directory builds that leveldb can't cope with them?

  3. randy-waterhouse commented at 11:05 AM on August 18, 2014: contributor

    Yes leveldb will be a large part. Here are some preliminaries that are standard practice structure anyway.

  4. jmcorgan commented at 2:13 PM on August 18, 2014: contributor

    I'd love to see VPATH builds supported, but we'll have to decide if we want to carry changes to the leveldb autofoo.

  5. laanwj added the label Build system on Aug 18, 2014
  6. theuni commented at 9:35 PM on August 18, 2014: member

    pkg.m4 at root is deliberate, it allows for installs that don't have pkg-config macros.

    When running autoconf, pkg.m4 is pulled from the system if present from the path "pkg.m4". If it's not present, this file is substituted. If the file is in any other path, the substitution won't happen. So it either needs to stay there, or we must only support autoconf versions where it's built-in. That would mean just deleting this file.

    This is necessary for at least osx 10.6, not sure where else.

  7. theuni commented at 9:43 PM on August 18, 2014: member

    build-aux is where auto* installs all of its files as necessary. src/m4 are source files under our control. I don't see any compelling reason to combine them?

    As @laanwj said, leveldb is what stands in the way of out-of-tree builds. We would need to take on the burden of enumerating their files. Personally, I'd be fine with that since we pull from upstream quite rarely.

  8. randy-waterhouse commented at 5:55 AM on August 19, 2014: contributor

    "pkg.m4 at root is deliberate, it allows for installs that don't have pkg-config macros. When running autoconf, pkg.m4 is pulled from the system if present from the path "pkg.m4". If it's not present, this file is substituted. If the file is in any other path, the substitution won't happen. So it either needs to stay there, or we must only support autoconf versions where it's built-in. That would mean just deleting this file. This is necessary for at least osx 10.6, not sure where else."

    This not the observed behaviour. pkg.m4 is picked up by aclocal not autoconf. On linux usually the system pkg.m4 is installed in /usr/share/aclocal/pkg.m4. autogen.sh runs autoreconf which is a combination of aclocal automake autoconf libtoolize

    ./configure runs after autogen.sh so the current set-up includes the bitcoin supplied pkg.m4 preferentially ahead of system pkg.m4, which is what I assumed you wanted and thus my mod does not change that behaviour, merely tidies files into one known location for m4 scripts.

    The OSX 10.6 problem is more likely due to Fink or Ports installing pkg-config and brew installing autotools, or vice versa, in which case pkg.m4 is not being found, i.e. user should check /opt/local/share/aclocal/pkg.m4 or /sw/share/aclocal/pkg.m4 or /usr/local/share/aclocal/pkg.m4 or /usr/share/aclocal/pkg.m4

    I suggest remove pkg.m4 and allow system pkg.m4 to be used as default in the majority of cases.

  9. laanwj commented at 8:49 AM on August 19, 2014: member

    @theuni Would it be possible to patch the leveldb build system to support out-of-tree build? I'd prefer that to enumerating the files ourselves, because it could be upstreamed. I agree that taking up the list of leveldb files is not an extreme extra maintenance burden, but all these small things do add up.

  10. theuni commented at 4:53 PM on August 19, 2014: member

    It'd be easy enough, but I don't think they'd be interested in accepting it. The problem is that autotools forces you to list each file rather than globbing, which is a really really good thing. That prevents stray files from slipping into release tarballs.

    To fix in an upstreamable way, we'd have to split their makefile up into 2 files, one which just lists sources, and the other to handle build logic. We would include the first from one of our Makefiles. From their POV, there would be no compelling reason to accept that.

    More realistically, we'd just enumerate those files ourselves. Anything left out would not be copied to our release tarballs, so builds would fail. Since we update leveldb very rarely anyway, I think it'd be a reasonable burden to take on.

  11. theuni commented at 5:01 PM on August 19, 2014: member

    @randy-waterhouse Yes sorry, i meant aclocal. And after some testing, it seems you're correct about the include order for pkg.m4 as well. The wording here led me to believe that the system m4 would have precedence, but an 'aclocal --verbose' indeed shows our file being used first.

    That being said, I'm not willing to break build on some platforms just for some "neatness". Surely we can use an ifndef on one of the pkg-config macros to determine if we need to user our own file or not?

  12. randy-waterhouse force-pushed on Aug 19, 2014
  13. randy-waterhouse commented at 12:35 AM on August 20, 2014: contributor

    @theuni have you actually verified that an aclocal/pkg.m4 really is non-existent on those platforms or is it the user's misconfigured pkg-config/autotools set-up not passing correct include paths? The code right now looks like a hack in the bitcoin build code that is inadvertently affecting behaviour on all systems to load a non-system pkg.m4. Keeping things neat and in known locations makes debugging simpler and provides integrity for path dependent functionality generally ... basically it's good practice.

  14. randy-waterhouse force-pushed on Aug 22, 2014
  15. randy-waterhouse force-pushed on Aug 24, 2014
  16. laanwj commented at 10:52 AM on August 25, 2014: member

    I'm not sure that we have to cater to a allegedly broken build environment on an ancient MacOSX version. Do we know anyone actually building with that? Or that can test?

  17. randy-waterhouse force-pushed on Aug 25, 2014
  18. theuni commented at 7:20 AM on August 26, 2014: member

    @laanwj It for sure broke my 10.6 environment before I moved to a new 10.9 macbook. Generally, I'm opposed to knowingly breaking something for no known benefit. That being said...

    I've been working on retooling the osx environment. It's looking like Apple is moving to make 10.9 the new minimum dev requirement as quickly as possible, and I want to be sure we're ready for that. I've got the cross and native build up and running with recent clang and 10.9 sdk (still 10.6 minimum runtime, so no user-facing changes other than better functionality on newer OSs).

    Point being: when we're looking to bump up our minimum required dev environment, I have no problem dropping these kind of compat workarounds. Without good reason though, I just don't see why we would.

  19. randy-waterhouse force-pushed on Aug 26, 2014
  20. randy-waterhouse force-pushed on Aug 26, 2014
  21. randy-waterhouse commented at 8:29 AM on August 26, 2014: contributor

    #4765 I moved the less contentious fixes to a separate PR ...

    Re: the existing 'workaround' ... that it is bypassing correct functionality on all other platforms should be a bigger consideration than a nearly obsolete platform?

  22. theuni commented at 8:44 AM on August 26, 2014: member

    I named a problem it causes. You haven't named a problem that it fixes. So yes.

    #4765 looks fine, thanks. The verbose flag was there originally but removed. I don't mind either way.

  23. randy-waterhouse commented at 9:12 AM on August 26, 2014: contributor

    The OSX 10.6 'problem' has not been verified and from studying the documentation (and experience) is most likely due to a misconfigured system than a true lack of pkg.m4 script (which has been bundled with pkg-config installs since at least 2006).

    The problem it fixes is to correct the behaviour of the autoconf system to use a local platform pkg.m4 script and not the hacked provided one of bitcoin src. And the code is tidier.

  24. theuni commented at 7:58 PM on August 26, 2014: member

    The osx 'problem' has been verified by me. I personally added the fix because it is needed on my 10.6 macbook. A quick googling turns up lots of hits like this one: https://stackoverflow.com/questions/8578181/using-the-pkg-config-macro-pkg-check-modules-failing

    Again, if you're going to argue that it's reasonable to remove some functionality that someone may be relying on that's perfectly fine and I could most definitely be persuaded. But you still haven't given a tangible benefit other than "the code is tidier". I get that using the system m4 is the correct thing to do. I really do. But if there's no tangible benefit, then that point carries no weight.

    At this point I really don't care because this is a silly thing to be arguing over. Ultimately, I just really dislike the "maybe break a working thing for the sake of technical correctness" type of changes.

  25. randy-waterhouse commented at 10:21 PM on August 26, 2014: contributor

    Use 'aclocal --print' to determine the directory in which to look for pkg.m4 then add that output to your include for autogen is the correct fix. aclocal -I /opt/local/share/aclocal

    I think we can agree to disagree if you are unwilling to accept that the current code is not functioning correctly because of the botched "workaround" implementation. I agree that it is a silly little thing to be arguing over ...

  26. randy-waterhouse force-pushed on Aug 26, 2014
  27. randy-waterhouse force-pushed on Aug 27, 2014
  28. randy-waterhouse force-pushed on Aug 28, 2014
  29. randy-waterhouse force-pushed on Aug 29, 2014
  30. randy-waterhouse force-pushed on Aug 30, 2014
  31. randy-waterhouse force-pushed on Sep 1, 2014
  32. randy-waterhouse force-pushed on Sep 1, 2014
  33. randy-waterhouse force-pushed on Sep 2, 2014
  34. randy-waterhouse force-pushed on Sep 2, 2014
  35. randy-waterhouse force-pushed on Sep 3, 2014
  36. randy-waterhouse force-pushed on Sep 6, 2014
  37. randy-waterhouse force-pushed on Sep 8, 2014
  38. randy-waterhouse force-pushed on Sep 10, 2014
  39. randy-waterhouse force-pushed on Sep 11, 2014
  40. sipa commented at 5:34 PM on September 12, 2014: member

    Does this need to be rebased every day?

  41. laanwj commented at 9:19 AM on September 13, 2014: member

    If you split off the removal of pkg.m4, which is the only controversial part, this could have been merged almost a month ago..

  42. Create the common location for all m4 autotool build scripts, build-aux/m4.
    Update .gitignore.
    b3e5339426
  43. randy-waterhouse force-pushed on Sep 13, 2014
  44. randy-waterhouse commented at 11:27 PM on September 13, 2014: contributor

    @laanwj OK, I split off the custom pkg.m4 removal (will put in separate PR for that fix).

  45. BitcoinPullTester commented at 11:51 PM on September 13, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4719_b3e53394263839989357ff1248ca13e797664c55/ for binaries and test log. 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.

  46. laanwj commented at 9:52 AM on September 16, 2014: member

    These auto-generated files need to be in .gitignore:

    ?? build-aux/compile
    ?? build-aux/test-driver
    
  47. laanwj referenced this in commit 6fc1dc1a32 on Sep 16, 2014
  48. laanwj commented at 10:00 AM on September 16, 2014: member

    Merged via 6fc1dc1 (with .gitignore addition)

  49. randy-waterhouse closed this on Sep 16, 2014

  50. randy-waterhouse deleted the branch on Sep 16, 2014
  51. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 21:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me