ar incorrectly parses path names with ~ in them, breaks builds of ~rc prerelease packages

Bug #641488 reported by Steve Langasek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binutils
Confirmed
Medium
binutils (Ubuntu)
Fix Released
High
Steve Langasek
Maverick
Fix Released
High
Steve Langasek

Bug Description

Binary package hint: binutils

The latest u-boot-linaro upload failed to build because trying to pass .a pathnames to 'ar -M' fails:

(echo create /build/buildd/u-boot-linaro-2010.09~rc1.1/debian/build/omap4_panda/post/libpost.a; for lib in ; \
  do echo addlib $lib; done; echo save) \
 | ar -M
~Syntax error in archive script, line 1

The full build log is at <http://launchpadlibrarian.net/55788360/buildlog_ubuntu-maverick-armel.u-boot-linaro_2010.09~rc1.1-0ubuntu2_FAILEDTOBUILD.txt.gz> (at least until this bug is fixed and the build is retried).

The failure is due to '~' in the source package directory name. This is a legal character, and dpkg-dev means it to be there, so I think we need to fix ar to accept this pathname.

I don't know if this is a recent regression, or how many other packages might FTBFS because of this behavior.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: binutils 2.20.51.20100908-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-20.29-generic 2.6.35.4
Uname: Linux 2.6.35-20-generic x86_64
Architecture: amd64
Date: Fri Sep 17 10:26:24 2010
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: binutils

Revision history for this message
Steve Langasek (vorlon) wrote :
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This bug is caused by terminal rule FILENAME in arlex.l not considering this character as valid.
Attached debdiff contains a solution for this problem.

Steve Langasek (vorlon)
Changed in binutils (Ubuntu Maverick):
status: New → Incomplete
status: Incomplete → In Progress
status: In Progress → Fix Committed
importance: Undecided → High
assignee: nobody → Steve Langasek (vorlon)
milestone: none → ubuntu-10.10
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package binutils - 2.20.51.20100908-0ubuntu2

---------------
binutils (2.20.51.20100908-0ubuntu2) maverick; urgency=low

  * debian/patches/216-tilde-in-ar-filenames: Allow ar scripts to contain ~
    in the filename, fixes u-boot-linaro rc build failures that ended up
    using pathnames with ~ in them. LP: #641488
 -- Zygmunt Krynicki <email address hidden> Fri, 17 Sep 2010 19:20:28 +0200

Changed in binutils (Ubuntu Maverick):
status: Fix Committed → Fix Released
Revision history for this message
In , Steve Langasek (vorlon) wrote :

When ar is asked to act on a file whose path includes the '~' character, ar
rejects this with a syntax error. E.g.:

(echo create
/build/buildd/u-boot-linaro-2010.09~rc1.1/debian/build/omap4_panda/post/libpost.a;
for lib in ; \
  do echo addlib $lib; done; echo save) \
 | ar -M
~Syntax error in archive script, line 1

This bug was identified using u-boot, but it's probably reproducible with any
number of pieces of software if built in a parent directory with the appropriate
characteristics.

Patch to follow.

Revision history for this message
In , Steve Langasek (vorlon) wrote :

Created attachment 4989
add ~ to the set of valid filename chars

Solution to this issue courtesy of Zygmunt Krynicki
<email address hidden>.

Revision history for this message
Loïc Minier (lool) wrote :

Was this fix seen by upstream devs? I seem to recall a similar bug, and it wasn't trivial to resolve since ~ had a special meaning to ar.

Revision history for this message
Loïc Minier (lool) wrote :

bug #494797 is what I was thinking of, and didn't discuss ~, so this might all be fine

Changed in binutils:
importance: Unknown → Medium
status: Unknown → Confirmed
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.