unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Federico Beffa <beffa@ieee.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: sockets availability during build
Date: Sat, 24 Jan 2015 15:05:09 +0100	[thread overview]
Message-ID: <CAKrPhPOG6-TEaRVPUCpGQo5JG0QWVUK7_3JkaGG4BqsqgRCZow@mail.gmail.com> (raw)
In-Reply-To: <87d265rxp7.fsf@gnu.org>

On Fri, Jan 23, 2015 at 10:31 PM, Ludovic Courtès <ludo@gnu.org> 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	other threads:[~2015-01-24 14:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 19:54 sockets availability during build Federico Beffa
2015-01-22 20:29 ` John Darrington
2015-01-23  8:38 ` Ludovic Courtès
2015-01-23 17:37   ` Federico Beffa
2015-01-23 21:31     ` Ludovic Courtès
2015-01-24 14:05       ` Federico Beffa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKrPhPOG6-TEaRVPUCpGQo5JG0QWVUK7_3JkaGG4BqsqgRCZow@mail.gmail.com \
    --to=beffa@ieee.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).