Herodotus

From ALT Linux Wiki
Revision as of 22:27, 17 October 2018 by Imz (talk | contribs) (→‎How to try herodotos: a comment about Makefile.local)


(It's a work in progress.)

Herodotus is a project for tracking and linking analytic and synthetic facts about (the releases of) a package. The tracking is to be done independently per package. (Sisyphus is an example of a repository of packages where this can be applied.)

(Herodotus is inspired by, and partly based in the implementation, on herodotos tool. Note the different spelling of the name of this tool and of our project. Named after Herodotus.)

Which computed or external meta-information for a package is tracked
  • Analytic facts (computed from the "internal" content of package releases):
  • Static analysis of the C/C++ code (warnings):
  • by coccinelle
  • by cppcheck
  • ...
  • Discovery of source files which are not used during the build of the package (by means of strace or by the access time)
  • ...
  • Synthetic facts (added "externally" by maintainers)
  • Resolutions for the warnings from the static analysis (a reason why they are invalid or a fix).
  • ...
Representation
  • Each fact is linked to the corresponding Git (Gear) commit or tag.
  • (The facts can be stored in the same Git repository in a separate branch.)
  • If the "same" fact appears for several releases, all its occurrences are linked together, so that a maintainer can view them as a single fact. Only when the facts change between releases, it should need attention.
User interfaces
  • Files (obtained via Git), org-mode editor (Emacs; org-mode is like a personal wiki)
  • ...

Implementation details

The core: herodotos tool

herodotos tool runs the analyzers for different releases and then links identical facts (modulo the diff, i.e., the changes of the source code).

Description of herodotos tool

herodotos in Sisyphus

requires:

How to try herodotos

If you want to try herodotos, try to reproduce the authors' work http://coccinelle.lip6.fr/papers/aosd10.pdf :

  • install herodotos (for p8) from task 214330;
  • get (and use) their data and configuration;
  • download the corresponding source code (multiple versions; e.g., the linux kernel):
   git clone --recurse-submodules git://git.altlinux.org/people/imz/public/herodotos-test.git
   mkdir -p herodotos-test/INPUT-PROJECTS/{openssl,wine,linux,vlc}
   mkdir INPUT-REPOS
   cd INPUT-REPOS
   git clone git://git.altlinux.org/gears/o/openssl098.git
   for t in $(cd openssl098/; git tag -l 'v*'); do git clone -b "$t" openssl098 ../herodotos-test/INPUT-PROJECTS/openssl/openssl-"${t#v}"; done
   git clone git://git.altlinux.org/gears/k/kernel-source-2.6.29.git
   for t in $(cd kernel-source-2.6.29/; git tag -l 'v2.6.??'); do git clone -b "$t" kernel-source-2.6.29 ../herodotos-test/INPUT-PROJECTS/linux/linux-"${t#v}"; done
   git clone git://git.altlinux.org/gears/w/wine-vanilla.git
   for t in wine-20050830 $(cd wine-vanilla/; git tag -l 'wine-0.9*') wine-1.1.{1,6,11}; do git clone -b "$t" wine-vanilla ../herodotos-test/INPUT-PROJECTS/wine/"$t"; done
   #git clone git://git.altlinux.org/gears/v/vlc.git
   # Well, ALT's repo doesn't hold the revisions from the herodotos example config.

How to run it then:

   make -f Makefile.local aosd.hc

I use Makefile.local, because the main Makefile computes some values based on *.hc, and this computation will fail if there is no *.hc.

coccinelle support

coccinelle is natively supported by herodotos tool.

Actually, herodotos tool can work with any analyzer which gives output in the org-mode format.

coccinelle in Sisyphus

cppcheck support

  • cppcheck is supported by flycheck (an Emacs package)
  • flycheck can be hacked to output the information in the format suitable for herodotos tool (org-mode)

So, we could easily get the support for any analyzer known to flycheck.

cppcheck in Sisyphus

  • Symbol support vote.svg cppcheck
  • Symbol oppose vote.svg emacs-mode-flycheck
  • Symbol oppose vote.svg flycheck output in org-mode format

Discovery of source files which are not used during the build of the package

Either builds under strace can be used to discover files which are not used, or the access time (an idea by boyarsh@, which has already been probably implemented by him).

Usage

(to be written)