-
Notifications
You must be signed in to change notification settings - Fork 548
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
Replace Win32API with Fiddle, update appveyor.yml #1053
Conversation
I remember doing it this way because Win32API is in core. Is it deprecated/removed and is Fiddle bundled with core now? At which Ruby does this change? (In other words what revisions are being left behind?) |
I think it's always been part of the std-lib.
See Then again, I've joked about it, given that it's been deprecated for a very long time. Win32API uses Fiddle. Really, I'm just tired of seeing warning messages... |
LoadLibrary = Win32API.new('Kernel32', 'LoadLibrary', ['P'], 'I') | ||
if LoadLibrary.call(dll_path).zero? | ||
require 'fiddle' | ||
kernel32 = Fiddle.dlopen 'kernel32' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should still be initial cap Kernel32
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm, not reusing it are we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the library:Win32API.new('Kernel32', ...
vs. Fiddle.dlopen 'kernel32'
Maybe irrelevant because of case insensitivity? But if there's a "correct" convention I'd like to use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. between multi-tasking & bouncing between languages, I often miss the obvious.
Actually, the file is kernel32.dll
, and as you know, Windows file system is case-insensitive (which can cause issues when comparing paths, use casecmp
...)
Also, ruby/reline essentially created its own Win32API
class to avoid the deprecation warnings, and it's all lower case. See lib/reline/windows.rb
Long story short, I think we're ok...
Looks like Fiddle is core as far back as Ruby 2.0: https://ruby-doc.org/stdlib-2.0.0/libdoc/fiddle/rdoc/Fiddle.html Meanwhile, I knew there was some history in my memory banks around Win32API: ruby/ruby#835 See also #584 Since the issue came up in the mysql2 0.3.x series, continuing to use I am reminded to get a release out... |
Note to self - ALWAYS USE 'W' VERSIONS... Some users may have UTF-8 characters in their user names... Updated. Passing Appveyor build |
My fork's Appveyor build passed and is at:
https://ci.appveyor.com/project/MSP-Greg/mysql2/builds/25306388