bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #59318] Add option ('-g') of generating build graph for updated goa


From: Jonas Danielsson
Subject: [bug #59318] Add option ('-g') of generating build graph for updated goals
Date: Thu, 22 Oct 2020 04:00:11 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?59318>

                 Summary: Add option ('-g') of generating build graph for
updated goals
                 Project: make
            Submitted by: jonasdn
            Submitted on: Thu 22 Oct 2020 08:00:08 AM UTC
                Severity: 3 - Normal
              Item Group: Enhancement
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.3
        Operating System: None
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

Hi!

I know this enhancement has been discussed before for the GNU Make project.
But I would like to modestly propose complementing the powerful
--print-database option with something that is a bit easier to grasp at a
glance.

A graph visualisation can be helpful in order to get a better understanding of
the workings of a GNU Make based project. Particularly if you are debugging
why something keeps rebuilding each pass or if you are very new to a projekt.

All the information that can be gleaned from this graph output is already
present in the output of --print-database. However I strive to present it more
succinct. Only the targets that were modified in the goal is present and the
relationship between targets and prerequisite is hopefully more clear.
    
The output from the goal graph is stored in files called _goal_.dot in the
starting directory.
    
The hope is also that this can be paired with already existing viewers and
explorers, since the dot language is well known (29 years!).

This is something that can be used for instance when trying to figure out why
something keeps rebuilding / updating on a second run of Make. Or for figuring
out the dependency chain of a particular goal. As a first approach to get a
hint, and then perhaps using --print-database to learn more.
    
An example (rebuilding GNU Make):
      $ touch src/file.c
      $ AM_MAKEFLAGS="-g" make -g
      Making all in lib
      make[1]: Entering directory '/home/jonas/sandbox/mymake/lib'
      /home/jonas/sandbox/mymake/./make -g all-recursive
      make[2]: Entering directory '/home/jonas/sandbox/mymake/lib'
      make[3]: Entering directory '/home/jonas/sandbox/mymake/lib'
      make[3]: Nothing to be done for 'all-am'.
      make[3]: Leaving directory '/home/jonas/sandbox/mymake/lib'
      make[2]: Writing dependency graph to
'/home/jonas/sandbox/mymake/lib/all-recursive.dot'
      make[2]: Leaving directory '/home/jonas/sandbox/mymake/lib'
      make[1]: Writing dependency graph to
'/home/jonas/sandbox/mymake/lib/all.dot'
      make[1]: Leaving directory '/home/jonas/sandbox/mymake/lib'
      Making all in po
      make[1]: Entering directory '/home/jonas/sandbox/mymake/po'
      make[1]: Nothing to be done for 'all'.
      make[1]: Leaving directory '/home/jonas/sandbox/mymake/po'
      Making all in doc
      make[1]: Entering directory '/home/jonas/sandbox/mymake/doc'
      make[1]: Nothing to be done for 'all'.
      make[1]: Leaving directory '/home/jonas/sandbox/mymake/doc'
      make[1]: Entering directory '/home/jonas/sandbox/mymake'
    
      [...]
      [gcc building]
      [...]
    
      make[1]: Writing dependency graph to
'/home/jonas/sandbox/mymake/all-am.dot'
      make[1]: Leaving directory '/home/jonas/sandbox/mymake'
      make: Writing dependency graph to '/home/jonas/sandbox/mymake/all.dot'

$ cat all-am.dot
      digraph all-am {
      "make" -> "src/file.o"
      "all-am" -> "make"
      "all-am"
      }
    
      $ cat all.dot
      digraph all {
      "all" -> "all-recursive" [label="forced: PHONY prerequisite"]
      "all"
      }

PNG versions of these graphs (generated with dot -Tpng) can be found as
attachments.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 22 Oct 2020 08:00:08 AM UTC  Name:
0001-Add-g-opt-for-graph-output-of-modified-targets.patch  Size: 9KiB   By:
jonasdn

<http://savannah.gnu.org/bugs/download.php?file_id=50045>
-------------------------------------------------------
Date: Thu 22 Oct 2020 08:00:08 AM UTC  Name: all.png  Size: 12KiB   By:
jonasdn

<http://savannah.gnu.org/bugs/download.php?file_id=50046>
-------------------------------------------------------
Date: Thu 22 Oct 2020 08:00:08 AM UTC  Name: all-am.png  Size: 11KiB   By:
jonasdn

<http://savannah.gnu.org/bugs/download.php?file_id=50047>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59318>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]