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
Install dSYM debug information for macOS #4310
base: master
Are you sure you want to change the base?
Conversation
1aef360
to
deb5b93
Compare
@@ -1422,11 +1422,6 @@ def test_find_lib_file_after_install | |||
write_file File.join(@tempdir, "extconf.rb") do |io| | |||
io.write <<-RUBY | |||
require "mkmf" | |||
|
|||
CONFIG['CC'] = '$(TOUCH) $@ ||' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to remove these compiler stubs, since it would otherwise try to use dsymutil on the empty files created from touch
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubygems might not assume the compiler, why not remove CONFIG['dsymutil']
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failures seem coming from codesign
, and this file won't need changes after 8a89dd2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubygems might not assume the compiler, why not remove CONFIG['dsymutil'] instead?
Handling CC not referencing a C compiler when compiling a C compiler seems overly contrived. There should be no need to remove CONFIG['dsymutil']
, since the configure script should leave it blank on platforms where it isn't available. Besides, the CI tests are passing on all platforms as it is now.
The failures seem coming from codesign, and this file won't need changes after 8a89dd2.
By failures I guess you mean from you running the tests locally with the RUBY_CODESIGN environment variable set. Thanks for catching that, I didn't realize that would cause the test to fail.
@@ -1435,7 +1430,6 @@ def test_find_lib_file_after_install | |||
|
|||
write_file File.join(@tempdir, "a.c") do |io| | |||
io.write <<-C | |||
#include <ruby.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't needed and was causing problems without ruby installed, since it wasn't able to find the ruby/config.h
header, since it wasn't finding it where it gets installed. So I removed it to avoid breaking this test.
deb5b93
to
b2f54a0
Compare
9812636
to
4bb2856
Compare
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Problem
On macOS, ruby reads the debug information from a *.dSYM directory corresponding to get a C source file and line number on a backtrace. Although ruby.dSYM was getting generated in the build directory, it wasn't getting installed along with the ruby binary. Also, native extensions neither had the *.dSYM directories generated or installed.
For example, try using this from an installed version of ruby on macOS
Gems installed through
gem install
orbundle install
had the same problem.Solution
I used the feature detection configure.ac does to detect if the dsymutil program is present on the darwin platform to conditionally generate this debug information (as part of POSTLINK) and install the generated *.dSYM directories.
I tested on macOS and linux for installing ruby and a gem with a native extension through both
gem install
andbundle install
and testing cleaningmake clean
andgem uninstall
. It seems to work as expected with these changes.For example, I get the following output now from the above SEGV test within BigDecimal.save_exception_mode