Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 636644 - dev-lang/ruby-2.2.8 compilation fails, lacking sys/sdt.h from systemtap
Summary: dev-lang/ruby-2.2.8 compilation fails, lacking sys/sdt.h from systemtap
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-05 16:28 UTC by Jens Lindenmeier
Modified: 2020-05-10 07:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.ruby (build.log.ruby,37.16 KB, application/octet-stream)
2017-11-05 16:28 UTC, Jens Lindenmeier
Details
emerge.info.ruby (emerge.info.ruby,6.15 KB, text/plain)
2017-11-05 16:29 UTC, Jens Lindenmeier
Details
env.ruby (env.ruby,113.38 KB, text/plain)
2017-11-05 16:29 UTC, Jens Lindenmeier
Details
ruby-2.2.8.ebuild (ruby-2.2.8.ebuild,6.77 KB, text/plain)
2017-11-05 16:30 UTC, Jens Lindenmeier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Lindenmeier 2017-11-05 16:28:17 UTC
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.
Comment 1 Jens Lindenmeier 2017-11-05 16:29:04 UTC
Created attachment 502722 [details]
emerge.info.ruby
Comment 2 Jens Lindenmeier 2017-11-05 16:29:35 UTC
Created attachment 502724 [details]
env.ruby
Comment 3 Jens Lindenmeier 2017-11-05 16:30:23 UTC
Created attachment 502726 [details]
ruby-2.2.8.ebuild
Comment 4 Hans de Graaff gentoo-dev Security 2017-11-06 06:23:39 UTC
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.
Comment 5 Fabian Groffen gentoo-dev 2017-11-06 08:05:24 UTC
just wondering, shouldn't dtrace support be disabled regardless what it finds on the system?
Comment 6 Jens Lindenmeier 2017-11-08 13:15:02 UTC
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.
Comment 7 Fabian Groffen gentoo-dev 2017-11-08 13:19:04 UTC
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.
Comment 8 Haelwenn (lanodan) Monnier 2020-05-08 07:27:33 UTC
This issue is still present in ruby-2.5.0, could it please be fixed?
Comment 9 Larry the Git Cow gentoo-dev 2020-05-10 07:16:52 UTC
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(-)