Skip to content

Commit

Permalink
Merge pull request #661 from puppetlabs/CONT-934-puppet_8
Browse files Browse the repository at this point in the history
(CONT-934) Prep for Puppet 8 and Ruby 3
  • Loading branch information
david22swan authored Jun 6, 2023
2 parents 7363fb7 + 4a8cfcc commit 872864a
Show file tree
Hide file tree
Showing 23 changed files with 309 additions and 131 deletions.
6 changes: 3 additions & 3 deletions configs/components/rubygem-addressable.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
component 'rubygem-addressable' do |pkg, _settings, _platform|
pkg.version '2.8.1'
pkg.md5sum '64cb545a6ddcfc93c68fe53ac594c5f7'
component "rubygem-addressable" do |pkg, settings, platform|
pkg.version "2.8.1"
pkg.sha256sum "bc724a176ef02118c8a3ed6b5c04c39cf59209607ffcce77b91d0261dbadedfa"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
17 changes: 17 additions & 0 deletions configs/components/rubygem-bundler.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
component "rubygem-bundler" do |pkg, settings, _platform|
pkg.version '2.3.26'
pkg.sha256sum '1ee53cdf61e728ad82c6dbff06cfcd8551d5422e88e86203f0e2dbe9ae999e09'

instance_eval File.read('configs/components/_base-rubygem.rb')

pkg.install do
install_commands = []
install_commands << "#{settings[:gem_install]} bundler-#{pkg.get_version}.gem"

settings[:additional_rubies].each do |_rubyver, local_settings|
install_commands << "#{local_settings[:gem_install]} bundler-#{pkg.get_version}.gem"
end

install_commands
end
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-childprocess.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-childprocess" do |pkg, settings, platform|
pkg.version "4.1.0"
pkg.sha256sum '3616ce99ccb242361ce7f2b19bf9ff3e6bc1d98b927c7edc29af8ca617ba6cd3'

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 3 additions & 3 deletions configs/components/rubygem-cri.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
component 'rubygem-cri' do |pkg, settings, platform|
pkg.version '2.15.11'
pkg.md5sum '98e0ce55d289f9aed97ee11c5ba83010'
component "rubygem-cri" do |pkg, settings, platform|
pkg.version "2.15.11"
pkg.sha256sum "254320ef42198cf2670b36dbdd67aa8f8c177e7f058ce176f995a4ada47d1aae"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-diff-lcs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-diff-lcs" do |pkg, settings, platform|
pkg.version "1.5.0"
pkg.sha256sum "49b934001c8c6aedb37ba19daec5c634da27b318a7a3c654ae979d6ba1929b67"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-hitimes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-hitimes" do |pkg, settings, platform|
pkg.version "2.0.0"
pkg.sha256sum "0e8bc5829251bb43be3a44e5510dfd4d5cc4fae5112bf1d1b091679dd3cda947"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-json-schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-json-schema" do |pkg, settings, platform|
pkg.version "4.0.0"
pkg.sha256sum "a3bfe5fa1ad9771f0637a7c339a598b8b258343c49a1110988288e04f4f3b994"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-json_pure.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-json_pure" do |pkg, settings, platform|
pkg.version "2.6.3"
pkg.sha256sum 'c39185aa41c04a1933b8d66d1294224743262ee6881adc7b5a488ab2ae19c74e'

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-pastel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-pastel" do |pkg, settings, platform|
pkg.version "0.8.0"
pkg.sha256sum '481da9fb7d2f6e6b1a08faf11fa10363172dc40fd47848f096ae21209f805a75'

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-pathspec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-pathspec" do |pkg, settings, platform|
pkg.version "1.1.3"
pkg.sha256sum "c4e7ff4c4019499488874e21c37a1e2473d5123cfce6f13ecb07f42c0f8c5d23"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
2 changes: 1 addition & 1 deletion configs/components/rubygem-public_suffix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
pkg.md5sum '504e45c1f5f7b629e46e4deef7d0f46f'

instance_eval File.read('configs/components/_base-rubygem.rb')
end
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-tty-color.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-tty-color" do |pkg, settings, platform|
pkg.version "0.6.0"
pkg.sha256sum '6f9c37ca3a4e2367fb2e6d09722762647d6f455c111f05b59f35730eeb24332a'

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-tty-cursor.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-tty-cursor" do |pkg, settings, platform|
pkg.version "0.7.1"
pkg.sha256sum "79534185e6a777888d88628b14b6a1fdf5154a603f285f80b1753e1908e0bf48"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-tty-prompt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-tty-prompt" do |pkg, settings, platform|
pkg.version "0.23.1"
pkg.sha256sum "fcdbce905238993f27eecfdf67597a636bc839d92192f6a0eef22b8166449ec8"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-tty-reader.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-tty-reader" do |pkg, settings, platform|
pkg.version "0.9.0"
pkg.sha256sum 'c62972c985c0b1566f0e56743b6a7882f979d3dc32ff491ed490a076f899c2b1'

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-tty-screen.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-tty-screen" do |pkg, settings, platform|
pkg.version "0.8.1"
pkg.sha256sum '6508657c38f32bdca64880abe201ce237d80c94146e1f9b911cba3c7823659a2'

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-tty-spinner.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-tty-spinner" do |pkg, settings, platform|
pkg.version "0.9.3"
pkg.sha256sum "0e036f047b4ffb61f2aa45f5a770ec00b4d04130531558a94bfc5b192b570542"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-tty-which.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-tty-which" do |pkg, settings, platform|
pkg.version "0.5.0"
pkg.sha256sum "5824055f0d6744c97e7c4426544f01d519c40d1806ef2ef47d9854477993f466"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
6 changes: 6 additions & 0 deletions configs/components/rubygem-wisper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
component "rubygem-wisper" do |pkg, settings, platform|
pkg.version "2.0.1"
pkg.sha256sum "ce17bc5c3a166f241a2e6613848b025c8146fce2defba505920c1d1f3f88fae6"

instance_eval File.read('configs/components/_base-rubygem.rb')
end
9 changes: 9 additions & 0 deletions configs/components/runtime-pdk.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This component exists to link in the gcc and stdc++ runtime libraries.
component "runtime-pdk" do |pkg, settings, platform|
pkg.build_requires "libffi"
pkg.build_requires "libyaml"

if platform.is_windows?
lib_type = platform.architecture == "x64" ? "seh" : "sjlj"
["libgcc_s_#{lib_type}-1.dll", 'libstdc++-6.dll', 'libwinpthread-1.dll'].each do |dll|
Expand All @@ -18,6 +21,11 @@
pkg.install_file "#{settings[:tools_root]}/bin/libiconv-2.dll", "#{settings[:ruby_bindir]}/libiconv-2.dll"
pkg.install_file "#{settings[:tools_root]}/bin/libffi-6.dll", "#{settings[:ruby_bindir]}/libffi-6.dll"

if settings[:ruby_major_version] >= 3
pkg.install_file "#{settings[:bindir]}/libyaml-0-2.dll", "#{settings[:ruby_bindir]}/libyaml-0-2.dll"
pkg.install_file "#{settings[:bindir]}/libffi-8.dll", "#{settings[:ruby_bindir]}/libffi-8.dll"
end

# Copy the DLLs into additional ruby install bindirs as well.
if settings.has_key?(:additional_rubies)
settings[:additional_rubies].each do |rubyver, local_settings|
Expand All @@ -28,6 +36,7 @@
pkg.install_file "#{settings[:tools_root]}/bin/libffi-6.dll", "#{local_settings[:ruby_bindir]}/libffi-6.dll"
end
end

elsif platform.is_macos?

# Do nothing
Expand Down
3 changes: 1 addition & 2 deletions configs/platforms/windows-2019-x64.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
visual_studio_sdk_version = 'win8.1'

# We need to ensure we install chocolatey prior to adding any nuget repos. Otherwise, everything will fall over
plat.add_build_repository "https://artifactory.delivery.puppetlabs.net/artifactory/generic/buildsources/windows/chocolatey/install-chocolatey.ps1"
plat.add_build_repository "https://artifactory.delivery.puppetlabs.net/artifactory/generic/buildsources/windows/chocolatey/install-chocolatey-1.4.0.ps1"
plat.add_build_repository "https://artifactory.delivery.puppetlabs.net/artifactory/api/nuget/nuget"

# C:\tools is likely added by mingw, however because we also want to use that
# dir for vsdevcmd.bat we create it for safety
plat.provision_with "mkdir C:/tools"
# We don't want to install any packages from the chocolatey repo by accident
plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe upgrade -y chocolatey"
plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe sources remove -name chocolatey"

packages = [
Expand Down
118 changes: 118 additions & 0 deletions configs/projects/_pdk-components.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# This file is used to define the components that make up the PDK runtime package.

if proj.ruby_major_version >= 3

openssl3_platform = [
platform.is_el?,
platform.is_fedora?,
platform.is_sles?,
platform.is_deb?,
platform.is_macos?,
platform.is_windows?
].any?

openssl_version = proj.openssl_version
openssl_version = '3.0' if openssl3_platform

proj.component "openssl-#{openssl_version}"

# Ruby 3.2 does not package these two libraries so we need to add them
proj.component 'libffi'
proj.component 'libyaml'
end

# Always build the default openssl version
proj.component "openssl-#{proj.openssl_version}"

# Common deps
proj.component 'curl'

# Git and deps
proj.component 'git'

# Ruby and deps
proj.component 'runtime-pdk'
proj.component 'puppet-ca-bundle'

proj.component 'readline' if platform.is_macos?
proj.component 'augeas' unless platform.is_windows?
proj.component 'libxml2' unless platform.is_windows?
proj.component 'libxslt' unless platform.is_windows?
proj.component "ruby-#{proj.ruby_version}"

# After installing ruby, we need to copy libssp to the ruby bindir on windows
if platform.is_windows?
ruby_component = @project.get_component "ruby-#{proj.ruby_version}"
ruby_component.install.push "cp '#{settings[:bindir]}/libssp-0.dll' '#{settings[:ruby_bindir]}/libssp-0.dll'"
end

proj.component 'ruby-augeas' unless platform.is_windows?
proj.component 'ruby-selinux' if platform.is_el? || platform.is_fedora?
proj.component 'ruby-stomp'

# Additional Rubies
if proj.respond_to?(:additional_rubies)
proj.additional_rubies.each_key do |rubyver|
proj.component "ruby-#{rubyver}"

ruby_minor = rubyver.split('.')[0, 2].join('.')

proj.component "ruby-#{ruby_minor}-augeas" unless platform.is_windows?
proj.component "ruby-#{ruby_minor}-selinux" if platform.is_el? || platform.is_fedora?
proj.component "ruby-#{ruby_minor}-stomp"
end
end

# PDK Rubygems
proj.component 'rubygem-ffi'
proj.component 'rubygem-locale'
proj.component 'rubygem-text'
proj.component 'rubygem-gettext'
proj.component 'rubygem-fast_gettext'
proj.component 'rubygem-gettext-setup'
proj.component 'rubygem-minitar'

# Bundler
proj.component 'rubygem-bundler'

# Cri and deps
proj.component 'rubygem-cri'

# Childprocess and deps
proj.component 'rubygem-childprocess'
proj.component 'rubygem-hitimes'

## tty-reader and deps
proj.component 'rubygem-tty-screen'
proj.component 'rubygem-tty-cursor'
proj.component 'rubygem-wisper'
proj.component 'rubygem-tty-reader'

## pastel and deps
proj.component 'rubygem-tty-color'
proj.component 'rubygem-pastel'

## root tty gems
proj.component 'rubygem-tty-prompt'
proj.component 'rubygem-tty-spinner'
proj.component 'rubygem-tty-which'

# json-schema and deps
proj.component 'rubygem-public_suffix'
proj.component 'rubygem-addressable'
proj.component 'rubygem-json-schema'

# Analytics deps
proj.component 'rubygem-concurrent-ruby'
proj.component 'rubygem-thor'
proj.component 'rubygem-hocon'
proj.component 'rubygem-facter'
proj.component 'rubygem-httpclient'

# Other deps
proj.component 'rubygem-deep_merge'
proj.component 'rubygem-json_pure'
proj.component 'rubygem-diff-lcs'
proj.component 'rubygem-pathspec'

proj.component 'ansicon' if platform.is_windows?
Loading

0 comments on commit 872864a

Please sign in to comment.