guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sockets availability during build


From: Federico Beffa
Subject: Re: sockets availability during build
Date: Sat, 24 Jan 2015 15:05:09 +0100

On Fri, Jan 23, 2015 at 10:31 PM, Ludovic Courtès <address@hidden> wrote:
> Yeah <https://bugzilla.redhat.com/show_bug.cgi?id=172350> suggests that
> ENODEV is due to the lack of a default route.
>
> Indeed, running that fails:
>
> --8<---------------cut here---------------start------------->8---
> (use-modules (guix))
>
> (define build
>   #~(begin
>       (define %upnp-ipv4-multicast-address
>         (inet-pton AF_INET "239.255.255.250"))
>
>       (define %upnp-multicast-port 1900)
>
>       (define %upnp-ipv4-multicast-socket-address
>         (make-socket-address AF_INET
>                              %upnp-ipv4-multicast-address
>                              %upnp-multicast-port))
>
>       (define (open-upnp-socket)
>         (let ((s (socket PF_INET SOCK_DGRAM 0)))
>           (setsockopt s IPPROTO_IP IP_ADD_MEMBERSHIP
>                       (cons %upnp-ipv4-multicast-address INADDR_ANY))
>           s))
>
>       (pk (open-upnp-socket))
>       (flush-all-ports)
>       (mkdir #$output)))
>
> (with-store store
>   (run-with-store store
>     (mlet %store-monad ((drv (gexp->derivation "test" build)))
>       (built-derivations (list drv)))))
> --8<---------------cut here---------------end--------------->8---
>
> If we add, before the ‘open-upnp-socket’ call, this line:
>
> --8<---------------cut here---------------start------------->8---
>       (system* (string-append #$net-tools "/sbin/route")
>                "add" "-net" "default")
> --8<---------------cut here---------------end--------------->8---
>
> ‘route’ simply fails with:
>
>   SIOCADDRT: Operation not permitted
>
> I don’t know how to work around it.  You may need to disable the tests.

I think I will disable the tests then.

Thanks for taking the time to look into this!

Regards,
Fede



reply via email to

[Prev in Thread] Current Thread [Next in Thread]