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

Re: Buildd & binary-indep

On Sat, Sep 25, 2010 at 03:03:51PM +0200, Joachim Breitner wrote:
> > Uhm, but shouldn't that massive multi-hour _building_ of data be in a
> > "build" (specifically, "build-indep") target rather than "install"?
> one would expect that it works this way, any many people before you were
> surprised by this fact. The problem is that build-indep and build-arch
> are not required targets, and there is no easy way of checking whether
> they exist.

Oh, right.  That's indeed nasty.

I've skimmed through discussions about this matter, and the problem seems to
be that make does not provide a way to tell why it failed -- so it's not
possible to tell if the "build-indep" target exists.

Except, make does give an unique error message.  It may differ in various
versions of make or locales, but at least for GNU make (which we do require)
it's always different from anything else that can go wrong.

So, here's my take (attached).  It's a kludge, but appears to be robust.

> Maybe now, with the DEP process, this is something that could be
> tackled? I for one would very much welcome such a change.

The script I attached issues a warning to stdout; if we can ask one of the
fine folks who run those rebuilds of the whole archive to use something like
that, we could then grep build logs for that message.

1KB		// Microsoft corollary to Hanlon's razor:
		//	Never attribute to stupidity what can be
		//	adequately explained by malice.

if ! [ -x debian/rules ]
  then echo "No debian/rules!" 2>&1;exit 2;fi

# Policy 4.9 says the first line must be literally `#!/usr/bin/make -f', but
# IIRC some packages tack on extra parameters.
if ! head -n1 debian/rules|grep -q '^#! */usr/bin/make *-f *$'
    echo "debian/rules doesn't conform to policy 4.9, falling back to 'build'."
    debian/rules build

# Hairy, but safe against locales and changed error messages.
make -f /dev/null build-indep 2>unique-tmp-1
(debian/rules build-indep && rm unique-tmp-1) 3>&1 1>&2 2>&3 |tee unique-tmp-2
cmp -s unique-tmp-1 unique-tmp-2
case $? in
  0) echo "The build-indep target doesn't exist, falling back to 'build'."
     debian/rules build;RET=$? ;;
  1) RET=2 ;;
  2) RET=0 ;;

rm -f unique-tmp-1 unique-tmp-2
exit $RET

Attachment: signature.asc
Description: Digital signature

Reply to: