all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Regarding "Use Invoke" or "Return a boolean from phase" commits
Date: Mon, 04 Jun 2018 22:35:54 -0400	[thread overview]
Message-ID: <87lgbu3qph.fsf@netris.org> (raw)
In-Reply-To: <87k1ressbv.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 04 Jun 2018 13:29:24 +0200")

Hi Ludovic,

ludo@gnu.org (Ludovic Courtès) writes:

> Mark H Weaver <mhw@netris.org> skribis:
>
>> Furthermore, it will be important for a static code analyzer to be able
>> to infer that phases and snippets always return #t, so let's try not to
>> be too clever about it.  We'll need a static analyzer to gain confidence
>> that we can start ignoring the return values without losing failure
>> reports.
>>
>> Quite a while ago, I hacked up a preliminary static analyzer to do this.
>> Obviously it would be good to integrate something like this into our
>> linter, but I haven't gotten around to it yet.  In the meantime, I've
>> attached my preliminary code below.  Here's how it's used:
>
> Nice!  It’ll greatly help gain confidence that the code is correct when
> we decide to switch.  IIUC it only works for ‘gnu-build-system’, right?

(possible-phase-problem-pkgs) works for any build system that accepts
"#:phases" in its argument list.  However, it only checks the phases
that are overridden; it assumes that everything in %standard-phases is
correct.

To check the phases in the build systems themselves, there's
(possible-phase-problem-pkgs-from-drvs DRV-FILES), but it's a bit hacky
and makes assumptions about the form of the code in the *-guile-builder
script.  At one point I ran this checker on every .drv file on my
core-updates system, and thereby found many build system issues.  I
should probably do this again soon.

For build systems that expect "#:builder" in the argument list
(e.g. trivial-build-system) there's (possible-builder-problem-pkgs),
although I'm not yet sure whether it makes sense to switch to an
exception-only error reporting model for builders.  I'm not (yet?)
proposing to ignore the boolean results from builders.

Finally, there's (possible-snippet-problem-pkgs), which I forgot to
mention in my earlier email.  At one point I fixed every snippet in
core-updates to return #t, but since then many new snippets have been
introduced via 'master' that return an unspecified value.

> If the analyzer doesn’t cover 100% of the packages, we’ll rely on manual
> testing as we rebuild everything anyway—pretty much like when we do a
> regular ‘core-updates’ cycle.

If I'm not mistaken, the combination of checkers mentioned above should
give 100% coverage for phases and snippets of packages that
'fold-packages' iterates over.  However, it might miss packages that are
somehow hidden from 'fold-packages', e.g. packages bound to variables
that are not exported, and packages that are returned by procedures.

       Mark

  reply	other threads:[~2018-06-05  2:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 18:58 Regarding "Use Invoke" or "Return a boolean from phase" commits Mark H Weaver
2018-06-04 11:29 ` Ludovic Courtès
2018-06-05  2:35   ` Mark H Weaver [this message]
2018-06-07 16:12     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lgbu3qph.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.