build: improve build OS configure output #18966

issue fanquake openend this issue on May 13, 2020
  1. fanquake commented at 6:53 am on May 13, 2020: member

    We include the target and build OS as part of our Options used to compile and link: which is printed after running ./configure i.e:

    Building for macOS on macOS

    0  target os     = darwin
    1  build os      = darwin
    

    Building for Windows on Linux

    0  target os     = windows
    1  build os      = 
    

    Building for Linux on Linux

    0  target os     = linux
    1  build os      = 
    

    Notice build os is currently only ever set when building for darwin (host or cross-compile). This is because it’s the only target for which we actually set the $BUILD_OS variable for in configure (It’s used to set BUILD_DARWIN which is then used in our makefiles).

    We could improve this so that a build and target os are always printed for all build combinations. Feel free to ping me if you have any Qs.

  2. fanquake added the label Build system on May 13, 2020
  3. fanquake added the label good first issue on May 13, 2020
  4. RishabhBajaj97 commented at 5:40 pm on May 15, 2020: none
    Heyy! I wanted to contribute to this repository! Can you tell me how exactly do i do that?
  5. skmcontrib commented at 9:00 pm on June 1, 2020: none
    @fanquake can I work on this one?
  6. fanquake commented at 11:09 pm on June 1, 2020: member

    @fanquake can I work on this one?

    Yes, go ahead.

  7. skmcontrib commented at 1:58 pm on June 2, 2020: none
    @fanquake had a quick question. I can see where we need to set the BUILD_OS at various places in configure ac, but not sure on what would be executed be if say BUILD_LINUX (new variable) is set (in Makefile am) similar to BUILD_DARWIN (am conditional). do let me know if I’m on the right track
  8. fanquake commented at 2:28 pm on June 2, 2020: member

    @fanquake had a quick question.

    My thoughts were something a bit simpler, just swapping out the $BUILD_OS var here:

    https://github.com/bitcoin/bitcoin/blob/9e8bd217cd2a3437ce7c8fc7f04a61a3aee5268c/configure.ac#L1755 to use the $build_os variable that’s set by config.guess/config.sub. Then we don’t have to add any extra code, and will get more exact/informative build OS output than what we would create on our own.

  9. skmcontrib commented at 7:58 pm on June 2, 2020: none

    @fanquake thanks for your suggestion. here is what I tried and corresponding output of the 2 examples tried

    https://github.com/skmcontrib/bitcoin/commit/7dcebec709c1d7ece15d48d42baf6a47132e47e2#diff-67e997bcfdac55191033d57a16d1408a

    target windows and build linux

    target os = windows build os = linux


    target linux build linux

    target os = linux build os = linux

  10. fanquake commented at 6:44 am on June 3, 2020: member

    @skmcontrib I may have been unclear, the change I’m suggesting is just:

     0diff --git a/configure.ac b/configure.ac
     1index 3d8291bf5..f2f053dab 100644
     2--- a/configure.ac
     3+++ b/configure.ac
     4@@ -1752,7 +1752,7 @@ echo "  gprof enabled = $enable_gprof"
     5 echo "  werror        = $enable_werror"
     6 echo
     7 echo "  target os     = $TARGET_OS"
     8-echo "  build os      = $BUILD_OS"
     9+echo "  build os      = $build_os"
    10 echo
    11 echo "  CC            = $CC"
    12 echo "  CFLAGS        = $CFLAGS"
    

    config.sub is already doing the work of figuring out the build OS, so we might as well use that. It will also give as more useful output i.e linux-gnu or linux-musl rather than just linux.

  11. skmcontrib commented at 7:06 am on June 3, 2020: none

    @fanquake thanks for the clarification, I see what you are saying now and that makes sense. Leveraging the existing config.sub is a good idea. Also outputting the whole build os makes it more useful. Here is the output of the same cases tried earlier. Will raise a PR if you are ok.


    target os = linux build os = linux-gnu

    target os = windows build os = linux-gnu

  12. fanquake commented at 7:33 am on June 3, 2020: member

    Will raise a PR if you are ok.

    Yea that looks fine. Feel free to open a PR. Make sure you also check out CONTRIBUTING.md.

  13. fanquake referenced this in commit b42bc33d2d on Jun 4, 2020
  14. fanquake closed this on Jun 4, 2020

  15. sidhujag referenced this in commit 611c8859bc on Jun 4, 2020
  16. ComputerCraftr referenced this in commit 2b45ee166f on Jun 16, 2020
  17. MarcoFalke locked this on Feb 15, 2022

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: 2024-10-04 22:12 UTC

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