Skip to content

Commit

Permalink
Generate dSYM debug information for MRI extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Mar 25, 2021
1 parent efc38a3 commit deb5b93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
7 changes: 6 additions & 1 deletion lib/mkmf.rb
Expand Up @@ -2038,14 +2038,15 @@ def configuration(srcdir)
ruby_headers = #{headers.join(' ')}
RM = #{config_string('RM', &possible_command) || '$(RUBY) -run -e rm -- -f'}
RM_RF = #{'$(RUBY) -run -e rm -- -rf'}
RM_RF = #{config_string('RMALL', &possible_command) || '$(RUBY) -run -e rm -- -rf'}
RMDIRS = #{config_string('RMDIRS', &possible_command) || '$(RUBY) -run -e rmdir -- -p'}
MAKEDIRS = #{config_string('MAKEDIRS', &possible_command) || '@$(RUBY) -run -e mkdir -- -p'}
INSTALL = #{config_string('INSTALL', &possible_command) || '@$(RUBY) -run -e install -- -vp'}
INSTALL_PROG = #{config_string('INSTALL_PROG') || '$(INSTALL) -m 0755'}
INSTALL_DATA = #{config_string('INSTALL_DATA') || '$(INSTALL) -m 0644'}
COPY = #{config_string('CP', &possible_command) || '@$(RUBY) -run -e cp -- -v'}
TOUCH = exit >
POSTLINK = #{config_string('POSTLINK')}
#### End of system configuration section. ####
Expand Down Expand Up @@ -2382,6 +2383,9 @@ def create_makefile(target, srcprefix = nil)
if defined?($installed_list)
mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n"
end
unless CONFIG['dsymutil'].to_s.empty?
mfile.print "\tcp -r #{f}.dSYM/ #{dir}/$(DLLIB).dSYM/\n"
end
end
mfile.print "clean-static::\n"
mfile.print "\t-$(Q)$(RM) $(STATIC_LIB)\n"
Expand Down Expand Up @@ -2764,6 +2768,7 @@ def MAIN_DOES_NOTHING(*refs)
clean-so::
clean: clean-so clean-static clean-rb-default clean-rb
\t\t-$(Q)$(RM) $(CLEANLIBS#{sep}) $(CLEANOBJS#{sep}) $(CLEANFILES#{sep}) .*.time
\t\t-$(Q)$(RM_RF) *.dSYM
distclean-rb-default::
distclean-rb::
Expand Down
2 changes: 1 addition & 1 deletion template/Makefile.in
Expand Up @@ -477,7 +477,7 @@ clean-local::
enc/encinit.c enc/encinit.$(OBJEXT) $(pkgconfig_DATA) \
ruby-runner.$(OBJEXT) ruby-runner.h \
|| $(NULLCMD)
-$(Q)$(RMALL) exe/ *.dSYM
-$(Q)$(RMALL) exe/ *.dSYM $(EXTOUT)/$(arch)/*.dSYM

distclean-local::
$(Q)$(RM) \
Expand Down
11 changes: 0 additions & 11 deletions test/rubygems/test_gem_installer.rb
Expand Up @@ -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) $@ ||'
CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
$ruby = '#{Gem.ruby}'
create_makefile("#{@spec.name}")
RUBY
end
Expand All @@ -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>
void Init_a() { }
C
end
Expand Down Expand Up @@ -1512,11 +1506,6 @@ def test_install_extension_flat
write_file File.join(@tempdir, "extconf.rb") do |io|
io.write <<-RUBY
require "mkmf"
CONFIG['CC'] = '$(TOUCH) $@ ||'
CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
$ruby = '#{Gem.ruby}'
create_makefile("#{@spec.name}")
RUBY
end
Expand Down

0 comments on commit deb5b93

Please sign in to comment.