Open fujimotos opened 2 years ago
@daipom's investigation revealed that the root cause was SetDefaultDllDirectories()
.
If we do not call that function, it works as expected:
We've found the cause. When SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS) is executed, some data cannot be retrieved in both ruby and C++. SetDefaultDllDirectories: https://docs.microsoft.com/ja-jp/windows/win32/api/libloaderapi/nf-libloaderapi-setdefaultdlldirectories
In ruby, this is called by RubyInstaller::Runtime.enable_dll_search_paths in rubygems\defaults\operating_system.rb. (In my machine, the path is C:\Ruby26-x64\lib\ruby\2.6.0\rubygems\defaults\operating_system.rb) Commenting out this fixes this problem in ruby.
- https://github.com/oneclick/rubyinstaller2/blob/9017818c301aa92041a647e16421c3a9d62fe1bc/lib/ruby_installer/build/singleton.rb#L20-L28
- https://github.com/oneclick/rubyinstaller2/blob/9017818c301aa92041a647e16421c3a9d62fe1bc/lib/ruby_installer/build/msys2_installation.rb#L96
- https://github.com/oneclick/rubyinstaller2/blob/769f47d6b611588b806a4a4115d52f3143f7d1af/lib/ruby_installer/build/dll_directory.rb#L74
In C++, adding SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); makes the same problem occur.
@fujimotos Thank you for re-summarizing this!
@daipom FWIW, I don't think we resolve this issue (at least) in the first release.
It strongly seems to me that it's essentially caused by the way RubyInstaller sets up the execution environment, not by some deficit in our implementation.
But anyway, I created a separate ticket for the issue, mostly because I wanted to make it easier to track our investigtion progress.
A possible related issue: https://github.com/oneclick/rubyinstaller2/issues/243
I agree! Thank you!
I stated to label any non-critical tickets as longterm
. These tickets are not
necessary for our first release, so we don't need to work on them at the moment.
Branched from https://github.com/fluent-plugins-nursery/fluent-plugin-windows-exporter/issues/1#issuecomment-994168635.
HKEY_PERFORMANCE_DATA
for counter names, some entries are missing from the data.