[FTBFS] Bashism in debian/rules

Bug #128458 reported by Chris Halse Rogers
4
Affects Status Importance Assigned to Milestone
rebuildd (Ubuntu)
Fix Released
Medium
Chris Halse Rogers

Bug Description

Rebuildd uses echo -e in debian/rules, a bashism which causes it to fail to build

Revision history for this message
Chris Halse Rogers (raof) wrote :
Revision history for this message
Chris Halse Rogers (raof) wrote :

I suck. A debdiff that really is against 0.2.0 attached.

Luke Yelavich (themuso)
Changed in rebuildd:
assignee: nobody → themuso
status: New → In Progress
Revision history for this message
Chris Halse Rogers (raof) wrote :

rebuildd (0.2.0ubuntu1) gutsy; urgency=low

  * Fix bashism (echo -e) in debian/rules (LP: #128458)
  * debian/control:
  * Modify Maintainer value to match Debian-Maintainer-Field Spec

 -- Christopher James Halse Rogers (RAOF) <email address hidden> Thu, 26 Jul 2007 17:22:22 +1000

Changed in rebuildd:
status: In Progress → Fix Released
Revision history for this message
Michele Angrisano (darksun88-deactivatedaccount) wrote :

rebuildd (0.2.1ubuntu1) gutsy; urgency=low

  * Merge from Debian unstable, remaining changes:
    - Fix bashism (echo -e) in debian/rules (LP: #128458)
    - Update maintainer field in debian/control.

rebuildd (0.2.1) unstable; urgency=low

  * Add --download-only to apt-get source by default
    and put only one -q
  * If a job is building, don't allow to add it
  * Rewrite rebuildd-job stats function with SQL,
    very very very very very very very very faster
  * Add headers and footers to build logs
  * Dont't try to resend old mails, otherwise we send it
    twice sometimes.
  * Fix a bug when database is empty in rebuildd-job stats
  * Limit job searching to max_jobs to be more faster
  * Fix a bug with event/lock, which cancel all jobs at once

 -- Michele Angrisano <email address hidden> Thu, 09 Aug 2007 06:00:59 +0200

Revision history for this message
Ming Hua (minghua) wrote :
Changed in rebuildd:
status: Fix Released → New
Revision history for this message
Chris Halse Rogers (raof) wrote :

The Debian maintainer is correct, but only for Debian. The fix works correctly for Ubuntu, since dash follows the sh behaviour and treats \n as the newline escape character (whereas bash *requires* echo -e for this behaviour).

The maintainer's printf fix is more correct, in that it is portable across Debian and Ubuntu. I can't remember if I filed a Debian bug about this or not, but it seems that I didn't. Probably because it doesn't affect the Debian package at all, and I didn't have a Debian system to test on at the time.

Ming, Is there any more information you require?

Changed in rebuildd:
assignee: themuso → raof
status: New → Incomplete
Revision history for this message
Ming Hua (minghua) wrote :

Basically the Ubuntu fix relies on that /bin/sh is dash, because without "-e", bash can't handle "\n", the escaped character:

(in bash)
$ echo 'from rebuildd.RebuilddConfig import RebuilddConfig\nprint RebuilddConfig(True).dump()'
from rebuildd.RebuilddConfig import RebuilddConfig\nprint RebuilddConfig(True).dump()

So if the package is built on a system with /bin/sh linked to bash, the package will have a broken debian/rebuildrc file.

I don't know about POSIX, but I doubt "treat \n as newline" is POSIX sh behavior as you claimed.

While the breakage won't happen for our buildds, and I agree that this fix works for Ubuntu, it's not exactly better than the problem it tries to fix -- it just changes bash-only behavior to dash-only behavior. This particular FTBFS bug can probably be tagged "fix released" (I just reopened because it's convenient), but I still believe this is a wrong fix and should be re-fixed in future releases (most likely by a sync with Debian).

I see that you've commented on Debian maintainer's blog, let's see what he and other people say.

Revision history for this message
Chris Halse Rogers (raof) wrote :

My initial information came from "man sh". Checking more thoroughly, <http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html> seems to suggest that you're right. Strictly speaking, POSIX shell behaviour seems to be undefined when escape characters are used, so bash isn't quite as annoying as I thought.

Indeed, the the Debian maintainer's fix is better, and should be sync'd for Hardy. I'll milestone this bug for "later" so as to not be lost.

Changed in rebuildd:
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
Joe Jaxx (joejaxx) wrote :

rebuildd (0.2.2ubuntu1) hardy; urgency=low

  * Merge from debian unstable, remaining changes:
    - Modified bashism fix (usage of 'printf' instead of 'echo -e')
      in debian/rules (LP: #128458)
    - Retained Updated maintainer field

rebuildd (0.2.2) unstable; urgency=low

  * Add rebuildd-job manpage
  * Actually we shouldn't add jobs if they are already in database
    If needed, status should be changed
  * Add delete to rebuildd-job
  * Add a fix option to fix database state if rebuildd crashed
  * Remove send_build_logs, not used anymore, cleaning up code
  * Do not restart on upgrade
  * Print all active thread count in logs
  * Now we handle 3 types of build failures, more clear

 -- Joseph Jackson IV <email address hidden> Tue, 06 Nov 2007 12:20:05 +0000

Changed in rebuildd:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.