summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2022-04-07 10:29:44 -0700
committerGitHub <noreply@github.com>2022-04-07 10:29:44 -0700
commitca35e141b31c6325da15900422de9dc8d5373c12 (patch)
tree80e424184d748bda1b8bba69d473d1344064d1b1
parentf61168f78a52f28c170feb3c6a65061d91e7cb25 (diff)
parentbf652837e634a0271d726a7b3dfe6f50e8e04cbc (diff)
downloadchef-ca35e141b31c6325da15900422de9dc8d5373c12.tar.gz
Merge pull request #12769 from chef/jfm/platform_updates
-rw-r--r--.github/workflows/func_spec.yml2
-rw-r--r--Gemfile.lock10
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform_family.rb7
-rw-r--r--cspell.json1
-rw-r--r--lib/chef/provider/package/windows/msi.rb4
-rw-r--r--lib/chef/provider/package/windows/registry_uninstall_entry.rb2
-rw-r--r--lib/chef/provider/service/windows.rb2
-rw-r--r--lib/chef/resource/windows_font.rb4
-rw-r--r--lib/chef/resource/windows_shortcut.rb2
-rw-r--r--lib/chef/win32/registry.rb4
10 files changed, 22 insertions, 16 deletions
diff --git a/.github/workflows/func_spec.yml b/.github/workflows/func_spec.yml
index 27cee8a7f4..2247b414fd 100644
--- a/.github/workflows/func_spec.yml
+++ b/.github/workflows/func_spec.yml
@@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [windows-2019, windows-2016]
+ os: [windows-2019, windows-2022]
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: [2.7, '3.0']
runs-on: ${{ matrix.os }}
diff --git a/Gemfile.lock b/Gemfile.lock
index 677c47e281..a2a34e6eb7 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -154,7 +154,7 @@ GEM
mixlib-shellout (>= 2.0, < 4.0)
ast (2.4.2)
aws-eventstream (1.2.0)
- aws-partitions (1.573.0)
+ aws-partitions (1.574.0)
aws-sdk-core (3.130.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
@@ -300,9 +300,9 @@ GEM
mixlib-config (3.0.9)
tomlrb
mixlib-log (3.0.9)
- mixlib-shellout (3.2.6)
+ mixlib-shellout (3.2.7)
chef-utils
- mixlib-shellout (3.2.6-universal-mingw32)
+ mixlib-shellout (3.2.7-universal-mingw32)
chef-utils
ffi-win32-extensions (~> 1.0.3)
win32-process (~> 0.9)
@@ -373,7 +373,7 @@ GEM
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
- rspec-mocks (3.11.0)
+ rspec-mocks (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
@@ -494,7 +494,7 @@ GEM
rubyzip (~> 2.0)
winrm (~> 2.0)
wisper (2.0.1)
- wmi-lite (1.0.5)
+ wmi-lite (1.0.7)
PLATFORMS
ruby
diff --git a/chef-utils/lib/chef-utils/dsl/platform_family.rb b/chef-utils/lib/chef-utils/dsl/platform_family.rb
index dd3c589e77..2dcc90974c 100644
--- a/chef-utils/lib/chef-utils/dsl/platform_family.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform_family.rb
@@ -270,12 +270,17 @@ module ChefUtils
# Determine if the Ruby VM is currently running on a Windows node (ChefSpec can never stub
# this behavior, so this is useful for code which can never be parsed on a non-Windows box).
#
+ # April 2022 - Note that we changed the platform identifier from 'mingw32' to 'mingw'
+ # We did this because Ruby 3.1 introduces the new universal windows platform of 'x64-mingw-ucrt'
+ # We updated the existing regex snippet to capture both the 32-bit platform and the new x64
+ # universal platform
+ #
# @since 15.5
#
# @return [Boolean]
#
def windows_ruby?
- !!(RUBY_PLATFORM =~ /mswin|mingw32|windows/)
+ !!(RUBY_PLATFORM =~ /mswin|mingw|windows/)
end
#
diff --git a/cspell.json b/cspell.json
index e171833e86..681d67fc76 100644
--- a/cspell.json
+++ b/cspell.json
@@ -1323,6 +1323,7 @@
"ucanhaz",
"UCHAR",
"uchar",
+ "ucrt",
"udiff",
"UHALF",
"ULONG",
diff --git a/lib/chef/provider/package/windows/msi.rb b/lib/chef/provider/package/windows/msi.rb
index 1ce8add80d..93e41f67fc 100644
--- a/lib/chef/provider/package/windows/msi.rb
+++ b/lib/chef/provider/package/windows/msi.rb
@@ -18,7 +18,7 @@
# TODO: Allow new_resource.source to be a Product Code as a GUID for uninstall / network install
-require_relative "../../../win32/api/installer" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+require_relative "../../../win32/api/installer" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
require_relative "../../../mixin/shell_out"
class Chef
@@ -26,7 +26,7 @@ class Chef
class Package
class Windows
class MSI
- include Chef::ReservedNames::Win32::API::Installer if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+ include Chef::ReservedNames::Win32::API::Installer if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
include Chef::Mixin::ShellOut
def initialize(resource, uninstall_entries)
diff --git a/lib/chef/provider/package/windows/registry_uninstall_entry.rb b/lib/chef/provider/package/windows/registry_uninstall_entry.rb
index 6e7b825256..ca8bd89766 100644
--- a/lib/chef/provider/package/windows/registry_uninstall_entry.rb
+++ b/lib/chef/provider/package/windows/registry_uninstall_entry.rb
@@ -18,7 +18,7 @@
#
module Win32
- autoload :Registry, File.expand_path("../../../monkey_patches/win32/registry", __dir__) if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+ autoload :Registry, File.expand_path("../../../monkey_patches/win32/registry", __dir__) if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
end
class Chef
diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb
index 09b378e557..6d62d5a125 100644
--- a/lib/chef/provider/service/windows.rb
+++ b/lib/chef/provider/service/windows.rb
@@ -20,7 +20,7 @@
require_relative "simple"
require_relative "../../win32_service_constants"
-if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
require_relative "../../win32/error"
require "win32/service"
end
diff --git a/lib/chef/resource/windows_font.rb b/lib/chef/resource/windows_font.rb
index 952f689fba..21ce0a2f7e 100644
--- a/lib/chef/resource/windows_font.rb
+++ b/lib/chef/resource/windows_font.rb
@@ -82,7 +82,7 @@ class Chef
# install the font into the appropriate fonts directory
def install_font
- require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+ require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
fonts_dir = Chef::Util::PathHelper.join(ENV["windir"], "fonts")
folder = WIN32OLE.new("Shell.Application").Namespace(fonts_dir)
converge_by("install font #{new_resource.font_name} to #{fonts_dir}") do
@@ -94,7 +94,7 @@ class Chef
#
# @return [Boolean] Is the font is installed?
def font_exists?
- require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+ require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
fonts_dir = WIN32OLE.new("WScript.Shell").SpecialFolders("Fonts")
fonts_dir_local = Chef::Util::PathHelper.join(ENV["home"], "AppData/Local/Microsoft/Windows/fonts")
logger.trace("Seeing if the font at #{Chef::Util::PathHelper.join(fonts_dir, new_resource.font_name)} exists")
diff --git a/lib/chef/resource/windows_shortcut.rb b/lib/chef/resource/windows_shortcut.rb
index 3bf52f61d5..37fc8eca2d 100644
--- a/lib/chef/resource/windows_shortcut.rb
+++ b/lib/chef/resource/windows_shortcut.rb
@@ -57,7 +57,7 @@ class Chef
description: "Icon to use for the shortcut. Accepts the format of `path, index`, where index is the icon file to use. See Microsoft's [documentation](https://msdn.microsoft.com/en-us/library/3s9bx7at.aspx) for details"
load_current_value do |new_resource|
- require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+ require "win32ole" if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
link = WIN32OLE.new("WScript.Shell").CreateShortcut(new_resource.shortcut_name)
name new_resource.shortcut_name
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb
index ec7783815d..cb7bbfc51c 100644
--- a/lib/chef/win32/registry.rb
+++ b/lib/chef/win32/registry.rb
@@ -20,7 +20,7 @@ require_relative "../reserved_names"
require_relative "api"
require_relative "../mixin/wide_string"
-if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
require "win32/api"
module Win32
autoload :Registry, File.expand_path("../monkey_patches/win32/registry", __dir__)
@@ -32,7 +32,7 @@ class Chef
class Win32
class Registry
- if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+ if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
include Chef::ReservedNames::Win32::API::Registry
extend Chef::ReservedNames::Win32::API::Registry
end