builds: Review use of @-prefixed lines in our Makefiles #18891

issue dongcarl openend this issue on May 5, 2020
  1. dongcarl commented at 6:49 pm on May 5, 2020: contributor

    From https://www.gnu.org/software/make/manual/make.html#Echoing:

    Normally make prints each line of the recipe before it is executed. We call this echoing because it gives the appearance that you are typing the lines yourself.

    When a line starts with ‘@’, the echoing of that line is suppressed. The ‘@’ is discarded before the line is passed to the shell. Typically you would use this for a command whose only effect is to print something, such as an echo command to indicate progress through the makefile:

    0[@echo](/bitcoin-bitcoin/contributor/echo/) About to make distribution files
    

    Since there is no way to turn off the @-prefix behaviour other than giving the --just-print flag (which puts make in dry-run mode and thus does not always work properly), we should make sure that we only put @ where we mean to for debuggability’s sake. In practice, this probably means using @-prefix only when we’re @echo-ing.


    For example: https://github.com/bitcoin/bitcoin/blob/fbd522721cb89ef0efea0c1bc912c00b268d1c2a/Makefile.am#L83-L85

    Will silence the printing of $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi, which might be useful information. In fact, this whole snippet could just be:

    0	$(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi
    

    Let me know what you think!

  2. dongcarl added the label Build system on May 5, 2020
  3. dongcarl added the label good first issue on May 5, 2020
  4. ruhi1999 commented at 2:03 am on May 7, 2020: none
    I’d like to work on this!
  5. dongcarl commented at 2:00 pm on May 7, 2020: contributor
    @ruhi1999 Sounds good, I’d be happy to review once a PR is up.
  6. hebasto commented at 7:25 am on May 8, 2020: member
  7. freenancial referenced this in commit 55580fccee on Jul 10, 2020
  8. preeti13456 commented at 4:36 pm on June 21, 2021: none
    I am interested to work on this issue
  9. maflcko commented at 6:24 am on June 22, 2021: member
    @preeti13456 No need to ask for permission if you want to work on an issue. You can just go ahead and open a pull request once you are done.
  10. hebasto commented at 7:17 am on June 22, 2021: member
    Related to #22283.
  11. annahubbard commented at 7:55 pm on September 21, 2022: none
    Hey! I am interested in solving this issue! I see a description of the @ and echo functionality within a makefile. Are you suggesting that the bitcoin/Makefile.am file remove the @ prefix for the test command since it seems to be best practice that @ is only used to preface echo? Any clarity would be great as I am looking to learn about bitcoin core and makefiles but am unclear on the issue at hand to be solved.
  12. TheCharlatan commented at 9:35 pm on February 3, 2023: contributor
    Related to #27041,
  13. TheCharlatan commented at 12:09 pm on May 16, 2023: contributor
    With #27041 merged, I checked the remaining few instances and think they all serve a purpose, so I think this could be closed now.
  14. fanquake closed this on May 16, 2023

  15. bitcoin locked this on May 15, 2024

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-12-19 00:12 UTC

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