All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 00/12 v2] infra: add solution to dump metadata from packages (branch yem/show-info-2)
@ 2019-04-14 20:17 Yann E. MORIN
  2019-04-14 20:17 ` [Buildroot] [PATCH 01/12 v2] infra/pkg-download: return just a list of URIs Yann E. MORIN
                   ` (11 more replies)
  0 siblings, 12 replies; 24+ messages in thread
From: Yann E. MORIN @ 2019-04-14 20:17 UTC (permalink / raw)
  To: buildroot

Hello All!

This series is a proposal to allow extracting metadata about packages,
in a way that makes it reusable for tooling outside of Buildroot, that
is both reliable and extendable, without causing too much burden on
Buildroot own infrastructure.

This series introduces a global 'show-info' rule, and a per package and
per filesystem 'show-info' rule, that dump the package metadata as a
JSON blob. JSON is a key-value based serialisation format. As such, it
is easy to parse (there are implementations in virtually all languages,
and there are even tools like jq, that can be used from shell scripts).
But most importantly, it is easy to extend without breakign existing
tools (as long as they use proper JSON parsers, that is).

This series first introduces 4 cleanup preparatory patches in the
download infra, so that it gets easy to get the list of URIs to report
them. Strictly speaking, only patches 1 and 2 are required for this
series, but the cleanup was extended to the infra with patches 3 and 4,
for consistency.

Then, the series introduces a per package and per filesystem show-info
rule. The per filesystem rule is needed to be able to get the info about
packages that are a dependency of filesystems.

Finally, a global show-info rule is introduced that generates a JSON
array with all the information about a build.

In the end, the output for a packages would look like:

    $ make cracklib-show-info |jq . -
    {
      "cracklib": {
        "type": "target",
        "virtual": false,
        "version": "2.9.7",
        "licenses": "LGPL-2.1",
        "downloads": [
          {
            "source": "cracklib-2.9.7.tar.gz",
            "URIs": [
              "https+https://github.com/cracklib/cracklib/releases/download/v2.9.7",
              "http|urlencode+http://sources.buildroot.net/cracklib",
              "http|urlencode+http://sources.buildroot.net"
            ]
          },
          {
            "source": "cracklib-words-2.9.7.gz",
            "URIs": [
              "https://github.com/cracklib/cracklib/releases/download/v2.9.7",
              "http|urlencode+http://sources.buildroot.net/cracklib",
              "http|urlencode+http://sources.buildroot.net"
            ]
          }
        ],
        "dependencies": [
          "host-cracklib",
          "host-skeleton",
          "skeleton",
          "toolchain"
        ],
        "reverse_dependencies": [
          "libpwquality",
          "linux-pam"
        ]
      }
    }

While the whole show-info would look like (elipsed and manually indented
for readbility):

    $ make show-info
    {
      "host-gcc-final": { "type": "host", "virtual": false, ... },
      "host-binutils": { "type": "host", "virtual": false, ... },
      "toolchain-buildroot": { "type": "target", "virtual": true, ... },
      "gettext-tiny": { "type": "target", "virtual": false, ... },
      "gettext": { "type": "target", "virtual": true, ... },
      "ifupdown-scripts": { "type": "target", "virtual": false, ... },
      ...
      "rootfs-common": { "type": "rootfs", ... },
      "rootfs-tar": { "type": "rootfs", ... }
    }

Changes v1 -> v2:
  - DOWNLOAD_URIS uses foreach instead of patsubst  (Thomas P.)
  - rename dependencies keys  (Thomas DS)
  - split DOWNLOAD/DOWNLOAD_URIS comments  (Thomas DS)
  - make-comma-list uses an explicit $(space)  (Thomas DS)
  - top-level show-info is a dictionary, not an array  (Arnout)
  - use a macro to generate a JSON element for an item  (Arnout)
  - drop the 'null' object in download list  (Arnout, Thomas DS)
  - change graph-depends to use that instead of show-dependency-graph
  - drop show-dependency-graph
  - fix double list of URIs
  - fix typoes


Regards,
Yann E. MORIN.


The following changes since commit 46cd7061228720ddb93f540bc733359304d8118f

  package/dacapo: fix indentation (2019-04-14 17:20:26 +0200)


are available in the git repository at:

  git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 3f4a75c33a5f817dcd7a3576086ffca4c18e522b

  core: remove show-depednency-tree (2019-04-14 17:56:08 +0200)


----------------------------------------------------------------
Yann E. MORIN (12):
      infra/pkg-download: return just a list of URIs
      infra/pkg-download: make the URI list a callable macro
      infra/pkg-download: get rid of the FLOCK variable
      infra/pkg-download: make the DOWNLOAD macro fully parameterised
      infra/utils: add helper to generate comma-separated lists
      fs: introduce variables with name and type
      fs: introduce variable with all recursive dependencies
      fs: add all recursive dependencies to packages list
      core: introduce new global show-info
      core: add per-package and per-filesystem show-info
      support/scripts: use show-info to extract dependency graph
      core: remove show-depednency-tree

 Makefile                     | 19 ++++++++++---
 fs/common.mk                 | 45 +++++++++++++++++++++++------
 package/pkg-download.mk      | 46 +++++++++++++++++-------------
 package/pkg-generic.mk       |  9 +++---
 package/pkg-utils.mk         | 68 ++++++++++++++++++++++++++++++++++++++++++++
 support/misc/utils.mk        |  4 +++
 support/scripts/brpkgutil.py | 31 +++++++++-----------
 7 files changed, 169 insertions(+), 53 deletions(-)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-04-16 20:10 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-14 20:17 [Buildroot] [PATCH 00/12 v2] infra: add solution to dump metadata from packages (branch yem/show-info-2) Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 01/12 v2] infra/pkg-download: return just a list of URIs Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 02/12 v2] infra/pkg-download: make the URI list a callable macro Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 03/12 v2] infra/pkg-download: get rid of the FLOCK variable Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 04/12 v2] infra/pkg-download: make the DOWNLOAD macro fully parameterised Yann E. MORIN
2019-04-15  9:08   ` Arnout Vandecappelle
2019-04-15 17:18     ` Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 05/12 v2] infra/utils: add helper to generate comma-separated lists Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 06/12 v2] fs: introduce variables with name and type Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 07/12 v2] fs: introduce variable with all recursive dependencies Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 08/12 v2] fs: add all recursive dependencies to packages list Yann E. MORIN
2019-04-15  9:48   ` Arnout Vandecappelle
2019-04-14 20:17 ` [Buildroot] [PATCH 09/12 v2] core: introduce new global show-info Yann E. MORIN
2019-04-15 12:17   ` Arnout Vandecappelle
2019-04-15 12:23     ` Thomas Petazzoni
2019-04-15 17:34     ` Yann E. MORIN
2019-04-15 17:51       ` Arnout Vandecappelle
2019-04-15 18:51         ` Yann E. MORIN
2019-04-16  9:47     ` Peter Korsgaard
2019-04-16 19:49       ` Arnout Vandecappelle
2019-04-16 20:10         ` Peter Korsgaard
2019-04-14 20:17 ` [Buildroot] [PATCH 10/12 v2] core: add per-package and per-filesystem show-info Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 11/12 v2] support/scripts: use show-info to extract dependency graph Yann E. MORIN
2019-04-14 20:17 ` [Buildroot] [PATCH 12/12 v2] core: remove show-depednency-tree Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.