Community Packages

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#74800 - [haskell-lens] registration script involves an escape character breaking the script in dash

Attached to Project: Community Packages
Opened by Nils Trubkin (zeraoo) - Thursday, 19 May 2022, 19:00 GMT
Last edited by Toolybird (Toolybird) - Thursday, 14 July 2022, 06:33 GMT
Task Type Bug Report
Category Packages
Status Assigned
Assigned To Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


(Edit: typos fixed as per comment 1)

The package does not install (register) correctly if the /bin/sh is linked to dash instead of bash.
The error message only mentions that registration failed like so:

(2/2) Registering Haskell modules...
error: command failed to execute correctly

The error originates from the /usr/share/haskell/register/ script.
In the line 70 column 33 there is a "documentation/comment" piece that involves a lambda (as Haskell sees it) or an escape symbol \ as dash sees it.

Here is the entire line that is causing the issue (the 'a' in the fmap lambda is escaped):
> bar f (Foo a b c) = fmap (\a'\'' -> Foo a'\'' b c) (f a)

Here is the same line without the illegal character:
> bar f (Foo a b c) = fmap (a'\'' -> Foo a'\'' b c) (f a)

Running this script gives an error below:

Reading package info from stdin ... ghc-pkg: "the input" (line 68, column 5):
unexpected character in input '\a'
expecting field or section name or end of file

To fix this, the user should do one of the following:
(1) change shebang to #!/bin/bash
(2) run script as bash
(3) remove the escape character at position (70, 33)

Additional info:

Steps to reproduce:
rm /bin/sh
ln -s dash /bin/sh
pacman -Suy haskell-lens

This is my first bug report, and took me many hours to get to the bottom of.
Let me know if I've incorrectly reported it or if this is considered as an upstream issue, thanks.
This task depends upon

Comment by Nils Trubkin (zeraoo) - Thursday, 19 May 2022, 19:33 GMT
typos fixes:
(1) change shebang to #!/bin/bash
The package does not install (register) correctly [IF] the...