-
Notifications
You must be signed in to change notification settings - Fork 12
Add wrappers for strip commands so that files are copied to the local drive before stripped. #4
Conversation
@tjschuck, @luislavena: Did you notice this issue, too, when using |
@larskanis I tried to look at this last week, but ran into #5, which kept it from working at all for me, with or without your changes. Still haven't had the time to fix that one yet :( |
@larskanis Interesting that I didn't hit this issue. Will take a look the upcoming days, but can't promise anything until the first week of november 😢 |
local drive before stripped. Stripping files on a local folder instead of a Virtualbox shared folder is needed to work around this bug: https://www.virtualbox.org/ticket/8463
@tjschuck I did a rebase to current master. I get the 'Protocol error' for any I'm not sure, if the 'Protocol error' is dependent on the host environment. I'm using VirtualBox packaged to and running on Ubuntu-13.10, but got this error on older Ubuntu-releases, too. Would be great, if someone can verify this issue and the attached workaround. @simi can you? |
pwd /home/vagrant while vagrant up.
@larskanis I had this issue also. But I did some steps (manually edited config yml for rake-compiler maybe ???) to avoid it. Anyway I'll test this one more time and I'll send ping here with 👍 or 👎. |
@larskanis Which gems cause this error for you when compiling? I haven't run into it, so I'd like to try to reproduce! |
Just a note-to-self that the version bumping in ffi/ffi#298 is also necessary, or else nothing will work. |
@tjschuck Does that mean you can reproduce the issue with |
@larskanis Yep, ran into the same "Protocol error" building ffi. |
@larskanis does this happen with the testing project? https://github.com/luislavena/test-ruby-c-extension I want to exclude possible issues caused by libffi compilation itself. |
test-ruby-c-extension does not use strip in any way, so it is not affected by this issue. libffi equally does not use strip, but the Rakefile of the ffi gem. Also zlib makes use of strip in it's Makefile - this is why nokogiri is affected by this issue. I don't know, what's so special in the way strip accesses it's files, but there was no other command that causes this "Protocol error", so far. |
@larskanis If I remember correctly, the issue was that cross-compiled Rubies generated huge debug symbols, so extensions compiled against them resulted in being bloated. I think perhaps a change on the way Ruby is cross-compiled would help to solve that. I'm going to play a bit with this today. |
@luislavena Yes, that would probably give the same result as stripping the .so files. On the other hand it will not help for third party libraries like zlib, that make use of strip in their Makefile. |
@larskanis thank you for your fast response. I'm playing catch-up with all the OSS I'm involved, so working today on review these changes and ruby ffi specially. FYI: I'm on |
@tjschuck this addition works perfectly for me. For testing, I've added the following to ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
platforms = {
"x86-mingw32" => "i686-w64-mingw32",
"x64-mingw32" => "x86_64-w64-mingw32"
}
platforms.each do |platform, prefix|
task "copy:sample_gem_ext:#{platform}:#{ruby_version}" do |t|
%w[lib tmp/#{platform}/stage/lib].each do |dir|
so_file = "#{dir}/#{ruby_version[/^\d+\.\d+/]}/sample_gem_ext.so"
if File.exists?(so_file)
sh "#{prefix}-strip -S #{so_file}"
end
end
end
end
end And it worked without issues. Thank you @larskanis for sending this. @tjschuck perhaps you can add us both as contributors so we can merge those changes? I have another pull request with other updates (adding Ruby 2.1 too) Thank you. |
Sorry for the delay, friends. "Work" and all that :) Looking at this now, but likely merging shortly. |
Add wrappers for strip commands so that files are copied to the local drive before stripped.
This relates to #4, as strip seems to have issues working with VirtualBox shared folder mechanism. Testing this first will help us implement the wrappers descrived in the above ticket.
❤️ |
Thank you all for taking the time to review and merge this! |
Stripping files on a local folder instead of a Virtualbox shared folder
is needed to work around this bug: https://www.virtualbox.org/ticket/8463
Without that wrapper strip fails with something like this: