Bug 217097 - databases/libmemcached: Fails to build with DTRACE option enabled (on FreeBSD 11.0)
Summary: databases/libmemcached: Fails to build with DTRACE option enabled (on FreeBSD...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2017-02-14 13:27 UTC by Po-Chuan Hsieh
Modified: 2018-04-04 10:58 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (m.tsatsenko)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-02-14 13:27:46 UTC
I got error message as follows:

dtrace  -o libmemcached/libmemcached_probes.o -G -s libmemcached/libmemcached_probes.d
dtrace: failed to link script libmemcached/libmemcached_probes.d: No probe sites found for declared provider
gmake[2]: *** [Makefile:10397: libmemcached/libmemcached_probes.o] Error 1
gmake[2]: Leaving directory '/usr/ports/databases/libmemcached/work/libmemcached-1.0.18'
Comment 1 m.tsatsenko 2017-02-26 21:01:13 UTC
Hello. thanks I will have a look
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-06-09 18:56:28 UTC
Ping. Do you have any progress on this issue?
Comment 3 m.tsatsenko 2017-06-11 22:53:24 UTC
Well. Actually not much. I tried to reproduce the problem, but it builds fine for me. At least in poudriere 103amd64.
For now with no any further info the port is marked BROKEN with DTRACE.
Comment 4 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-07-22 14:14:50 UTC
Hmm, it builds fine on 103amd64 but failed on 110amd64.
Comment 5 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-07-22 14:16:16 UTC
I've added a simple slave port on my box to test it.

% cat databases/libmemcached-dtrace/Makefile
MASTERDIR=      ${.CURDIR}/../libmemcached

OPTIONS_SLAVE=  DTRACE

.include "${MASTERDIR}/Makefile"
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2017-07-23 12:16:21 UTC
Reporter is committer, assign accordingly
Comment 7 m.tsatsenko 2017-07-24 21:58:26 UTC
Hello,
Thanks for this update.
As far I can remember I tried exactly 103amd64 and it built fine for me.
Regarding 11.X I need to update my poudrire box first. Afterwards I will try to reproduce the problem again, and in case of failure we can consider UNBROKE the port on the lower versions right away and also try to figure out what causes failure on 11.X
Comment 8 m.tsatsenko 2017-07-29 23:41:16 UTC
Hello. I can confirm that it builds fine on 10.x but fails on 11.1 so we can UNBROKE it at least on 10.x
Regarding 11.x I am still working on it. No any real progress so far
The only hint I have found is http://ruby-core.ruby-lang.narkive.com/lXDGWDIa/ruby-core-55815-ruby-trunk-bug-8606-open-compile-with-enable-dtrace-fails-with-dtrace-version-sun-d-
I will give it a try and see what happens if -G is not passed to dtrace
Comment 9 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-08-05 23:44:18 UTC
(In reply to m.tsatsenko from comment #3)
(In reply to m.tsatsenko from comment #8)

This port is not being marked as BROKEN on any version yet.
Comment 10 m.tsatsenko 2017-10-19 12:34:02 UTC
I have spend hours trying to fix this, but did not succeed and at this point I am run out of ideas. 
Regrettably I am able to get it built with DTRACE enabled
Comment 11 John Hein 2017-11-15 01:35:34 UTC
It also fails the same way as in the original description for me on 10.3/stable-amd64 (r325155) outside of poudriere.  Inside poudriere, configure thinks dtrace is not working, so it disables it and so the dtrace is not even attempted (and so the libmemcached build inside poudriere therefore does not fail even if the DTRACE option is configured to be on).

Inside poudriere, config.log shows:

configure:24459: checking if dtrace works
configure:24479: result: no


Manually running what configure is trying to do inside the poudriere jail shows why:

# cat > /tmp/conftest.d << eof
provider Example {
  probe increment(int);
};
eof
# dtrace -h -o /tmp/conftest.h -s /tmp/conftest.d
dtrace: failed to compile script /tmp/conftest.d: "/usr/lib/dtrace/psinfo.d", line 37: syntax error near "uid_t"


It also fails for me on an old 11.0 (r313009):

% dtrace -o foo.o -G -s libmemcached_probes.d
dtrace: failed to link script libmemcached_probes.d: No probe sites found for declared provider


If it is not failing for you with DTRACE on, can you let us know what the config.log lines say regarding dtrace?
Comment 12 Walter Schwarzenfeld 2018-03-15 12:56:01 UTC
It is excluded with ports r464584.
Comment 13 Walter Schwarzenfeld 2018-03-15 12:57:29 UTC
Sorry was the wrong port.
Comment 14 John Hein 2018-03-19 16:58:32 UTC
(In reply to John Hein from comment #11)
 > If it is not failing for you with DTRACE on, can you let us know what the config.log lines say regarding dtrace?

Sunpoet,
Can you provide the config.log info above?  Have you read my analysis in comment 11?
Comment 15 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-03-19 18:02:55 UTC
(In reply to John Hein from comment #14)

DTRACE option never works for me.

On a 11.1-RELEASE-p4 box:

from config.log:
configure:24459: checking if dtrace works
configure:24479: result: yes

And the build fails:
dtrace  -o libmemcached/libmemcached_probes.o -G -s libmemcached/libmemcached_probes.d
dtrace: failed to link script libmemcached/libmemcached_probes.d: No probe sites found for declared provider
gmake[2]: *** [Makefile:10397: libmemcached/libmemcached_probes.o] Error 1
Comment 16 John Hein 2018-03-19 21:18:34 UTC
(In reply to John Hein from comment #11)

The reason poudriere builds is that there /boot/kernel is empty in the jail and so the configure detection for dtrace fails (as showen in comment 11).  So dtrace is disabled and the failed dtrace command described by the OP never is attempted.  So the build in poudriere works because it's not trying to use dtrace during the build.

You can reproduce the build failure in poudriere if you copy /boot/kernel/* into the jail:

dtrace  -o libmemcached/libmemcached_probes.o -G -s libmemcached/libmemcached_probes.d
dtrace: failed to link script libmemcached/libmemcached_probes.d: No probe sites found for declared provider

That .d file contains:

provider libmemcached {
        probe memcached_delete_start();
        probe memcached_delete_end();
        probe memcached_increment_with_initial_start();
        probe memcached_increment_with_initial_end();
        probe memcached_decrement_with_initial_start();
        probe memcached_decrement_with_initial_end();
        probe memcached_increment_start();
        probe memcached_increment_end();
        probe memcached_decrement_start();
        probe memcached_decrement_end();
        probe memcached_flush_start();
        probe memcached_flush_end();
        probe memcached_set_start();
        probe memcached_set_end();
        probe memcached_add_start();
        probe memcached_add_end();
        probe memcached_replace_start();
        probe memcached_replace_end();
        probe memcached_get_start();
        probe memcached_get_end();
        probe memcached_touch_start();
        probe memcached_touch_end();
        probe memcached_mget_start();
        probe memcached_mget_end();
        probe memcached_connect_start();
        probe memcached_connect_end();
        probe memcached_server_add_start();
        probe memcached_server_add_end();
};
Comment 17 John Hein 2018-03-21 09:15:33 UTC
(In reply to John Hein from comment #16)
 > dtrace  -o libmemcached/libmemcached_probes.o -G -s libmemcached/libmemcached_probes.d

This works with linux dtrace which is a wrapper in front of systemtap.  It appears these probes were written with systemtap in mind.  I'm guessing the dtrace option in this port never really worked on freebsd.  m.tsatsenko, can you confirm that?
Comment 18 m.tsatsenko 2018-03-21 14:16:36 UTC
Hello,
I have no any positive evidence that DTACE was ever working here. So I think it is safe to at least mark it BROKEN and decide what to do with it later on.
Thanks!
Comment 19 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-03-21 18:27:02 UTC
Can we just remove DTRACE option? We could add it back when it's available.
Comment 20 m.tsatsenko 2018-03-21 20:21:28 UTC
Removing also seems reasonable for me
Comment 21 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-04-04 10:58:23 UTC
Committed. Thanks!
Comment 22 commit-hook freebsd_committer freebsd_triage 2018-04-04 10:58:44 UTC
A commit references this bug:

Author: sunpoet
Date: Wed Apr  4 10:57:33 UTC 2018
New revision: 466429
URL: https://svnweb.freebsd.org/changeset/ports/466429

Log:
  Remove DTRACE option

  Enabling DTRACE option causes build failure.
  It appears this option never really worked on FreeBSD.

  PR:		217097
  Submitted by:	sunpoet (myself)
  Approved by:	Mikhail Tsatsenko <m.tsatsenko@gmail.com> (maintainer)
  Thanks to:	John Hein <z7dr6ut7gs@snkmail.com> (for analysis and testing)

Changes:
  head/databases/libmemcached/Makefile
Comment 23 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-04-04 10:58:57 UTC
Committed. Thanks!