Objet : Developers list for StarPU
Archives de la liste
- From: Cyril Roelandt <cyril.roelandt@inria.fr>
- To: "starpu-devel@lists.gforge.inria.fr" <starpu-devel@lists.gforge.inria.fr>
- Subject: [Starpu-devel] Should we use more hooks ?
- Date: Thu, 19 Jul 2012 16:28:05 +0200
- List-archive: <http://lists.gforge.inria.fr/pipermail/starpu-devel>
- List-id: "Developers list. For discussion of new features, code changes, etc." <starpu-devel.lists.gforge.inria.fr>
Hey !
I've just run "git grep "STARPU_ASSERT(0)", and well, it's still used a
lot in StarPU, even though it is now frowned upon (STARPU_ASSERT() does
nothing if --enable-fast is used, so StarPU may not abort when a
critical error occurred, which is why STARPU_ABORT() should be used
instead). I'm patching this :)
We're used to write STARPU_ASSERT(0), so we'll probably keep using it.
Students see it in the code and use it, or just think "hey, I should
call assert(0), and I should probably use the STARPU_ASSERT() macro to
do that", so they'll keep writing that. Still, this error is really easy
to spot.
Should we use SVN hooks to catch this kind of errors ? I'm really not
fond of pre-commit hooks, because developers should be able to do what
they want, and they may have a good reason to write "STARPU_ASSERT(0)"
[1], so I'd rather use a post-commit hook that sends an email to the
committer/starpu-devel/the whole world when a call to "STARPU_ASSERT(0)"
is added. This could look something like this:
#!/bin/sh
REPOS="$1"
REV="$2"
svnlook diff -r "$REV" "$REPOS" | grep "^+.*STARPU_ASSERT(0);" && exit 0
svnnotify \
--repos-path "$REPOS" \
--revision "$REV" \
--subject-cx \
--with-diff \
--from foo@bar.com \
--to cyril.roelandt@inria.fr \
--smtp smtp.inria.fr \
--header "Thou shalt not use STARPU_ASSERT(0)"
exit 0
We should obviously use commit-email.pl or mailer.py instead of
svnnotify, and fix the arguments - this is just a test script I ran on
my machine.
What do you think ?
Cyril.
[1] "UNIX was not designed to stop its users from doing stupid things,
as that would also stop them from doing clever things." (Doug Gwyn)
- [Starpu-devel] Should we use more hooks ?, Cyril Roelandt, 19/07/2012
Archives gérées par MHonArc 2.6.19+.