build: make 'depends' output less spammy #13654

pull kallewoof wants to merge 2 commits into bitcoin:master from kallewoof:depends-despammed changing 2 files +38 −23
  1. kallewoof commented at 7:15 AM on July 13, 2018: member

    This PR changes the tremendously spammy 'make depends' output to only print actual output if something breaks. As it stands, travis truncates the logs because it is too long, and I doubt anyone has any use for a million lines of build logs unless something actually doesn't compile.

    Need to verify:

    • I am not sure if my || cat outputfile approach will signal the exit code to automake or if automake will continue puffing along.
  2. ken2812221 commented at 7:19 AM on July 13, 2018: contributor

    You can use || ( cat outputfile && false ) to force stop make

  3. kallewoof commented at 7:27 AM on July 13, 2018: member

    @ken2812221 Nice!

  4. kallewoof force-pushed on Jul 13, 2018
  5. fanquake added the label Build system on Jul 13, 2018
  6. fanquake requested review from theuni on Jul 13, 2018
  7. kallewoof force-pushed on Jul 13, 2018
  8. kallewoof force-pushed on Jul 13, 2018
  9. kallewoof force-pushed on Jul 13, 2018
  10. kallewoof force-pushed on Jul 13, 2018
  11. kallewoof force-pushed on Jul 13, 2018
  12. theuni commented at 7:23 PM on July 13, 2018: member

    Concept ACK, though we'll potentially run into timeouts when compiling qt.

  13. in depends/funcs.mk:175 in 0970afdca9 outdated
     172 | +$($(1)_fetched): | $($(1)_introduced)
     173 |  	$(AT)mkdir -p $$(@D) $(SOURCES_PATH)
     174 |  	$(AT)rm -f $$@
     175 |  	$(AT)touch $$@
     176 | -	$(AT)cd $$(@D); $(call $(1)_fetch_cmds,$(1))
     177 | +	$(AT)cd $$(@D); ( echo -n -e ""; $(call $(1)_fetch_cmds,$(1)) ) > .fetch_output 2>&1 || ( cat .fetch_output && false )
    


    theuni commented at 7:31 PM on July 13, 2018:

    Instead of .fetch_input, let's use $$($(1)_download_dir)/.fetch_output

    That way we're guaranteed to never have any weird races or overwrites.

    It'll also take care of cleaning up the logs when successful.

  14. in depends/funcs.mk:181 in 0970afdca9 outdated
     181 | -	$(AT)echo Extracting $(1)...
     182 | +$($(1)_extracted): | $($(1)_introduced) $($(1)_fetched)
     183 | +	$(AT)echo `date $(shortdate)`: Extracting $(1)...
     184 |  	$(AT)mkdir -p $$(@D)
     185 | -	$(AT)cd $$(@D); $(call $(1)_extract_cmds,$(1))
     186 | +	$(AT)cd $$(@D); ( echo -n -e ""; $(call $(1)_extract_cmds,$(1)) ) > .extract_output 2>&1 || ( cat .extract_output && false )
    


    theuni commented at 7:44 PM on July 13, 2018:

    Same as above, but $$($(1)_download_dir)/.fetch_output. Likewise for the others.

  15. in depends/funcs.mk:165 in 0970afdca9 outdated
     157 | @@ -157,48 +158,60 @@ $(1)_autoconf += LDFLAGS="$$($(1)_ldflags)"
     158 |  endif
     159 |  endef
     160 |  
     161 | +shortdate="+%H:%M:%S"
     162 | +
     163 |  define int_add_cmds
     164 | -$($(1)_fetched):
     165 | +$($(1)_introduced):
     166 | +	$(AT)echo "============================================================"
    


    theuni commented at 7:54 PM on July 13, 2018:

    No need for the "$(AT)"s for the echos.

    A line starting with $(AT) means that it will be echoed to the terminal if you use make V=1. For example, the mkdir/rm -f below aren't interesting, so we don't usually print them. But they can be shown for debugging with V=1.


    kallewoof commented at 9:39 PM on July 13, 2018:

    Hm, got it. I'll look into undoing this if V=1.


    kallewoof commented at 5:56 AM on July 18, 2018:

    Oddly, when I removed the $(AT)'s I got the opposite result:

    $ make HOST=x86_64-apple-darwin11
    echo "============================================================"
    ============================================================
    echo "   Package : native_biplist"
       Package : native_biplist
    echo "   Date    : `date`"
       Date    : Wed Jul 18 14:55:22 JST 2018
    echo "============================================================"
    ============================================================
    14:55:22: Extracting native_biplist...
    14:55:22: Preprocessing native_biplist...
    [...]
    

    theuni commented at 8:50 PM on July 18, 2018:

    @kallewoof Sorry, I realize that was very misleading.

    An "@" in front of a rule causes it to not be echoed. $(AT) means "echo only if V=1" (otherwise it expands to "@").

    Because we never want to echo the echo command itself, you can just use @echo foo rather than $(AT) echo foo.


    kallewoof commented at 4:32 AM on July 19, 2018:

    @theuni Ahh... thanks, I didn't know that. I really need to brush up on my makefile skills one of these days...

  16. in depends/funcs.mk:178 in 0970afdca9 outdated
     177 | +	$(AT)cd $$(@D); ( echo -n -e ""; $(call $(1)_fetch_cmds,$(1)) ) > .fetch_output 2>&1 || ( cat .fetch_output && false )
     178 |  	$(AT)cd $($(1)_source_dir); $(foreach source,$($(1)_all_sources),$(build_SHA256SUM) $(source) >> $$(@);)
     179 |  	$(AT)touch $$@
     180 | -$($(1)_extracted): | $($(1)_fetched)
     181 | -	$(AT)echo Extracting $(1)...
     182 | +$($(1)_extracted): | $($(1)_introduced) $($(1)_fetched)
    


    theuni commented at 7:56 PM on July 13, 2018:

    I should think $($(1)_fetched) would be enough here, is it not for some reason?


    kallewoof commented at 9:40 PM on July 13, 2018:

    The intro part would sometimes not show for packages with nothing to fetch, it appeared like. I can try again though.

  17. in depends/funcs.mk:198 in 0970afdca9 outdated
     205 |  	$(AT)touch $$@
     206 |  $($(1)_built): | $($(1)_configured)
     207 | -	$(AT)echo Building $(1)...
     208 | +	$(AT)echo `date $(shortdate)`: Building $(1)...
     209 | +	$(AT)rm -f .built-$(1)
     210 | +	$(AT)( sleep 540; if [ ! -e ".built-$(1)" ]; then echo `date $(shortdate)`: ...; sleep 540; if [ ! -e ".built-$(1)" ]; then echo `date $(shortdate)`: ...; fi; fi ) &
    


    theuni commented at 8:00 PM on July 13, 2018:

    I don't understand what this is supposed to be doing. Looks broken, though :)


    kallewoof commented at 9:41 PM on July 13, 2018:

    It prints out "..." after 9 and 18 minutes, unless ".built-$(1)" has been deleted. It prevents travis from "nothing in 10 mins" killing at the qt build, which takes 17 mins.


    theuni commented at 10:13 PM on July 13, 2018:

    Ah, I missed the "&" at the end.

    I don't think we want to be concerned about that at this level. IMO we should just use travis_wait=20 or so for making depends.


    kallewoof commented at 10:32 PM on July 13, 2018:

    I initially went that route, but travis_wait seems to block output completely.


    ryanofsky commented at 9:20 PM on August 23, 2018:

    You should definitely add a comment describing the interaction with travis, because this is pretty obscure...

  18. theuni commented at 8:02 PM on July 13, 2018: member

    See comments inline.

    Additionally, we need to ensure that make V=1 still prints everything, so there's a way to force complete output.

  19. kallewoof force-pushed on Jul 18, 2018
  20. kallewoof force-pushed on Jul 18, 2018
  21. kallewoof force-pushed on Jul 18, 2018
  22. kallewoof force-pushed on Jul 19, 2018
  23. in depends/funcs.mk:198 in fc40bbd52e outdated
     210 | -	$(AT)echo Building $(1)...
     211 | -	$(AT)mkdir -p $$(@D)
     212 | -	$(AT)+cd $$(@D); $($(1)_build_env) $(call $(1)_build_cmds, $(1))
     213 | +	$(AT)echo `date $(shortdate)`: Building $(1)...
     214 | +	$(AT)rm -f .built-$(1)
     215 | +	$(AT)( sleep 540; if [ ! -e ".built-$(1)" ]; then echo `date $(shortdate)`: ...; sleep 540; if [ ! -e ".built-$(1)" ]; then echo `date $(shortdate)`: ...; fi; fi ) &
    


    ken2812221 commented at 11:30 AM on July 20, 2018:

    nit: What about

    $(AT)( while true; do sleep 540; if [ ! -e ".built-$(1)" ]; then echo `date $(shortdate)`: ...; else break; fi; done ) &

    kallewoof commented at 8:08 AM on July 25, 2018:

    Looks cleaner, but I don't think we want to keep going forever, as the process will continue even if the user aborts (and spam them with date... unti lthey close the terminal).

  24. ken2812221 approved
  25. ken2812221 commented at 6:24 AM on July 21, 2018: contributor

    ~Tested ACK fc40bbd~ Please add depends/.built-* into .gitignore

  26. kallewoof force-pushed on Jul 25, 2018
  27. kallewoof force-pushed on Aug 1, 2018
  28. DrahtBot commented at 5:38 AM on August 23, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->No more conflicts as of last run.

  29. ryanofsky approved
  30. ryanofsky commented at 10:03 PM on August 23, 2018: member

    ACK fba94bde752693258e319d595c624015cf52c333, tested locally and confirmed build works and new timestamped output shows up.

    The sleep 540 workaround for travis is definitely hacky, but it seems fine if it is documented.

  31. ryanofsky commented at 10:19 PM on August 23, 2018: member

    Probably just needs rebase to fix travis UnicodeEncodeError errors (https://github.com/bitcoin/bitcoin/pull/13859#issuecomment-411200990)

  32. kallewoof force-pushed on Aug 24, 2018
  33. theuni commented at 4:55 PM on August 24, 2018: member

    The more I think about it, the less I like accommodating Travis at this layer :(

    I don't mind quieting the output and dumping the build log to files rather than stdout, that makes sense. But the printing to keep Travis happy really doesn't belong here.

    IMO we should instead PR a feature to travis which creates an fd or character device for listening but not printing.

  34. luke-jr commented at 5:02 PM on August 24, 2018: member

    At the very least, it should be optional. I find it nice to watch the depends build output in gitian...

  35. MarcoFalke commented at 5:34 PM on August 24, 2018: member

    Travis should only print if one of the dependencies changes or the build environment, which happens rarely. And then requesting the raw log to take a look at it shouldn't be too much hassle to motivate for the changes here.

  36. kallewoof commented at 5:04 AM on August 27, 2018: member

    @theuni I hear you on not accommodating Travis. I'll see about using the travis wait feature again, though I believe it didn't work the last time I tried it.

  37. build: make 'depends' output less spammy
    Only print actual output if something breaks, rather than printing all of it.
    a39a5e733a
  38. .gitignore: add depends/built-* 42fc414c83
  39. kallewoof force-pushed on Sep 10, 2018
  40. ryanofsky approved
  41. ryanofsky commented at 8:12 PM on September 14, 2018: member

    utACK 42fc414c832bb869557543d78fe8ec9938931d6c. No changes since my previous review, only rebase.

    But maybe this issue should be marked work in progress, if you want to work on a different approach?

  42. kallewoof commented at 3:10 AM on September 15, 2018: member

    I'm giving up on this for now. I can't make travis happy for some reason.

  43. kallewoof closed this on Sep 15, 2018

  44. kallewoof deleted the branch on Oct 17, 2019
  45. DrahtBot locked this on Dec 16, 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-14 18:15 UTC

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