bug#21829: guix import hackage failures

2015-11-12 Thread Ludovic Courtès
Federico Beffa  skribis:

> On Wed, Nov 11, 2015 at 12:18 PM, Ludovic Courtès  wrote:
>> Federico Beffa  skribis:
>>
>>> * I do not get backtraces, but the following error:
>>
>> The backtrace thing was fixed in 5453de3d.
>>
>>> * The following packages fail because the file has DOS line endings:
>>>
>>>   happy, base-compat, base-orphans, fast-logger, generic-deriving, 
>>> ObjectName,
>>>   SDL, setenv, split, StateVar, syb, transformers-base, wai, xmonad (+ 1 
>>> more
>>>   problem), zlib (+ 1 more problem).
>>>
>>>  Changing the encoding to UNIX line endings fixes the problem. This is
>>> the number 1 problem. Is there a Guile way to easily fix this?
>>
>> Could you explain how if fails exactly?
>
> The extra character '\r' screws up the parsing because it was not
> accounted for in the logic to recognize multi-line values and
> indentation based block separation.
>
> What do you think of a kind of piped filter as follows:
>
> (define (call-with-input-file-eol-crlf->lf proc port)
>   (let* ((port-pair (pipe))
>  (input-port (match port-pair ((in . out) in)))
>  (output-port (match port-pair ((in . out) out
> (letpar ((transcoder
>   (let loop ((line (get-line port)))
> (unless (eof-object? line)
>   (write-line (string-trim-right line #\return) output-port)
>   (loop (get-line port)))
> (flush-output-port output-port)))
>  (result (proc input-port)))
> (close-output-port output-port)
> (close-input-port input-port)
> result)))
>
> Then instead of calling (read-cabal port) I would call
> (call-with-input-file-eol-crlf->lf read-cabal port).

I wonder if it wouldn’t be easier to change the lexer to recognize line
feeds are white space or newlines, maybe along these lines:

diff --git a/guix/import/cabal.scm b/guix/import/cabal.scm
index 45d644a..0dd329c 100644
--- a/guix/import/cabal.scm
+++ b/guix/import/cabal.scm
@@ -259,10 +259,11 @@ otherwise return BOL (beginning-of-line)."
  (bol bol))
 (cond
  ((and (not (eof-object? c))
-   (or (char=? c #\space) (char=? c #\tab)))
+   (or (char-set-contains? char-set:whitespace c)))
   (read-char port)
   (loop (peek-char port) bol))
- ((and (not (eof-object? c)) (char=? c #\newline))
+ ((and (not (eof-object? c))
+   (or (char=? c #\newline) (char=? c #\return)))
   (read-char port)
   (loop (peek-char port) #t))
  ((comment-line port c)

WDYT?

Ludo’.


bug#20255: 'search-paths' should respect both user and system profile.

2015-11-12 Thread Ludovic Courtès
Some progress has been made: fc2d233 allows search paths for multiple
profiles to be combined.

So I think I will eventually (‘guix-devel’ needs to be updated first)
change /etc/profile to do:

  eval `guix package -p /run/current-system/profile \
  -p $HOME/.guix-profile --search-paths`

That should solve the combined profile issue.

This operation takes ~400ms on my machine.  This would be a problem if
we had to do it every time a shell is started, but here we only need to
do it for log-in shells, which is rare enough.

WDYT?

Thanks,
Ludo’.





bug#21879: WeeChat does not start

2015-11-12 Thread Cyril Roelandt
On 11/11/2015 03:06 PM, Luis Felipe López Acevedo wrote:
> Hi,
> 
> I installed WeeChat 1.3 using Guix 0.9.0 on Debian 8, but It doesn't
> start when I run it. I get this error instead:
> 
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/site.py", line 563, in 
> main()
>   File "/usr/lib/python2.7/site.py", line 545, in main
> known_paths = addusersitepackages(known_paths)
>   File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
> user_site = getusersitepackages()
>   File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
> user_base = getuserbase() # this will also set USER_BASE
>   File "/usr/lib/python2.7/site.py", line 237, in getuserbase
> USER_BASE = get_config_var('userbase')
>   File "/usr/lib/python2.7/sysconfig.py", line 582, in get_config_var
> return get_config_vars().get(name)
>   File "/usr/lib/python2.7/sysconfig.py", line 528, in get_config_vars
> _init_posix(_CONFIG_VARS)
>   File "/usr/lib/python2.7/sysconfig.py", line 412, in _init_posix
> from _sysconfigdata import build_time_vars
>   File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in 
> from _sysconfigdata_nd import *
> ImportError: No module named _sysconfigdata_nd
> 

Seems like you are using weechat from Guix using Python 2.7 from Debian,
which is a bit weird. Also, _sysconfigdata_nd is Debian-specific. What
is your PYTHONPATH?

Cyril.





bug#20889: [PATCH] tk: Hardcode path to TK_LIBRARY.

2015-11-12 Thread Ludovic Courtès
宋文武  skribis:

> From 6c9ea521e88d36bd1ce990a561477ec0e2950017 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= 
> Date: Thu, 12 Nov 2015 13:31:19 +0800
> Subject: [PATCH] tk: Hardcode path to TK_LIBRARY.
>
> Fixes .
>
> * gnu/packages/patches/tk-find-library.patch: New patch.
> * gnu-system.am (dist_patch_DATA): Add it.
> * gnu/packages/tcl.scm (tk)[source]: Add patch.

[...]

> +++ b/gnu/packages/patches/tk-find-library.patch
> @@ -0,0 +1,30 @@
> +This patch hardcode where Tk found its script library during package
 ^^  
“This patch hard-codes the Tk library directory during package
initialization.”

OK with this change.  Thanks for providing a quick fix!  :-)

Could you commit it in a new ‘tk-update’ branch?

At the same time, I think we should move tkinter*.so to a separate
output of the Python packages; I think it’s a matter of moving the .so
to a separate output, literally.  Would you like to give it a try?

Thanks!

Ludo’.





bug#21829: guix import hackage failures

2015-11-12 Thread Federico Beffa
On Thu, Nov 12, 2015 at 10:07 AM, Ludovic Courtès  wrote:
> Federico Beffa  skribis:
> I wonder if it wouldn’t be easier to change the lexer to recognize line
> feeds are white space or newlines, maybe along these lines:

What you suggest is not enough. You have to tweak a couple of other
places as well.

I don't like having to mess around in token recognition code to
account for different eol styles. With my proposal I was trying to
abstract this away and make the eol style problem orthogonal to
parsing: first we convert to a "normal form" and then we operate on
it.  Should we find some files in 'mac' eol-style (in Emacs parlance)
then it would be trivial to adapt.

Could you be more explicit about what you do not like about this?

Regards,
Fede





bug#21888: guix-publish gets ERROR when serve gtk+.

2015-11-12 Thread 宋文武

can't substitute gtk+ from a guix-publish server, it fails with:

GET /nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2
In web/server/http.scm:
   117:27  1 (http-read #< socket: #)
In unknown file:
   0 (peek-char #)
ERROR: In procedure fport_fill_input: Connection reset by peer






bug#21829: guix import hackage failures

2015-11-12 Thread Ludovic Courtès
Federico Beffa  skribis:

> On Thu, Nov 12, 2015 at 10:07 AM, Ludovic Courtès  wrote:
>> Federico Beffa  skribis:
>> I wonder if it wouldn’t be easier to change the lexer to recognize line
>> feeds are white space or newlines, maybe along these lines:
>
> What you suggest is not enough. You have to tweak a couple of other
> places as well.
>
> I don't like having to mess around in token recognition code to
> account for different eol styles. With my proposal I was trying to
> abstract this away and make the eol style problem orthogonal to
> parsing: first we convert to a "normal form" and then we operate on
> it.  Should we find some files in 'mac' eol-style (in Emacs parlance)
> then it would be trivial to adapt.
>
> Could you be more explicit about what you do not like about this?

I think the approach you suggest is fine, but I noticed that the places
I changed were too specific anyway (looking for #\space and #\tab
instead of the general char-set:whitespace class, for instance.)  So I
thought that it generalizing this would also fix the problem, that would
be nice, because the change is more general than just fixing the CRLF
issue.

But maybe I’m missing other places, which would make the change too
intrusive.  That’s why I was asking for your feedback.

Does that make sense?

If we go for the CRLF conversion port, we should avoid the pipe and
extra thread.  Instead, I would suggest something like:

  (define (canonical-newline-port port)
"Return an input port that wraps PORT such that all newlines consist
  of a single carriage return."
(make-custom-binary-input-port …))

WDYT?

Thanks,
Ludo’.





bug#21888: guix-publish gets ERROR when serve gtk+.

2015-11-12 Thread Ludovic Courtès
宋文武  skribis:

> can't substitute gtk+ from a guix-publish server, it fails with:
>
> GET /nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2
> In web/server/http.scm:
>117:27  1 (http-read #< socket: #)
> In unknown file:
>0 (peek-char #)
> ERROR: In procedure fport_fill_input: Connection reset by peer

This means that the *client* closed the connection.  Could you check
what happened on the client side?

It may be more convenient to use wget on the client-side to reproduce
the problem.

TIA,
Ludo’.





bug#21888: guix-publish gets ERROR when serve gtk+.

2015-11-12 Thread 宋文武

On 2015-11-13 04:28, l...@gnu.org wrote:

宋文武  skribis:


can't substitute gtk+ from a guix-publish server, it fails with:

GET /nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2
In web/server/http.scm:
   117:27  1 (http-read #< socket: #so...>)

In unknown file:
   0 (peek-char #)
ERROR: In procedure fport_fill_input: Connection reset by peer


This means that the *client* closed the connection.  Could you check
what happened on the client side?

It may be more convenient to use wget on the client-side to reproduce
the problem.

OK, I attach logs of:
wget -qd 
'http://localhost:8080/nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2'
wget -qd 
'http://localhost:8080/nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk%2B-3.18.2'



DEBUG output created by Wget 1.16.3 on linux-gnu.

URI encoding = 'ANSI_X3.4-1968'
converted 
'http://localhost:8080/nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk%2B-3.18.2' 
(ANSI_X3.4-1968) -> 
'http://localhost:8080/nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2' (UTF-8)
Caching localhost => ::1 127.0.0.1
Closed fd 3
Created socket 3.
Releasing 0x01448300 (new refcount 1).

---request begin---
GET /nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2 HTTP/1.1
User-Agent: Wget/1.16.3 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: localhost:8080
Connection: Keep-Alive

---request end---

---response begin---
HTTP/1.1 404 Not Found
Content-Length: 69
Content-Type: text/plain;charset=utf-8

---response end---
Registered socket 3 for persistent reuse.
URI content encoding = 'utf-8'
Skipping 69 bytes of body: [Resource not found: 
/nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2] done.
[IRI fallbacking to non-utf8 for 
'http://localhost:8080/nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk%2B-3.18.2'
Reusing fd 3.

---request begin---
GET /nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk%2B-3.18.2 HTTP/1.1
User-Agent: Wget/1.16.3 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: localhost:8080
Connection: Keep-Alive

---request end---

---response begin---
HTTP/1.1 200 OK
Content-Type: application/x-nix-archive;charset=ISO-8859-1

---response end---
URI content encoding = 'ISO-8859-1'
DEBUG output created by Wget 1.16.3 on linux-gnu.

URI encoding = 'ANSI_X3.4-1968'
converted 
'http://localhost:8080/nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2' 
(ANSI_X3.4-1968) -> 
'http://localhost:8080/nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2' (UTF-8)
Caching localhost => ::1 127.0.0.1
Closed fd 3
Created socket 3.
Releasing 0x0218f260 (new refcount 1).

---request begin---
GET /nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2 HTTP/1.1
User-Agent: Wget/1.16.3 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: localhost:8080
Connection: Keep-Alive

---request end---

---response begin---
HTTP/1.1 404 Not Found
Content-Length: 69
Content-Type: text/plain;charset=utf-8

---response end---
Registered socket 3 for persistent reuse.
URI content encoding = 'utf-8'
Skipping 69 bytes of body: [Resource not found: 
/nar/1dlz1am0qmj1579f5p6j5cvfx9l2aw50-gtk+-3.18.2] done.