Created attachment 502720 [details] build.log.ruby I have a Gentoo Prefix Rap installation, where ruby:2.2 emerge fails due to dependency to dev-util/systemtap, because the include of sys/sdt.h fails: *****START PASTE***** x86_64-pc-linux-gnu-gcc -O2 -pipe -O2 -pipe -ggdb -fno-strict-aliasing -fPIC -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -I. -I.ext/include/x86_64-linux -I./include -I. -o hash.o -c hash.c file.c: In function 'rb_stat_dev_major': file.c:512:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. return INT2NUM(major(get_stat(self)->st_dev)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file.c: In function 'rb_stat_dev_minor': file.c:533:13: warning: In the GNU C Library, "minor" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "minor", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including <sys/types.h>. return INT2NUM(minor(get_stat(self)->st_dev)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file.c: In function 'rb_stat_rdev_major': file.c:665:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. return DEVT2NUM(major(get_stat(self)->st_rdev)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file.c: In function 'rb_stat_rdev_minor': file.c:686:13: warning: In the GNU C Library, "minor" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "minor", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including <sys/types.h>. return DEVT2NUM(minor(get_stat(self)->st_rdev)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from hash.c:18:0: probes.h:10:10: fatal error: sys/sdt.h: No such file or directory #include <sys/sdt.h> ^~~~~~~~~~~ compilation terminated. make: *** [Makefile:364: hash.o] Error 1 *****END PASTE***** Interesting, the configure also reports this bug compilation starts anyhow. *****START PASTE***** checking whether dtrace USDT is available... (cached) yes checking whether dtrace needs post processing... In file included from conftest.c:1:0: conftest_provider.h:10:10: fatal error: sys/sdt.h: No such file or directory #include <sys/sdt.h> ^~~~~~~~~~~ compilation terminated. no checking for __builtin_setjmp... yes with cast () checking for setjmp type... __builtin_setjmp *****END PASTE***** Adding dev-util/systemtap to the list of RDEPENDS fixes the problem. logs and ebuild with fixed dependency attached.
Created attachment 502722 [details] emerge.info.ruby
Created attachment 502724 [details] env.ruby
Created attachment 502726 [details] ruby-2.2.8.ebuild
dev-util/systemtap isn't needed to compile ruby normally, so I don't think adding it to RDEPEND is the correct solution for this issue. I assume it is more likely this is due to misdetection in the prefix situation. Ccing prefix since they might have more insight.
just wondering, shouldn't dtrace support be disabled regardless what it finds on the system?
Yes, dtrace was detected wrongly, because found on the host in /usr/bin/dtrace by the configure script, so it got auto enabled. I can confirm Fabians comment, I have removed the systemtap from the depend list and added the "--disable-dtrace" option to the configure instead in the 2.2.8 ebuild and it works fine for me. gentoo@destgd0d05678-tcsh(1:900)$ diff -p ruby-2.2.8.ebuild ruby-2.2.8.ebuild.orig *** ruby-2.2.8.ebuild 2017-11-08 13:56:40.512409037 +0100 --- ruby-2.2.8.ebuild.orig 2017-11-08 14:02:31.433716013 +0100 *************** src_configure() { *** 152,158 **** --enable-shared \ --enable-pthread \ --disable-rpath \ - --disable-dtrace \ --with-out-ext="${modules}" \ $(use_with jemalloc jemalloc) \ $(use_enable socks5 socks) \ --- 152,157 ---- However, it may be the case that ruby users expect dtrace support if systemtap is installed. Some packages are using a "systemtap" useflag, so enable/disable of dtrace may be better controlled by this use flag.
Thanks Jens! Automagic dependencies are not allowed by Gentoo policies, so if users want dtrace support, then I guess a USE=dtrace should be added to the ebuild. I'll leave that up to @ruby.
This issue is still present in ruby-2.5.0, could it please be fixed?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dd5aa88a02df8e64485ee7d5e3e245c8e5f045a commit 2dd5aa88a02df8e64485ee7d5e3e245c8e5f045a Author: Hans de Graaff <graaff@gentoo.org> AuthorDate: 2020-05-10 07:13:52 +0000 Commit: Hans de Graaff <graaff@gentoo.org> CommitDate: 2020-05-10 07:16:41 +0000 dev-lang/ruby: add USE=systemtap This fixes an automagic dependency on dtrace. Closes: https://bugs.gentoo.org/636644 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Hans de Graaff <graaff@gentoo.org> dev-lang/ruby/metadata.xml | 17 +-- dev-lang/ruby/ruby-2.5.8-r1.ebuild | 222 ++++++++++++++++++++++++++++++++++ dev-lang/ruby/ruby-2.6.6-r2.ebuild | 234 ++++++++++++++++++++++++++++++++++++ dev-lang/ruby/ruby-2.7.1-r2.ebuild | 237 +++++++++++++++++++++++++++++++++++++ 4 files changed, 702 insertions(+), 8 deletions(-)