Skip to content
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

included dll's ? #141

Open
MSP-Greg opened this issue Feb 28, 2019 · 3 comments
Open

included dll's ? #141

MSP-Greg opened this issue Feb 28, 2019 · 3 comments

Comments

@MSP-Greg
Copy link
Contributor

MSP-Greg commented Feb 28, 2019

Lars,

While working with an extension gem that had all of the needed c code included (no external MSYS/MinGW packages needed), I noticed that it was dependent on libstdc++-6.dll, which doesn't seem to be included in bin/ruby_builtin_dlls. Maybe consider adding it?

A while ago I wrote code that looked at the gcc-libs, gdbm, libffi, openssl, readline, & zlib packages, and determined all the dll's included in those packages and their dependencies. Below is the list:

Using pacman -Ql &  pacman -Qi
gcc-libs gdbm libffi openssl readline zlib

libasprintf-0.dll
libatomic-1.dll
libbz2-1.dll
libcharset-1.dll
libcrypto-1_1-x64.dll
libexpat-1.dll
libffi-6.dll
libgcc_s_seh-1.dll
libgdbm-6.dll
libgdbm_compat-4.dll
libgettextlib-0-19-8-1.dll
libgettextpo-0.dll
libgettextsrc-0-19-8-1.dll
libgmp-10.dll
libgmpxx-4.dll
libgomp-1.dll
libhistory7.dll
libiconv-2.dll
libintl-8.dll
libminizip-1.dll
libp11-kit-0.dll
libquadmath-0.dll
libreadline7.dll
libssl-1_1-x64.dll
libssp-0.dll
libstdc++-6.dll
libtasn1-6.dll
libtermcap-0.dll
libwinpthread-1.dll
zlib1.dll

As you may recall, I'm not really a c type. If you want the code, let me know.

Hope things are well, Greg

@OSXLich-Doug
Copy link

@MSP-Greg - I am working a challenge to reduce the size of ruby installs. When fat binaries were removed, I moved to a full toolkit install with the necessary gems - but it is huge. I am searching for ways to remove heft. It appears, with your code, I could identify the required DLLS for the gems installed, move them to a specific path-available location, and take all of the weight of the msys system back out of the bundled installer, leaving it to the user to decide if they want to install the tools and packages. If that makes sense, and if it is even close to accurate, I would truly enjoy being able to review your code.

Thanks for all you do - Doug

@MSP-Greg
Copy link
Contributor Author

@OSXLich-Doug

Not quite sure what you mean by 'ruby installs', but I think you're packaging apps with pre-compiled extension gems and want to include the dll's with the package? The code I referenced above used pacman to get the list of required dll's, so it wouldn't work with gems. The code below is kind of hacky, but it does list all the dll's required by *.so files in the RubyGems folders.

You'd need to change the path if you're 'bundling', and filter out dll's included with Ruby, etc...

objdump = "C:/msys64/mingw64/bin/objdump.exe"
so_files = []
Gem.path.each { |gp| so_files += Dir["#{gp}/gems/*/lib/**/*.so"] }
dlls = ''.dup
so_files.each do |so|
  dlls << `powershell -NoProfile -Command "#{objdump} -p #{so} | Select-String -Pattern 'DLL Name:'"`.gsub(/^[ \t]*DLL Name: /, '')
end
dlls = dlls.strip.split.uniq.sort
puts dlls

@OSXLich-Doug
Copy link

Thanks! I'll let you know how it goes in a couple weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants