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

Upcoming Puppet 4 / Ruby 2.1.5 Registry compatibility changes #8

Closed
Iristyle opened this issue Feb 4, 2015 · 10 comments
Closed

Upcoming Puppet 4 / Ruby 2.1.5 Registry compatibility changes #8

Iristyle opened this issue Feb 4, 2015 · 10 comments

Comments

@Iristyle
Copy link

Iristyle commented Feb 4, 2015

As part of making Puppet 4 compatible with Ruby 2.1.5, we have discovered a couple of bugs inside Ruby that will affect your module. The two primary issues are:

  • When enumerating keys with #each_key / #keys or values with #each_value / #values, Ruby will take a UTF-16LE string and roundtrip it through the local codepage unnecessarily, which may cause encoding exceptions. Our prime example of this is when a Unicode en-dash U+2013 appears in a registry value, and the local codepage is IBM437, which has no equivalent character. This is just one of many potential examples that may trigger this behavior. NOTE: Normal registry reads of a value at a particular key are not problematic - the bad behavior is only triggered during enumeration. We have not yet filed this bug with Ruby.
  • When using the #delete_key and #delete_value methods, Ruby is passing wide character UTF-16LE strings to ANSI APIs. We have filed this bug with Ruby at https://bugs.ruby-lang.org/issues/10820

There are additional technical details that can be found in PUP-3837, the ticket we're using to track changes that we've made to Puppet. Our resolution for these issues was merged to Puppet at puppetlabs/puppet@c610cd0

We don't have Puppet 4 builds released yet, but keep an eye on https://groups.google.com/forum/#!forum/puppet-announce

I have identified issues with the code in this module that will require some updating to ensure it maintains compatibility with both existing Puppet releases and the upcoming releases. I'm getting in touch with you now, so that you're not caught off guard, and so that your module is ready to go by the time 4.0 ships.

Issues:

We will be making an announcement to the puppet-dev list shortly mentioning some of these upcoming changes.
https://groups.google.com/forum/#!forum/puppet-dev

Let me know if you have any questions.

Thanks!

@Iristyle
Copy link
Author

Iristyle commented Feb 4, 2015

Also see #6 when we had to address similar issues.

@badgerious
Copy link
Contributor

@Iristyle Thanks, as before, for the very detailed issue. Looking into making the suggested fixes.

badgerious added a commit that referenced this issue Feb 15, 2015
Bug exists in ruby 2.1.5 which passes wide strings to ANSI API. Instead,
invoke RegDeleteValueW directly.

closes #8
@badgerious
Copy link
Contributor

Will wait for Puppet 4 builds to test on before merging.

@Iristyle
Copy link
Author

Left one comment for you on 41ae24e @badgerious.

@ferventcoder
Copy link

@badgerious Do you think this will be released soon?

@Iristyle
Copy link
Author

Iristyle commented Aug 2, 2015

thanks for the reminder @ferventcoder - I also just filed the enumeration issue with Ruby at https://bugs.ruby-lang.org/issues/11410

@badgerious
Copy link
Contributor

@ferventcoder Slipped off the radar (clearly :) !). I need to put together a Puppet 4 test environment to give it a run and then I'll cut a release.

@ferventcoder
Copy link

@badgerious awesome, thank you

@ferventcoder
Copy link

\o/ - https://forge.puppetlabs.com/badgerious/windows_env/changelog
Sweet! Thanks. I now have a dependency on this module coming with choco - chocolatey-archive/puppet-chocolatey#76

@badgerious
Copy link
Contributor

@ferventcoder Cool. Based on the way you're using windows_env, you may want to have a look at #11, a long standing issue I've not bothered to address since no one has complained. But it might affect you here.

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

3 participants