New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple versions fail to build on OSX due to dtrace permissions #1061
Comments
Just reporting what I saw to help anyone else debugging this issue. On a coworker's machine (macOS High Sierra 10.13.3), I was getting the same error with If I I traced the failure this block in the Makefile generated after running .d.h:
@$(ECHO) translating probes $<
$(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) -s $<
$(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/RUBY_PROBES_H/' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
$(Q) $(RM) $@.tmp This will at some point try to execute
Issuing this command by itself reliably reproduces the same error
Despite people having success in rbenv/rbenv#708 and in Homebrew/legacy-homebrew#32910, unsetting the SetUID bit on the I ended up modifying the generated diff --git a/bin/ruby-build b/bin/ruby-build
index 57b7adc..3c5a8ac 100755
--- a/bin/ruby-build
+++ b/bin/ruby-build
@@ -558,6 +558,8 @@ build_package_standard_build() {
use_homebrew_readline || use_freebsd_pkg ||true
fi
+ sed -i "" 's/rb_cv_dtrace_available=yes/rb_cv_dtrace_available=no/' configure
+
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}"
fi This is a ugly hack, but it makes it so that Later, I learned that there's a
...and I suspect that this issue is not technically a Edit: On a separate macOS system where Ruby successfully builds and installs, I can see that the same |
Just encountered the same issue on a mac with macOS 10.14.1 and While looking for a solution I stumbled upon this thread as well as this one, which holds a different solution aside from disabling dtrace and also poses a different culprit (given the fact that it seems to work on some macs and not on others): Everyone in the rvm thread seems to be running Avira anti virus software on their mac (same as in my case), which after disabling it for the install, results in a successful install with dtrace enabled. |
Thanks for finding that thread @boehle and cross-posting the information to this thread. I think this will help some people with this problem. FWIW I'm fairly confident that in my coworker's case above, he wasn't running Avira: The antivirus software we use at my company is automatically set up by IT. Whatever antivirus softare we were using at the time would have been used by everyone else, too. I don't remember what software it was at the time. |
@cjlarose no worries :). Yeah I hope, it might help others too. I suspect if Avira is blocking |
I was able to get this working by applying the following changes to the Makefile: 186c186
< DTRACE = dtrace -xnolibs
---
> DTRACE = /usr/bin/sudo /usr/sbin/dtrace -xnolibs
394a395
> $(Q) /usr/bin/sudo /usr/sbin/chown $$(whoami):$$(id -g -n) $@ |
This comment has been minimized.
This comment has been minimized.
This is an upstream CRuby issue, should be reported to https://bugs.ruby-lang.org/ if not done already. |
Originally documented at rbenv/rbenv#708
Encountered this problem with
rbenv install 2.3.3
andrbenv install 2.4.0
some potentially relevant lines from the log file generated:
As documented in previous issue,
sudo chmod -s /usr/sbin/dtrace
resolves the problem. I suspect running the build as root would also resolve the problem.The text was updated successfully, but these errors were encountered: