Closed vais closed 5 years ago
Is this do to CONFIG["debugflags"]
or to strip
not being used? I've got the same hash value, but the stripped puma file I have is approx. 45k...
@MSP-Greg I am not aware of strip
(how to use it or what it does). I'm simply setting CONFIG["debugflags"]
back to -g
(as it was in Ruby 2.3 days), and this alone cuts down the size of the .so
files by a factor of 10. (Actually, the factor of 10 part is a little misleading - it's more like there is a static overhead of about 250 KB that gets cut, but since most files are small, this 250 KB overhead results in a factor of 10 difference.)
@vais
strip
can remove the info that using ggdb3
as a debug flag creates. See Ruby configure.ac:641
I believe the files included with RI2 builds have been 'reduced' in size. The setting only affects compiling of extension gems.
Unlikely that many Windows users will be using a gcc debugger. It could be removed from RbConfig with a patch.
@MSP-Greg Thanks! Regarding point 3, I agree but not sure how to patch rbconfig.rb in the context of rubyinstaller2. Is there an example of something like this already being done in this project that I could use as a starting point to make a PR? (I.e. some other files in Ruby distribution getting patched/overwritten?)
What problems are you experiencing?
I've just noticed that the size of compiled extensions (
.so
files) jumped an order of magnitude going from ruby 2.3.3 to 2.4.4. This seems to be caused by this change inrbconfig.rb
:Reverting this change makes
.so
files an order of magnitude smaller.With
CONFIG["debugflags"] = "-ggdb3"
we get this:With
CONFIG["debugflags"] = "-g"
we get this:Should
debugflags
be changed in rubyinstaller2, or does this have to be done upstream? I'm concerned that getting this into Ruby trunk may be much more cumbersome given multiple platforms etc...