Jira (PUP-3970) Should Puppet::Util::Windows::String.wide_string be changed based on Ruby 2.1

30 views
Skip to first unread message

Ethan Brown (JIRA)

unread,
Feb 5, 2015, 6:25:37 PM2/5/15
to puppe...@googlegroups.com
Ethan Brown created an issue
 
Puppet / Task PUP-3970
Should Puppet::Util::Windows::String.wide_string be changed based on Ruby 2.1
Issue Type: Task Task
Affects Versions: PUP 4.0.0
Assignee: Unassigned
Components: Windows
Created: 2015/02/05 3:24 PM
Fix Versions: PUP 4.x
Labels: windows
Priority: Normal Normal
Reporter: Ethan Brown

puppet/util/windows/string.rb currently contains some code intended to work around Ruby bugs prior to 2.1

This code should now be moot, but requires some validation \ verification. The last time it was touched, it was refactored so that it only has a single callsite in puppet/util/windows/api_types.rb

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a)
Atlassian logo

Ethan Brown (JIRA)

unread,
Feb 5, 2015, 6:26:37 PM2/5/15
to puppe...@googlegroups.com
Ethan Brown updated an issue
Change By: Ethan Brown
{{puppet/util/windows/string.rb}} currently contains some code intended to work around Ruby bugs prior to 2.1

This code should now be moot, but requires some validation \ verification.  The last time it was touched, it was refactored so that it only has a single callsite in {{puppet/util/windows/api_types.rb}}  at https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/windows/api_types.rb#L25

Also ensure that no modules are using it before pulling the plug.

Ethan Brown (JIRA)

unread,
Feb 5, 2015, 6:31:37 PM2/5/15
to puppe...@googlegroups.com
Ethan Brown updated an issue
{{puppet/util/windows/string.rb}} currently contains some code intended to work around Ruby bugs prior to 2.1

This code should now be moot, but requires some validation \ verification.
  The last time it was touched, it was refactored so that it only has a single callsite in {{
  

Current callsites include:

https://github.com/puppetlabs/
puppet/ blob/master/lib/puppet/ util/windows/ api_types file .rb }} at
 https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/windows/ process.rb
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/windows/
api_types.rb#L25
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/windows/security.rb
Also ensure that no modules are using it before pulling the plug https://github . com/puppetlabs/puppet/blob/master/lib/puppet/util/windows/taskscheduler.rb
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/windows/user.rb
https://github.com/puppetlabs/puppet/blob/master/spec/unit/util/windows/string_spec.rb

Make sure any module usage is monitored as well.

Kenaz Kwa (JIRA)

unread,
Aug 29, 2016, 7:47:15 PM8/29/16
to puppe...@googlegroups.com
Kenaz Kwa updated an issue
Change By: Kenaz Kwa
Team: Agent & Platform Support
This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Josh Cooper (JIRA)

unread,
Apr 6, 2017, 3:17:03 PM4/6/17
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-3970
 
Re: Should Puppet::Util::Windows::String.wide_string be changed based on Ruby 2.1

Might be a good time to cleanup these workarounds when we move to 2.3, adding to epic.

This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Josh Cooper (JIRA)

unread,
Apr 6, 2017, 3:17:03 PM4/6/17
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Fix Version/s: PUP 4.y
Fix Version/s: PUP 5.y

Moses Mendoza (JIRA)

unread,
May 15, 2017, 8:06:04 PM5/15/17
to puppe...@googlegroups.com

Maggie Dreyer (JIRA)

unread,
May 17, 2017, 5:08:03 PM5/17/17
to puppe...@googlegroups.com
Maggie Dreyer commented on Task PUP-3970
 
Re: Should Puppet::Util::Windows::String.wide_string be changed based on Ruby 2.1

Since we still need to support 1.9.3, can these really be removed?

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:54:45 PM5/18/17
to puppe...@googlegroups.com

Ethan Brown (JIRA)

unread,
May 18, 2017, 2:51:02 PM5/18/17
to puppe...@googlegroups.com
Ethan Brown commented on Task PUP-3970
 
Re: Should Puppet::Util::Windows::String.wide_string be changed based on Ruby 2.1

Good point Maggie Dreyer - though I believe no one should be running Windows + Ruby 1.9.3 any more (we don't have a supported Windows agent with that runtime)

Josh Cooper (JIRA)

unread,
May 22, 2017, 12:42:02 AM5/22/17
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-3970

I think we want to make the workaround conditional on ruby version, so something like:

module Puppet::Util::Windows::String
  if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
    def wide_string(str)
      # existing impl
    end
  else
    def wide_string(str)
      str.nil? ? nil : str.encode('UTF-16LE')
    end
  end
end

Josh Cooper (Jira)

unread,
Jun 18, 2020, 6:40:03 PM6/18/20
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Josh Cooper
 
Change By: Josh Cooper
Assignee: Josh Cooper
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 18, 2020, 6:40:03 PM6/18/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 5.y
Fix Version/s: PUP 6.y

Josh Cooper (Jira)

unread,
Jun 18, 2020, 6:40:04 PM6/18/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jul 8, 2020, 3:02:04 AM7/8/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Coremunity Hopper Platform Core KANBAN

Josh Cooper (Jira)

unread,
Jul 8, 2020, 5:39:04 PM7/8/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-3970
 
Re: Should Puppet::Util::Windows::String.wide_string be changed based on Ruby 2.1

Ruby backported a number of multibyte terminators to at least ruby 2.3 (https://github.com/puppetlabs/puppet/pull/8214), so this could in theory land in 6.y. Or we could wait for puppet 7. Thoughts?

Josh Cooper (Jira)

unread,
Jul 23, 2020, 12:44:03 PM7/23/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.y
Fix Version/s: PUP 7.0.0

Josh Cooper (Jira)

unread,
Jul 23, 2020, 12:45:03 PM7/23/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-3970
 
Re: Should Puppet::Util::Windows::String.wide_string be changed based on Ruby 2.1

Targeted for puppet 7 as we'll be dropping at least ruby 2.3 and maybe 2.4

Josh Cooper (Jira)

unread,
Jul 24, 2020, 7:11:05 PM7/24/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jul 24, 2020, 7:12:03 PM7/24/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: Remove Ruby workaround for wide character strings on Windows
Reply all
Reply to author
Forward
0 new messages