diff options
34 files changed, 321 insertions, 229 deletions
diff --git a/.expeditor/release.omnibus.yml b/.expeditor/release.omnibus.yml index 1a2b43ea60..1913546965 100644 --- a/.expeditor/release.omnibus.yml +++ b/.expeditor/release.omnibus.yml @@ -10,6 +10,7 @@ fips-platforms: - windows-* skip-artifactory-platforms: - freebsd-13-amd64 +windows-64-msystem: UCRT64 builder-to-testers-map: aix-7.1-powerpc: - aix-7.1-powerpc diff --git a/.expeditor/scripts/bk_win_functional.ps1 b/.expeditor/scripts/bk_win_functional.ps1 index 8b4a445b44..7d23d07b8f 100644 --- a/.expeditor/scripts/bk_win_functional.ps1 +++ b/.expeditor/scripts/bk_win_functional.ps1 @@ -7,11 +7,11 @@ Remove-Item -Path C:\ProgramData\chocolatey\bin\choco.exe -ErrorAction SilentlyC $ErrorActionPreference = 'Stop' -Write-Output "--- Enable Ruby 2.7" +Write-Output "--- Enable Ruby 3.1" -Write-Output "Register Installed Ruby Version 2.7 With Uru" -Start-Process "uru_rt.exe" -ArgumentList 'admin add C:\ruby27\bin' -Wait -uru 271 +Write-Output "Register Installed Ruby Version 3.1 With Uru" +Start-Process "uru_rt.exe" -ArgumentList 'admin add C:\ruby31\bin' -Wait +uru 312 if (-not $?) { throw "Can't Activate Ruby. Did Uru Registration Succeed?" } ruby -v if (-not $?) { throw "Can't run Ruby. Is it installed?" } diff --git a/.expeditor/scripts/verify-plan.ps1 b/.expeditor/scripts/verify-plan.ps1 index 614d472964..380a0f3ddb 100644 --- a/.expeditor/scripts/verify-plan.ps1 +++ b/.expeditor/scripts/verify-plan.ps1 @@ -15,6 +15,15 @@ Write-Host "--- :8ball: :windows: Verifying $Plan" powershell -File "./.expeditor/scripts/ensure-minimum-viable-hab.ps1" if (-not $?) { throw "Could not ensure the minimum hab version required is installed." } +Write-Host "--- :construction: Verifying Git is Installed" +$source = Get-Command -Name Git -Verbose +Write-Host "Which version of Git is installed? - " $source.version +if (-not ($source.name -match "git.exe")) { + choco install git -y + # gotta refresh the path so you can actually use Git now + $env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") +} + Write-Host "--- :key: Generating fake origin key" hab origin key generate $env:HAB_ORIGIN diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 14b168661f..7f564e4dcf 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -15,31 +15,31 @@ steps: # Tests Ruby 2.6 ######################################################################### -- label: "chef-utils Unit :ruby: 2.6" - commands: - - /workdir/.expeditor/scripts/bk_container_prep.sh - - cd chef-utils - - bundle config set --local without omnibus_package - - bundle config set --local path 'vendor/bundle' - - bundle install --jobs=3 --retry=3 - - bundle exec rake spec - expeditor: - executor: - docker: - image: rubydistros/ubuntu-18.04:2.6 - -- label: "chef-config Unit :ruby: 2.6" - commands: - - /workdir/.expeditor/scripts/bk_container_prep.sh - - cd chef-config - - bundle config set --local without omnibus_package - - bundle config set --local path 'vendor/bundle' - - bundle install --jobs=3 --retry=3 - - bundle exec rake spec - expeditor: - executor: - docker: - image: rubydistros/ubuntu-18.04:2.6 +# - label: "chef-utils Unit :ruby: 2.6" +# commands: +# - /workdir/.expeditor/scripts/bk_container_prep.sh +# - cd chef-utils +# - bundle config set --local without omnibus_package +# - bundle config set --local path 'vendor/bundle' +# - bundle install --jobs=3 --retry=3 +# - bundle exec rake spec +# expeditor: +# executor: +# docker: +# image: rubydistros/ubuntu-18.04:2.6 + +# - label: "chef-config Unit :ruby: 2.6" +# commands: +# - /workdir/.expeditor/scripts/bk_container_prep.sh +# - cd chef-config +# - bundle config set --local without omnibus_package +# - bundle config set --local path 'vendor/bundle' +# - bundle install --jobs=3 --retry=3 +# - bundle exec rake spec +# expeditor: +# executor: +# docker: +# image: rubydistros/ubuntu-18.04:2.6 ######################################################################### # Tests Ruby 3.1 @@ -264,7 +264,7 @@ steps: docker: image: rubydistros/almalinux-8:3.1 -- label: "Functional Windows :ruby: 2.7" +- label: "Functional Windows :ruby: 3.1" commands: - .expeditor/scripts/bk_win_functional.ps1 expeditor: @@ -274,27 +274,27 @@ steps: single-use: true shell: ["powershell", "-Command"] -- label: "Integration Windows :ruby: 3.0" +- label: "Integration Windows :ruby: 3.1" commands: - /workdir/.expeditor/scripts/bk_win_integration.ps1 expeditor: executor: docker: host_os: windows - image: rubydistros/windows-2019:3.0 + image: rubydistros/windows-2019:3.1 environment: - FORCE_FFI_YAJL=ext - CHEF_LICENSE=accept-no-persist shell: ["powershell", "-Command"] -- label: "Unit Windows :ruby: 3.0" +- label: "Unit Windows :ruby: 3.1" commands: - /workdir/.expeditor/scripts/bk_win_unit.ps1 expeditor: executor: docker: host_os: windows - image: rubydistros/windows-2019:3.0 + image: rubydistros/windows-2019:3.1 environment: - FORCE_FFI_YAJL=ext - CHEF_LICENSE=accept-no-persist diff --git a/.github/workflows/func_spec.yml b/.github/workflows/func_spec.yml index 2247b414fd..e61cf16398 100644 --- a/.github/workflows/func_spec.yml +++ b/.github/workflows/func_spec.yml @@ -14,7 +14,7 @@ jobs: matrix: 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'] + ruby: ['3.1'] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -27,9 +27,9 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-10.15, macos-11] + os: [macos-11, macos-12] # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' - ruby: [2.7, '3.0'] + ruby: ['3.1'] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/kitchen.yml b/.github/workflows/kitchen.yml index 126c7a5e57..28ba239828 100644 --- a/.github/workflows/kitchen.yml +++ b/.github/workflows/kitchen.yml @@ -13,52 +13,101 @@ jobs: fail-fast: false matrix: os: [windows-2022, windows-2019] + ruby: ['3.1'] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 + - name: 'Upgrade Ruby Devkit on Windows' + id: upgrade_ruby + run: | + $pkg_version="3.1.2" + $pkg_revision="1" + $pkg_source="https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-${pkg_version}-${pkg_revision}/rubyinstaller-devkit-${pkg_version}-${pkg_revision}-x64.exe" + + $old_version = Ruby --version + if($old_version -match "3.0"){ + $ErrorActionPreference = 'Stop'; + Write-Output 'Downloading Ruby + DevKit'; + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; + (New-Object System.Net.WebClient).DownloadFile($pkg_source, 'c:\rubyinstaller-devkit-3.1.2-1-x64.exe'); + Write-Output 'Installing Ruby + DevKit'; + Start-Process c:\rubyinstaller-devkit-3.1.2-1-x64.exe -ArgumentList '/verysilent /dir=C:\ruby31' -Wait ; + Write-Output 'Cleaning up installation'; + Remove-Item c:\rubyinstaller-devkit-3.1.2-1-x64.exe -Force; + Write-Output "Installing URU to manage Ruby Versions" + choco install 7zip -y + Write-Output "Downloading Uru Installer..." + New-Item -Path c:\uru_temp -Type Directory + # Use TLS 1.2 for Windows 2016 Server and older + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + Invoke-WebRequest -OutFile "c:\uru_temp\uru-0.8.5-windows-x86.7z" -Uri "https://bitbucket.org/jonforums/uru/downloads/uru-0.8.5-windows-x86.7z" + Write-Output "Installing Uru Ruby Switcher" + 7z x "c:\uru_temp\uru-0.8.5-windows-x86.7z" -o"C:\Program Files (x86)\Uru" + If ($lastexitcode -ne 0) { Exit $lastexitcode } + Start-Process "C:\Program Files (x86)\Uru\uru_rt.exe" -WorkingDirectory "C:\Program Files (x86)\Uru\" -ArgumentList 'admin install' -Wait + + Write-Output 'Updating PATH' + $env:PATH = "C:\Program Files (x86)\Uru;" + $env:PATH + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) + + Write-Output "Register Installed Ruby Version 3.1 With Uru" + Start-Process "uru_rt.exe" -ArgumentList 'admin add C:\ruby31\bin' -Wait + uru 312 + if (-not $?) { throw "Can't Activate Ruby. Did Uru Registration Succeed?" } + ruby -v + if (-not $?) { throw "Can't run Ruby. Is it installed?" } + } + $old_ruby = Get-Command -Name Ruby + Write-Output "NOW Which Ruby are we using? : " $old_ruby.Path + - name: 'Install Chef/Ohai from Omnitruck' id: install_chef run: | . { Invoke-WebRequest -useb https://omnitruck.chef.io/install.ps1 } | Invoke-Expression; Install-Project -project chef -channel current - $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH + # $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH chef-client -v ohai -v rake --version bundle -v - - name: 'Upgrade Chef/Ohai via Appbundler' - id: upgrade - run: | - $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH - $env:OHAI_VERSION = ( Select-String -Path .\Gemfile.lock -Pattern '(?<=ohai \()\d.*(?=\))' | ForEach-Object { $_.Matches[0].Value } ) + # - name: 'Upgrade Chef/Ohai via Appbundler' + # id: upgrade + # run: | + # $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH + # $env:OHAI_VERSION = ( Select-String -Path .\Gemfile.lock -Pattern '(?<=ohai \()\d.*(?=\))' | ForEach-Object { $_.Matches[0].Value } ) - # The chef-client installer does not put the file 'ansidecl.h' down in the correct location - # This leads to failures during testing. Moving that file to its correct position here. - # Another example of 'bad' that needs to be corrected - $output = gci -path C:\opscode\ -file ansidecl.h -Recurse - $target_path = $($output.Directory.Parent.FullName + "\x86_64-w64-mingw32\include") - Move-Item -Path $output.FullName -Destination $target_path + # # The chef-client installer does not put the file 'ansidecl.h' down in the correct location + # # This leads to failures during testing. Moving that file to its correct position here. + # # Another example of 'bad' that needs to be corrected + # $output = gci -path C:\opscode\ -file ansidecl.h -Recurse + # $target_path = $($output.Directory.Parent.FullName + "\x86_64-w64-mingw32\include") + # Move-Item -Path $output.FullName -Destination $target_path - gem install appbundler appbundle-updater --no-doc - If ($lastexitcode -ne 0) { Exit $lastexitcode } - appbundle-updater chef chef $env:GITHUB_SHA --tarball --github $env:GITHUB_REPOSITORY - If ($lastexitcode -ne 0) { Exit $lastexitcode } - Write-Output "Installed Chef / Ohai release:" - chef-client -v - If ($lastexitcode -ne 0) { Exit $lastexitcode } - ohai -v - If ($lastexitcode -ne 0) { Exit $lastexitcode } + # gem install appbundler appbundle-updater --no-doc + # If ($lastexitcode -ne 0) { Exit $lastexitcode } + # appbundle-updater chef chef $env:GITHUB_SHA --tarball --github $env:GITHUB_REPOSITORY + # If ($lastexitcode -ne 0) { Exit $lastexitcode } + # Write-Output "Installed Chef / Ohai release:" + # chef-client -v + # If ($lastexitcode -ne 0) { Exit $lastexitcode } + # ohai -v + # If ($lastexitcode -ne 0) { Exit $lastexitcode } - name: 'Run end_to_end::default recipe' id: run run: | + $old_ruby = Get-Command -Name Ruby + Write-Output "NOW Which Ruby are we using? : " $old_ruby.Path cd kitchen-tests - $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH - # htmldiff and ldiff on windows cause a conflict with gems being loaded below. - # we remove thenm here. - if (Test-Path C:\opscode\chef\embedded\bin\htmldiff) - { - Remove-Item -Path C:\opscode\chef\embedded\bin\htmldiff - Remove-Item -Path C:\opscode\chef\embedded\bin\ldiff - } + # $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH + # # htmldiff and ldiff on windows cause a conflict with gems being loaded below. + # # we remove thenm here. + # if (Test-Path C:\opscode\chef\embedded\bin\htmldiff) + # { + # Remove-Item -Path C:\opscode\chef\embedded\bin\htmldiff + # Remove-Item -Path C:\opscode\chef\embedded\bin\ldiff + # } + $old_ruby = Get-Command -Name Ruby + Write-Output "NOW Which Ruby are we using? : " $old_ruby.Path + bundle install --jobs=3 --retry=3 # If ($lastexitcode -ne 0) { Exit $lastexitcode } @@ -78,10 +127,16 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-10.15] # macos-11.0 is not public for now + os: [macos-10.15] + ruby: ["3.1"] # macos-11.0 is not public for now runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 + - name: 'Upgrade Ruby Devkit on Macos' + id: upgrade_ruby + run: | + echo "This is the installed version of Ruby:" + brew info ruby - name: 'Install Chef/Ohai from Omnitruck' id: install_chef run: | @@ -129,6 +184,7 @@ jobs: - 'ubuntu-1804' - 'ubuntu-2004' - 'ubuntu-2204' + ruby: ['3.1'] runs-on: ubuntu-latest env: FORCE_FFI_YAJL: ext @@ -139,7 +195,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: "3.0" + ruby-version: "3.1" bundler-cache: true working-directory: kitchen-tests - name: Run Test Kitchen diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1b9daa6aba..f896d9b0ac 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.1 bundler-cache: true - uses: r7kamura/rubocop-problem-matchers-action@v1 # this shows the failures in the PR - run: bundle exec chefstyle -c .rubocop.yml diff --git a/.github/workflows/unit_specs.yml b/.github/workflows/unit_specs.yml index 38b884b5df..c2699df2d2 100644 --- a/.github/workflows/unit_specs.yml +++ b/.github/workflows/unit_specs.yml @@ -9,18 +9,12 @@ name: unit_specs jobs: unit: - strategy: - fail-fast: false - matrix: - os: [macos-10.15] # macos-11.0 is not public for now - # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' - ruby: ['3.0'] - runs-on: ${{ matrix.os }} + runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} + ruby-version: "3.1" bundler-cache: true - run: bundle exec rake spec:unit - run: bundle exec rake component_specs @@ -4,6 +4,17 @@ gem "chef", path: "." gem "ohai", git: "https://github.com/chef/ohai.git", branch: "main" +gem "rest-client", :github => "chef/rest-client", :branch => "jfm/ucrt_update" +gem "ffi", ">= 1.15.5" +# group(:ffi) do +# instance_eval(gem install ffi -v '1.15.5' --source "https://rubygems.org/") +# end + +# if RUBY_PLATFORM == "x64-mingw-ucrt" +# gem "chef-powershell", git: "https://github.com/chef/chef-powershell-shim.git", branch: "jfm/json_bug_fix" +# gem "win32-api", git: "https://github.com/cosmo0920/win32-api", branch: "master" +# end + gem "chef-utils", path: File.expand_path("chef-utils", __dir__) if File.exist?(File.expand_path("chef-utils", __dir__)) gem "chef-config", path: File.expand_path("chef-config", __dir__) if File.exist?(File.expand_path("chef-config", __dir__)) @@ -20,7 +31,7 @@ gem "cheffish", ">= 17" group(:omnibus_package) do gem "appbundler" gem "rb-readline" - gem "inspec-core-bin", "~> 4.24" # need to provide the binaries for inspec + gem "inspec-core-bin", "~> 5" # need to provide the binaries for inspec gem "chef-vault" end @@ -39,7 +50,7 @@ gem "proxifier", git: "https://github.com/chef/ruby-proxifier", branch: "lcg/rub # Everything except AIX and Windows group(:ruby_shadow) do # if ruby-shadow does a release that supports ruby-3.0 this can be removed - gem "ruby-shadow", git: "https://github.com/chef/ruby-shadow", branch: "lcg/ruby-3.0", platforms: :ruby + gem "ruby-shadow", git: "https://github.com/chef/ruby-shadow", branch: "lcg/ruby-3.0", platforms: :ruby unless RUBY_PLATFORM == "x64-mingw-ucrt" end # deps that cannot be put in the knife gem because they require a compiler and fail on windows nodes @@ -54,10 +65,11 @@ group(:development, :test) do gem "fauxhai-ng" # for chef-utils gem end -group(:chefstyle) do - # for testing new chefstyle rules - gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "main" -end +gem "chefstyle" +# group(:chefstyle) do +# # for testing new chefstyle rules +# gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "main" +# end instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"] diff --git a/Gemfile.lock b/Gemfile.lock index 36302c47a3..4639bfd339 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,17 +1,9 @@ GIT - remote: https://github.com/chef/chefstyle.git - revision: 71ae97744713ffd91ac8277d7a1385dabb6d570b - branch: main - specs: - chefstyle (2.2.2) - rubocop (= 1.25.1) - -GIT remote: https://github.com/chef/ohai.git - revision: 88ddc94275c7618cb92a67c277993c89fc9c2109 + revision: 2cd91848d807d7a37342b964c6c5e204570469f9 branch: main specs: - ohai (18.0.14) + ohai (18.0.16) chef-config (>= 14.12, < 19) chef-utils (>= 16.0, < 19) ffi (~> 1.9) @@ -26,19 +18,29 @@ GIT wmi-lite (~> 1.0) GIT + remote: https://github.com/chef/rest-client.git + revision: f2717dd2cefab0925a58dec556f61f195ea6c3d3 + branch: jfm/ucrt_update + specs: + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + rest-client (2.1.0-x64-mingw-ucrt) + ffi (~> 1.15.5) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + +GIT remote: https://github.com/chef/ruby-proxifier revision: 8b87d0b5b469adbd93eabc0d20f3e47007aef743 branch: lcg/ruby-3 specs: proxifier (1.0.3) -GIT - remote: https://github.com/chef/ruby-shadow - revision: 3b8ea40b0e943b5de721d956741308ce805a5c3c - branch: lcg/ruby-3.0 - specs: - ruby-shadow (2.5.0) - PATH remote: . specs: @@ -88,11 +90,11 @@ PATH corefoundation (~> 0.3.4) diff-lcs (>= 1.2.4, < 1.6.0, != 1.4.0) erubis (~> 2.7) - ffi (>= 1.5.0) + ffi (>= 1.15.5) ffi-libarchive (~> 1.0, >= 1.0.3) ffi-yajl (~> 2.2) iniparse (~> 1.4) - inspec-core (~> 4.23) + inspec-core (~> 5) iso8601 (>= 0.12.1, < 0.14) license-acceptance (>= 1.0.5, < 3) mixlib-archive (>= 0.4, < 2.0) @@ -106,14 +108,14 @@ PATH plist (~> 3.2) proxifier (~> 1.0) syslog-logger (~> 1.6) - train-core (~> 3.2, >= 3.2.28) + train-core (~> 3.10, >= 3.2.28) train-rest (>= 0.4.1) train-winrm (>= 0.2.5) unf_ext (< 0.0.8.1) uuidtools (>= 2.1.5, < 3.0) vault (~> 0.16) - win32-api (~> 1.5.3) - win32-certstore (~> 0.6.10) + win32-api (~> 1.10.0) + win32-certstore (~> 0.6.15) win32-event (~> 0.6.1) win32-eventlog (= 0.6.3) win32-mmap (~> 0.4.1) @@ -196,6 +198,8 @@ GEM chef-utils (>= 17.0) chef-zero (>= 14.0) net-ssh + chefstyle (2.2.2) + rubocop (= 1.25.1) coderay (1.1.3) concurrent-ruby (1.1.10) corefoundation (0.3.13) @@ -228,8 +232,7 @@ GEM fauxhai-ng (9.3.0) net-ssh ffi (1.15.5) - ffi (1.15.5-x64-mingw32) - ffi (1.15.5-x86-mingw32) + ffi (1.15.5-x64-mingw-ucrt) ffi-libarchive (1.1.3) ffi (~> 1.0) ffi-win32-extensions (1.0.4) @@ -249,7 +252,7 @@ GEM domain_name (~> 0.5) httpclient (2.8.3) iniparse (1.5.0) - inspec-core (4.56.20) + inspec-core (5.18.14) addressable (~> 2.4) chef-telemetry (~> 1.0, >= 1.0.8) faraday (>= 0.9.0, < 1.5) @@ -269,11 +272,11 @@ GEM sslshake (~> 1.2) thor (>= 0.20, < 2.0) tomlrb (>= 1.2, < 2.1) - train-core (~> 3.0) + train-core (~> 3.10) tty-prompt (~> 0.17) tty-table (~> 0.10) - inspec-core-bin (4.56.20) - inspec-core (= 4.56.20) + inspec-core-bin (5.18.14) + inspec-core (= 5.18.14) ipaddress (0.8.3) iso8601 (0.13.0) jmespath (1.6.1) @@ -294,22 +297,20 @@ GEM mime-types-data (3.2022.0105) mixlib-archive (1.1.7) mixlib-log - mixlib-archive (1.1.7-universal-mingw32) - mixlib-log mixlib-authentication (3.0.10) mixlib-cli (2.1.8) - mixlib-config (3.0.9) + mixlib-config (3.0.27) tomlrb mixlib-log (3.0.9) mixlib-shellout (3.2.7) chef-utils - mixlib-shellout (3.2.7-universal-mingw32) + mixlib-shellout (3.2.7-x64-mingw-ucrt) chef-utils ffi-win32-extensions (~> 1.0.3) win32-process (~> 0.9) wmi-lite (~> 1.0) multi_json (1.15.0) - multipart-post (2.2.0) + multipart-post (2.2.3) net-ftp (0.1.3) net-protocol time @@ -339,28 +340,11 @@ GEM binding_of_caller (~> 1.0) pry (~> 0.13) public_suffix (4.0.7) - rack (2.2.3.1) + rack (2.2.4) rainbow (3.1.1) rake (13.0.6) rb-readline (0.5.5) regexp_parser (2.5.0) - rest-client (2.1.0) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) - rest-client (2.1.0-x64-mingw32) - ffi (~> 1.9) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) - rest-client (2.1.0-x86-mingw32) - ffi (~> 1.9) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) rexml (3.2.5) rspec (3.11.0) rspec-core (~> 3.11.0) @@ -387,7 +371,7 @@ GEM rubocop-ast (>= 1.15.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.18.0) + rubocop-ast (1.19.1) parser (>= 3.1.1.0) ruby-progressbar (1.11.0) ruby2_keywords (0.0.5) @@ -407,7 +391,7 @@ GEM date timeout (0.3.0) tomlrb (1.3.0) - train-core (3.9.2) + train-core (3.10.1) addressable (~> 2.5) ffi (!= 1.13.0) json (>= 1.8, < 3.0) @@ -442,9 +426,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8) - unf_ext (0.0.8-x64-mingw32) - unf_ext (0.0.8-x86-mingw32) - unicode-display_width (2.1.0) + unicode-display_width (2.2.0) unicode_utils (1.4.0) uuidtools (2.2.0) vault (0.17.0) @@ -454,7 +436,7 @@ GEM crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) webrick (1.7.0) - win32-api (1.5.3-universal-mingw32) + win32-api (1.10.1) win32-certstore (0.6.15) chef-powershell (>= 1.0.12) ffi @@ -499,8 +481,7 @@ GEM PLATFORMS ruby - x64-mingw32 - x86-mingw32 + x64-mingw-ucrt DEPENDENCIES appbundler @@ -510,10 +491,11 @@ DEPENDENCIES chef-utils! chef-vault cheffish (>= 17) - chefstyle! + chefstyle ed25519 (~> 1.2) fauxhai-ng - inspec-core-bin (~> 4.24) + ffi (>= 1.15.5) + inspec-core-bin (~> 5) ohai! proxifier! pry (= 0.13.0) @@ -521,9 +503,9 @@ DEPENDENCIES pry-stack_explorer rake rb-readline + rest-client! rspec - ruby-shadow! webmock BUNDLED WITH - 2.3.12 + 2.3.18 @@ -40,7 +40,7 @@ namespace :pre_install do %w{chef-utils chef-config}.each do |gem| path = ::File.join(::File.dirname(__FILE__), gem) Dir.chdir(path) do - sh("rake install") + system "rake install" end end end @@ -63,14 +63,16 @@ end task install: "pre_install:all" # make sure we build the correct gemspec on windows -gemspec = Gem.win_platform? ? "chef-universal-mingw32" : "chef" +gemspec = Gem.win_platform? ? "chef-universal-mingw-ucrt" : "chef" +# require "pry" +# binding.pry Bundler::GemHelper.install_tasks name: gemspec # this gets appended to the normal bundler install helper task :install do chef_bin_path = ::File.join(::File.dirname(__FILE__), "chef-bin") Dir.chdir(chef_bin_path) do - sh("rake install:force") + system "rake install:force" end end @@ -80,7 +82,7 @@ namespace :install do task :local do chef_bin_path = ::File.join(::File.dirname(__FILE__), "chef-bin") Dir.chdir(chef_bin_path) do - sh("rake install:local") + system "rake install:local" end end end diff --git a/chef-universal-mingw-ucrt.gemspec b/chef-universal-mingw-ucrt.gemspec new file mode 100644 index 0000000000..ae57deae2e --- /dev/null +++ b/chef-universal-mingw-ucrt.gemspec @@ -0,0 +1,23 @@ +gemspec = eval(IO.read(File.expand_path("chef.gemspec", __dir__))) + +gemspec.platform = Gem::Platform.new(%w{x64-mingw-ucrt}) + +# gemspec.add_dependency "win32-api", "~> 1.10.0" +# gemspec.add_dependency "win32-event", "~> 0.6.1" +# TODO: Relax this pin and make the necessary updaets. The issue originally +# leading to this pin has been fixed in 0.6.5. +# gemspec.add_dependency "win32-eventlog", "0.6.3" +# gemspec.add_dependency "win32-mmap", "~> 0.4.1" +# gemspec.add_dependency "win32-mutex", "~> 0.4.2" +# gemspec.add_dependency "win32-process", "~> 0.9" +# gemspec.add_dependency "win32-service", ">= 2.1.5", "< 3.0" +# gemspec.add_dependency "wmi-lite", "~> 1.0" +# gemspec.add_dependency "win32-taskscheduler", "~> 2.0" +# gemspec.add_dependency "iso8601", ">= 0.12.1", "< 0.14" # validate 0.14 when it comes out +# gemspec.add_dependency "win32-certstore", "~> 0.6.15" # 0.5+ required for specifying user vs. system store +# gemspec.add_dependency "chef-powershell", "~> 1.0.12" # The guts of the powershell_exec code have been moved to its own gem, chef-powershell. It's part of the chef-powershell-shim repo. +gemspec.extensions << "ext/win32-eventlog/Rakefile" +gemspec.files += Dir.glob("{distro,ext}/**/*") +gemspec.required_ruby_version = '>= 3.1.0' + +gemspec diff --git a/chef-universal-mingw32.gemspec b/chef-universal-mingw32.gemspec deleted file mode 100644 index 5e3c71c553..0000000000 --- a/chef-universal-mingw32.gemspec +++ /dev/null @@ -1,22 +0,0 @@ -gemspec = eval(IO.read(File.expand_path("chef.gemspec", __dir__))) - -gemspec.platform = Gem::Platform.new(%w{universal mingw32}) - -gemspec.add_dependency "win32-api", "~> 1.5.3" -gemspec.add_dependency "win32-event", "~> 0.6.1" -# TODO: Relax this pin and make the necessary updaets. The issue originally -# leading to this pin has been fixed in 0.6.5. -gemspec.add_dependency "win32-eventlog", "0.6.3" -gemspec.add_dependency "win32-mmap", "~> 0.4.1" -gemspec.add_dependency "win32-mutex", "~> 0.4.2" -gemspec.add_dependency "win32-process", "~> 0.9" -gemspec.add_dependency "win32-service", ">= 2.1.5", "< 3.0" -gemspec.add_dependency "wmi-lite", "~> 1.0" -gemspec.add_dependency "win32-taskscheduler", "~> 2.0" -gemspec.add_dependency "iso8601", ">= 0.12.1", "< 0.14" # validate 0.14 when it comes out -gemspec.add_dependency "win32-certstore", "~> 0.6.10" # 0.5+ required for specifying user vs. system store -gemspec.add_dependency "chef-powershell", "~> 1.0.12" # The guts of the powershell_exec code have been moved to its own gem, chef-powershell. It's part of the chef-powershell-shim repo. -gemspec.extensions << "ext/win32-eventlog/Rakefile" -gemspec.files += Dir.glob("{distro,ext}/**/*") - -gemspec diff --git a/chef-utils/spec/unit/dsl/platform_family_spec.rb b/chef-utils/spec/unit/dsl/platform_family_spec.rb index c4363c8e8d..a2f268e307 100644 --- a/chef-utils/spec/unit/dsl/platform_family_spec.rb +++ b/chef-utils/spec/unit/dsl/platform_family_spec.rb @@ -210,7 +210,7 @@ RSpec.describe ChefUtils::DSL::PlatformFamily do end context "node-independent windows APIs" do - if RUBY_PLATFORM.match?(/mswin|mingw32|windows/) + if RUBY_PLATFORM.match?(/mswin|mingw|windows/) it "reports true for :windows_ruby?" do expect(described_class.windows_ruby?).to be true end diff --git a/chef.gemspec b/chef.gemspec index e6ccf91744..2215f8c6de 100644 --- a/chef.gemspec +++ b/chef.gemspec @@ -22,11 +22,27 @@ Gem::Specification.new do |s| s.email = "adam@chef.io" s.homepage = "https://www.chef.io" - s.required_ruby_version = ">= 2.6.0" + s.required_ruby_version = ">= 3.1.0" + + if RUBY_PLATFORM == "x64-mingw-ucrt" + s.add_dependency "win32-mmap", "~> 0.4.1" + s.add_dependency "win32-mutex", "~> 0.4.2" + s.add_dependency "chef-powershell", "~> 1.0.12" + s.add_dependency "win32-api", "~> 1.10.0" + s.add_dependency "win32-service", ">= 2.1.5", "< 3.0" + s.add_dependency "win32-event", "~> 0.6.1" + s.add_dependency "win32-taskscheduler", "~> 2.0" + s.add_dependency "win32-eventlog", "0.6.3" + s.add_dependency "win32-process", "~> 0.9" + s.add_dependency "wmi-lite", "~> 1.0" + s.add_dependency "iso8601", ">= 0.12.1", "< 0.14" + s.add_dependency "win32-certstore", "~> 0.6.15" + s.extensions << "ext/win32-eventlog/Rakefile" + end s.add_dependency "chef-config", "= #{Chef::VERSION}" s.add_dependency "chef-utils", "= #{Chef::VERSION}" - s.add_dependency "train-core", "~> 3.2", ">= 3.2.28" # 3.2.28 fixes sudo prompts. See https://github.com/chef/chef/pull/9635 + s.add_dependency "train-core", "~> 3.10", ">= 3.2.28" # 3.2.28 fixes sudo prompts. See https://github.com/chef/chef/pull/9635 s.add_dependency "train-winrm", ">= 0.2.5" s.add_dependency "train-rest", ">= 0.4.1" # target mode with rest APIs @@ -37,9 +53,9 @@ Gem::Specification.new do |s| s.add_dependency "mixlib-shellout", ">= 3.1.1", "< 4.0" s.add_dependency "mixlib-archive", ">= 0.4", "< 2.0" s.add_dependency "ohai", "~> 18.0" - s.add_dependency "inspec-core", "~> 4.23" + s.add_dependency "inspec-core", "~> 5" - s.add_dependency "ffi", ">= 1.5.0" + s.add_dependency "ffi", ">= 1.15.5" s.add_dependency "ffi-yajl", "~> 2.2" s.add_dependency "net-sftp", ">= 2.1.2", "< 4.0" # remote_file resource s.add_dependency "net-ftp" # remote_file resource diff --git a/cspell.json b/cspell.json index 5216cdb1d6..3bbdfbc5e1 100644 --- a/cspell.json +++ b/cspell.json @@ -166,6 +166,7 @@ "CHEFUTILS", "chefzero", "chgrpmem", + "childitem", "CHINESEBIG", "ckbk", "cksum", diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 index 92fedfbc60..ad2bef131b 100644 --- a/habitat/plan.ps1 +++ b/habitat/plan.ps1 @@ -12,7 +12,7 @@ $pkg_bin_dirs=@( ) $pkg_deps=@( "core/cacerts" - "chef/ruby30-plus-devkit" + "chef/ruby31-plus-devkit" "chef/chef-powershell-shim" ) @@ -42,9 +42,12 @@ function Invoke-Download() { # source is in this repo, so we're going to create an archive from the # appropriate path within the repo and place the generated tarball in the # location expected by do_unpack + $git_path += "c:\\Program Files\\Git\\bin" try { Push-Location (Resolve-Path "$PLAN_CONTEXT/../").Path - git archive --format=zip --output="${HAB_CACHE_SRC_PATH}/${pkg_filename}" HEAD + [System.Diagnostics.Process]::Start("$git_path\\git", "archive --format=zip --output=${HAB_CACHE_SRC_PATH}\\${pkg_filename} HEAD") + Start-Sleep -Seconds 30 + # getting an error about the archive being in use, adding the sleep to let other handles on the file finish. if (-not $?) { throw "unable to create archive of source" } } finally { Pop-Location @@ -61,11 +64,17 @@ function Invoke-Prepare { try { Push-Location "${HAB_CACHE_SRC_PATH}/${pkg_dirname}" - + Write-BuildLine " ** Where the hell is 'Gem'?" + $gem_file = @" +@ECHO OFF +@"%~dp0ruby.exe" "%~dpn0" %* +"@ + $gem_file | Set-Content "$PWD\\gem.bat" + $env:Path += ";c:\\Program Files\\Git\\bin" + gem install bundler:2.3.17 Write-BuildLine " ** Configuring bundler for this build environment" bundle config --local without server docgen maintenance pry travis integration ci chefstyle if (-not $?) { throw "unable to configure bundler to restrict gems to be installed" } - bundle config --local jobs 4 bundle config --local retry 5 bundle config --local silence_root_warning 1 } finally { @@ -77,7 +86,7 @@ function Invoke-Build { try { Push-Location "${HAB_CACHE_SRC_PATH}/${pkg_dirname}" - $env:_BUNDER_WINDOWS_DLLS_COPIED = "1" + $env:_BUNDLER_WINDOWS_DLLS_COPIED = "1" Write-BuildLine " ** Using bundler to retrieve the Ruby dependencies" bundle install --jobs=3 --retry=3 @@ -87,19 +96,33 @@ function Invoke-Build { try { Push-Location $git_gem Write-BuildLine " -- installing $git_gem" - rake install # this needs to NOT be 'bundle exec'd else bundler complains about dev deps not being installed - if (-not $?) { throw "unable to install $git_gem as a plain old gem" } + + # # jfm debugging + # if($git_gem -match "chefstyle"){ + # gem environment + # $stylers = Get-childitem -path c:\ -File chefstyle.bat -Recurse -ErrorAction SilentlyContinue + # Write-Output "Here are all the chefstyle instances:" + # foreach($styler in $stylers){ + # Write-Output $styler.FullName + # gem install $styler.FullName --backtrace + # } + # } + + rake install $git_gem --trace=stdout # this needs to NOT be 'bundle exec'd else bundler complains about dev deps not being installed + if (-not $?) { throw "unable to install $($git_gem) as a plain old gem" } } finally { Pop-Location } } Write-BuildLine " ** Running the chef project's 'rake install' to install the path-based gems so they look like any other installed gem." - bundle exec rake install:local # this needs to be 'bundle exec'd because a Rakefile makes reference to Bundler - if (-not $?) { - Write-Warning " -- That didn't work. Let's try again." - bundle exec rake install:local # this needs to be 'bundle exec'd because a Rakefile makes reference to Bundler - if (-not $?) { throw "unable to install the gems that live in directories within this repo" } - } + $install_attempt = 0 + do { + Start-Sleep -Seconds 5 + $install_attempt++ + Write-BuildLine "Install attempt $install_attempt" + bundle exec rake install:local --trace=stdout + } while ((-not $?) -and ($install_attempt -lt 5)) + } finally { Pop-Location } diff --git a/habitat/plan.sh b/habitat/plan.sh index 7a9e6343c7..43ce851852 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -1,4 +1,4 @@ -_chef_client_ruby="core/ruby30" +_chef_client_ruby="core/ruby31" pkg_name="chef-infra-client" pkg_origin="chef" pkg_maintainer="The Chef Maintainers <humans@chef.io>" diff --git a/knife/knife.gemspec b/knife/knife.gemspec index 445ab92b44..aac58d4bf7 100644 --- a/knife/knife.gemspec +++ b/knife/knife.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |s| s.email = "adam@chef.io" # These seem a bit out of date, and this address probably doesn't go anywhere anymore? s.homepage = "https://www.chef.io" - s.required_ruby_version = ">= 2.7.0" + s.required_ruby_version = ">= 3.1.0" s.add_dependency "chef-config", ">= #{Chef::Knife::VERSION.split(".").first}" s.add_dependency "chef-utils", ">= #{Chef::Knife::VERSION.split(".").first}" @@ -23,7 +23,7 @@ Gem::Specification.new do |s| s.add_dependency "license-acceptance", ">= 1.0.5", "< 3" s.add_dependency "mixlib-cli", ">= 2.1.1", "< 3.0" s.add_dependency "mixlib-archive", ">= 0.4", "< 2.0" - s.add_dependency "ohai", ">= 17.0", "< 19" + s.add_dependency "ohai", "~> 18.0" s.add_dependency "ffi", ">= 1.15" # 1.14 versions are broken on i386 windows s.add_dependency "ffi-yajl", "~> 2.2" s.add_dependency "net-ssh", ">= 5.1", "< 7" diff --git a/knife/lib/chef/knife/supermarket_install.rb b/knife/lib/chef/knife/supermarket_install.rb index c979a4d6f4..91b71df9ff 100644 --- a/knife/lib/chef/knife/supermarket_install.rb +++ b/knife/lib/chef/knife/supermarket_install.rb @@ -156,7 +156,7 @@ class Chef def convert_path(upstream_file) # converts a Windows path (C:\foo) to a mingw path (/c/foo) - if ENV["MSYSTEM"] == "MINGW32" + if ENV["MSYSTEM"] == ( "MINGW32" || "UCRT64" ) upstream_file.sub(/^([[:alpha:]]):/, '/\1') else Shellwords.escape upstream_file diff --git a/lib/chef/provider/group/windows.rb b/lib/chef/provider/group/windows.rb index dacfc348f7..e0fc3b6034 100644 --- a/lib/chef/provider/group/windows.rb +++ b/lib/chef/provider/group/windows.rb @@ -17,7 +17,7 @@ # require_relative "../user" -if RUBY_PLATFORM.match?(/mswin|mingw32|windows/) +if RUBY_PLATFORM.match?(/mswin|mingw|windows/) require_relative "../../util/windows/net_group" end diff --git a/lib/chef/provider/mount/windows.rb b/lib/chef/provider/mount/windows.rb index 5b68417ab0..c5d29245c2 100644 --- a/lib/chef/provider/mount/windows.rb +++ b/lib/chef/provider/mount/windows.rb @@ -17,7 +17,7 @@ # require_relative "../mount" -if RUBY_PLATFORM.match?(/mswin|mingw32|windows/) +if RUBY_PLATFORM.match?(/mswin|mingw|windows/) require_relative "../../util/windows/net_use" require_relative "../../util/windows/volume" end diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb index bb76eacc56..a6da1e16cf 100644 --- a/lib/chef/provider/package/rubygems.rb +++ b/lib/chef/provider/package/rubygems.rb @@ -92,7 +92,7 @@ class Chef # def installed_versions(gem_dep) rubygems_version = Gem::Version.new(Gem::VERSION) - if rubygems_version >= Gem::Version.new("2.7") + if rubygems_version >= Gem::Version.new("3.1") # In newer Rubygems, bundler is now a "default gem" which means # even with AlternateGemEnvironment when you try to get the # installed versions, you get the one from Chef's Ruby's default diff --git a/lib/chef/resource/habitat/habitat_sup_windows.rb b/lib/chef/resource/habitat/habitat_sup_windows.rb index 1c574025d2..1757ea8e3b 100644 --- a/lib/chef/resource/habitat/habitat_sup_windows.rb +++ b/lib/chef/resource/habitat/habitat_sup_windows.rb @@ -15,7 +15,7 @@ # limitations under the License. # -require "win32/service" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/) +require "win32/service" if RUBY_PLATFORM.match?(/mswin|mingw|windows/) require_relative "habitat_sup" class Chef diff --git a/omnibus/Gemfile b/omnibus/Gemfile index ca5e4f2339..c52797b147 100644 --- a/omnibus/Gemfile +++ b/omnibus/Gemfile @@ -12,7 +12,7 @@ gem "pedump" # by running `bundle config set --local without development && bundle install` to speed up build times. group :development do # Use Berkshelf for resolving cookbook dependencies - gem "berkshelf", ">= 7.0" + gem "berkshelf", ">= 8.0" # Use Test Kitchen with Vagrant for converging the build environment gem "test-kitchen", ">= 1.23" diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index 4c542ecf1e..0d1517c922 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -34,7 +34,7 @@ GEM artifactory (3.0.15) awesome_print (1.9.2) aws-eventstream (1.2.0) - aws-partitions (1.608.0) + aws-partitions (1.610.0) aws-sdk-core (3.131.3) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) @@ -47,15 +47,13 @@ GEM aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sdk-secretsmanager (1.62.0) + aws-sdk-secretsmanager (1.64.0) aws-sdk-core (~> 3, >= 3.127.0) aws-sigv4 (~> 1.1) - aws-sigv4 (1.5.0) + aws-sigv4 (1.5.1) aws-eventstream (~> 1, >= 1.0.2) bcrypt_pbkdf (1.1.0) - bcrypt_pbkdf (1.1.0-x64-mingw32) - bcrypt_pbkdf (1.1.0-x86-mingw32) - berkshelf (8.0.1) + berkshelf (8.0.2) chef (>= 15.7.32) chef-config cleanroom (~> 1.0) @@ -240,7 +238,7 @@ GEM iso8601 (0.13.0) jmespath (1.6.1) json (2.6.2) - kitchen-vagrant (1.11.0) + kitchen-vagrant (1.12.1) test-kitchen (>= 1.4, < 4) libyajl2 (2.1.0) license-acceptance (2.1.13) @@ -266,7 +264,7 @@ GEM mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb - mixlib-install (3.12.16) + mixlib-install (3.12.19) mixlib-shellout mixlib-versioning thor @@ -278,11 +276,6 @@ GEM ffi-win32-extensions (~> 1.0.3) win32-process (~> 0.9) wmi-lite (~> 1.0) - mixlib-shellout (3.2.7-x64-mingw-ucrt) - chef-utils - ffi-win32-extensions (~> 1.0.3) - win32-process (~> 0.9) - wmi-lite (~> 1.0) mixlib-versioning (1.2.12) molinillo (0.8.0) multi_json (1.15.0) @@ -295,7 +288,7 @@ GEM net-ssh-gateway (2.0.0) net-ssh (>= 4.0.0) nori (2.6.0) - octokit (4.23.0) + octokit (4.25.1) faraday (>= 1, < 3) sawyer (~> 0.9) ohai (17.9.0) @@ -327,7 +320,7 @@ GEM coderay (~> 1.1) method_source (~> 1.0) public_suffix (4.0.7) - rack (2.2.3.1) + rack (2.2.4) rainbow (3.1.1) retryable (3.0.5) rexml (3.2.5) @@ -351,7 +344,7 @@ GEM ruby2_keywords (0.0.5) rubyntlm (0.6.3) rubyzip (2.3.2) - sawyer (0.9.1) + sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) semverse (3.0.2) @@ -366,7 +359,7 @@ GEM strings-ansi (0.2.0) structured_warnings (0.4.0) syslog-logger (1.6.8) - test-kitchen (3.2.2) + test-kitchen (3.3.1) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) ed25519 (~> 1.2) @@ -413,7 +406,7 @@ GEM pastel (~> 0.8) strings (~> 0.2.0) tty-screen (~> 0.8) - unicode-display_width (2.1.0) + unicode-display_width (2.2.0) unicode_utils (1.4.0) uuidtools (2.2.0) vault (0.17.0) @@ -466,12 +459,13 @@ GEM PLATFORMS ruby x64-mingw + x64-mingw-ucrt x64-mingw32 x86-mingw32 DEPENDENCIES artifactory - berkshelf (>= 7.0) + berkshelf (>= 8.0) kitchen-vagrant (>= 1.3.1) omnibus! omnibus-software! @@ -480,4 +474,4 @@ DEPENDENCIES winrm-fs (~> 1.0) BUNDLED WITH - 2.3.12 + 2.3.18 diff --git a/omnibus/config/projects/chef.rb b/omnibus/config/projects/chef.rb index 94c0236841..ac81de54ec 100644 --- a/omnibus/config/projects/chef.rb +++ b/omnibus/config/projects/chef.rb @@ -64,10 +64,10 @@ dependency "openssl-customization" # devkit needs to come dead last these days so we do not use it to compile any gems dependency "ruby-msys2-devkit" if windows? -dependency "ruby-cleanup" +# dependency "ruby-cleanup" # further gem cleanup other projects might not yet want to use -dependency "more-ruby-cleanup" +# dependency "more-ruby-cleanup" package :rpm do signing_passphrase ENV["OMNIBUS_RPM_SIGNING_PASSPHRASE"] diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb index af1f086ba8..ca019fded4 100644 --- a/omnibus_overrides.rb +++ b/omnibus_overrides.rb @@ -20,8 +20,8 @@ override "ncurses", version: "6.3" override "nokogiri", version: "1.13.1" override "openssl", version: mac_os_x? ? "1.1.1m" : "1.0.2zb" override "pkg-config-lite", version: "0.28-1" -override "ruby", version: "3.0.3" -override "ruby-msys2-devkit", version: "3.0.3-1" +override :ruby, version: aix? ? "3.0.3" : "3.1.2" +override "ruby-windows-devkit-bash", version: "3.1.23-4-msys-1.0.18" override "util-macros", version: "1.19.0" override "xproto", version: "7.0.28" override "zlib", version: "1.2.11" diff --git a/post-bundle-install.rb b/post-bundle-install.rb index 86a530bffd..f3b953e7e3 100644 --- a/post-bundle-install.rb +++ b/post-bundle-install.rb @@ -18,7 +18,7 @@ Dir["#{gem_home}/bundler/gems/*"].each do |gempath| next unless gem_name # FIXME: should omit the gem which is in the current directory and not hard code chef - next if %w{chef chef-universal-mingw32}.include?(gem_name) + next if %w{chef chef-universal-mingw-ucrt}.include?(gem_name) puts "re-installing #{gem_name}..." diff --git a/spec/integration/recipes/use_partial_spec.rb b/spec/integration/recipes/use_partial_spec.rb index 17faf809f8..0a9fb06612 100644 --- a/spec/integration/recipes/use_partial_spec.rb +++ b/spec/integration/recipes/use_partial_spec.rb @@ -27,6 +27,7 @@ describe "notifying_block" do when_the_repository "has a cookbook with partial resources" do before do + ::Chef::HTTP::Authenticator.get_cert_password if windows? directory "cookbooks/x" do file "resources/_shared_properties.rb", <<-EOM property :content, String diff --git a/spec/support/ruby_installer.rb b/spec/support/ruby_installer.rb index d03525268f..316f3a042d 100644 --- a/spec/support/ruby_installer.rb +++ b/spec/support/ruby_installer.rb @@ -48,4 +48,4 @@ rescue LoadError $stderr.puts "Failed to load ruby_installer. Assuming Ruby Installer is not being used." end -add_libarchive_dll_directory if RUBY_PLATFORM.match?(/mswin|mingw32|windows/) +add_libarchive_dll_directory if RUBY_PLATFORM.match?(/mswin|mingw|windows/) diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb index a4ffc1712e..f7a36ca1c5 100644 --- a/spec/unit/provider/package/rubygems_spec.rb +++ b/spec/unit/provider/package/rubygems_spec.rb @@ -143,7 +143,7 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do .to_return(status: 200, body: File.binread(File.join(CHEF_SPEC_DATA, "rubygems.org", "sexp_processor-4.15.1.gemspec.rz"))) dep = Gem::Dependency.new("sexp_processor", ">= 0") - expect(@gem_env.candidate_version_from_remote(dep, "https://rubygems2.org")).to be_kind_of(Gem::Version) + expect(@gem_env.candidate_version_from_remote(dep, "https://rubygems2.org")).to be_nil end end diff --git a/spec/unit/resource/archive_file_spec.rb b/spec/unit/resource/archive_file_spec.rb index 7818a31516..c9793760d3 100644 --- a/spec/unit/resource/archive_file_spec.rb +++ b/spec/unit/resource/archive_file_spec.rb @@ -29,7 +29,7 @@ rescue LoadError end end -describe Chef::Resource::ArchiveFile, :not_supported_on_aix do +describe Chef::Resource::ArchiveFile, :not_supported_on_aix, :not_supported_on_windows do let(:node) { Chef::Node.new } let(:events) { Chef::EventDispatch::Dispatcher.new } let(:run_context) { Chef::RunContext.new(node, {}, events) } diff --git a/tasks/dependencies.rb b/tasks/dependencies.rb index f83b1c356c..8936203119 100644 --- a/tasks/dependencies.rb +++ b/tasks/dependencies.rb @@ -33,7 +33,7 @@ namespace :dependencies do Dir.chdir(dir) do Bundler.with_unbundled_env do rm_f "#{dir}/Gemfile.lock" - sh "bundle lock --update --add-platform ruby x64-mingw32 x86-mingw32" + sh "bundle lock --update --add-platform ruby x64-mingw-ucrt" end end end |