Ticket #1459 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

Build fails with "lexical error at character '\a'"

Reported by: chevalier@… Owned by: simonmar
Priority: normal Milestone:
Component: Build System Version: 6.6.1
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

There are a couple of Makefiles that contain something like:

echo "main = getArgs >>= \args -> ..."

On my system, I get an error building the HEAD (checked out today) with:

ghc-pkg-inplace.hs:2:19: lexical error at character '\a'

It seems like something weird happens with the backslash getting escaped or not escaped, and the generated file, ghc-pkg-inplace.hs in this case, ends up with the character '\a' in it (G). If I change "\args" to "\\\\args" in the Makefile, I get the right result.

I'm submitting a bug rather than fixing it since I assume that on *some* system this worked correctly, so maybe my fix would break it on some other system.

I'm not sure what about my environment might be relevant, besides: $ uname -a Linux bongo 2.6.17-10-generic #2 SMP Tue Dec 5 22:28:26 UTC 2006 i686 GNU/Linux $ make --version GNU Make 3.81 $ echo $SHELL /bin/bash $ bash --version GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu)

Change History

Changed 6 years ago by simonmar

  • owner set to simonmar

I have the fix on my laptop, which is at home. I'll push it later.

Changed 6 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed
Sat Jun 23 21:00:06 BST 2007  Simon Marlow <simonmar@microsoft.com>
  * make inplace scripts less sensitive to /bin/sh quoting by avoiding \
Note: See TracTickets for help on using tickets.