Subject: bug#16463: Guile derivation fails to build

From: [email-masked] (Ludovic Courtès)
Date: Fri, 17 Jan 2014 12:08:03 +0100

reassign 16463 guile 2.0.9
retitle 16463 ‘file-encoding’ truncates encoding name
thanks

Sree Harsha Totakura <[email-masked]> skribis:

> On 01/17/2014 11:44 AM, Ludovic CourtÃ¨s wrote:
>> What does this report:
>> 
>> ./meta/guile -c '(pk (file-encoding (open-input-file
>> "test-suite/standalone/test-command-line-encoding2")))'
>
> It reports:
>
>> bash-4.2$ meta/guile -c '(pk (file-encoding (open-input-file
>> "test-suite/standalone/test-command-line-encoding2")))' ;;;
>> ("ISO-885")

OK, that’s the problem.

I can reproduce it by changing the shebang to this:

--8<---------------cut here---------------start------------->8---
#!/foo/nix/store/bwjl94kaigsxd64pgzs2j1cj0wn67v76-glibc-2.18/bin/sh
--8<---------------cut here---------------end--------------->8---

This is a bug in Guile’s encoding-cookie scanner: it looks for the
string ‘coding:’ in the first 500 bytes of the file.  Here it does find
it and proceeds to read the next token, except that it stops at 500
bytes, thereby truncating the encoding name.

I’ll look for a fix on the Guile side.

In the meantime, I’m afraid there is no nice way to work around it in
your Guix install.  You could work around it by using a shorter store
directory name, or you could have a local patch in guile.scm that
changes ‘test-command-line-encoding2’ to read ‘coding: utf-8’...

Thanks,
Ludo’.