raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Doug Forster <doug.forster@gmail.com>
Cc: raindrops-public@bogomips.org
Subject: Re: raindrops fails to install with ruby 2.2.2
Date: Tue, 14 Jul 2015 20:18:14 +0000	[thread overview]
Message-ID: <20150714201814.GA31981@dcvr.yhbt.net> (raw)
In-Reply-To: <CAFFOtrdUVz0nc8c4a-B3zXGr=0b2XZwm1WN0NZudxgbqp8Aubw@mail.gmail.com>

Please don't send HTML portions in email, it is bloated and spammy
and incompatible with lists we may Cc:

...And I expect musl users to care about bloat like that :>

Doug Forster <doug.forster@gmail.com> wrote:
> Problem seems to be the removal of rb_thread_blocking_region in ruby.

Actually, that's a red herring, raindrops 0.13.0 onwards accounts
for that.

> System Info:
> ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux-musl]
> alpine linux


> make "DESTDIR="
> compiling linux_tcp_info.c
> linux_tcp_info.c:5:23: fatal error: linux/tcp.h: No such file or directory
>  #include <linux/tcp.h>
>                        ^
> compilation terminated.
> Makefile:237: recipe for target 'linux_tcp_info.o' failed
> make: *** [linux_tcp_info.o] Error 1
> 
> make failed, exit code 2

This is the problem, raindrops blindly assumed Linux machines all have
linux/tcp.h header.  I've added a check for that.

I'll push out the patch below and release 0.14.1 final soon.

I've pushed out raindrops 0.14.0.1.g8177 with the patch below.

You should be able to install it using:

	gem install --pre raindrops -v 0.14.0.1.g8177

If possible, can you test and make sure there's no other issues?
Thanks.

------------------------------ 8< ----------------------------
From: Eric Wong <e@80x24.org>
Date: Tue, 14 Jul 2015 20:08:49 +0000
Subject: [PATCH] check for the existence of linux/tcp.h

The linux/tcp.h header may not exist on alternative libc
implementations such as musl.

Noticed-by: Doug Forster <doug.forster@gmail.com>
---
 ext/raindrops/extconf.rb       | 1 +
 ext/raindrops/linux_tcp_info.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ext/raindrops/extconf.rb b/ext/raindrops/extconf.rb
index f012808..74ed8f9 100644
--- a/ext/raindrops/extconf.rb
+++ b/ext/raindrops/extconf.rb
@@ -6,6 +6,7 @@
 
 $CPPFLAGS += " -D_GNU_SOURCE "
 have_func('mremap', 'sys/mman.h')
+have_header('linux/tcp.h')
 
 $CPPFLAGS += " -D_BSD_SOURCE "
 have_func("getpagesize", "unistd.h")
diff --git a/ext/raindrops/linux_tcp_info.c b/ext/raindrops/linux_tcp_info.c
index dcdb153..5e25d4d 100644
--- a/ext/raindrops/linux_tcp_info.c
+++ b/ext/raindrops/linux_tcp_info.c
@@ -1,4 +1,4 @@
-#ifdef __linux__
+#if defined(__linux__) && defined(HAVE_LINUX_TCP_H)
 #include <ruby.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -170,4 +170,4 @@ void Init_raindrops_linux_tcp_info(void)
 	TCPI_DEFINE_METHOD(total_retrans);
 }
 #endif /* TCP_INFO */
-#endif /* __linux__ */
+#endif /* defined(__linux__) && defined(HAVE_LINUX_TCP_H) */
-- 
EW

  reply	other threads:[~2015-07-14 20:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 21:47 raindrops fails to install with ruby 2.2.2 Doug Forster
2015-07-14 20:18 ` Eric Wong [this message]
2015-07-14 20:23 ` Hleb Valoshka

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://yhbt.net/raindrops/

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

  git send-email \
    --in-reply-to=20150714201814.GA31981@dcvr.yhbt.net \
    --to=e@80x24.org \
    --cc=doug.forster@gmail.com \
    --cc=raindrops-public@bogomips.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://yhbt.net/raindrops.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).