From 2a1b728df4fb8ca4d46a44036d3c509d90392b5c Mon Sep 17 00:00:00 2001 From: Amit Karsale Date: Fri, 23 Feb 2024 19:12:06 +0530 Subject: [PATCH] (PA-5998) Enable puppet-runtime builds for sles11-main --- configs/components/_base-ruby-augeas.rb | 7 ++++++- configs/components/ruby-3.2.3.rb | 8 +++++++- configs/components/ruby-shadow.rb | 2 ++ configs/components/rubygem-ffi.rb | 5 ++++- configs/components/runtime-agent.rb | 6 ++++++ configs/platforms/sles-11-x86_64.rb | 1 - 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/configs/components/_base-ruby-augeas.rb b/configs/components/_base-ruby-augeas.rb index 84d5961f6..8a40798c5 100644 --- a/configs/components/_base-ruby-augeas.rb +++ b/configs/components/_base-ruby-augeas.rb @@ -19,7 +19,12 @@ pkg.build_requires "ruby-#{ruby_version}" pkg.build_requires "augeas" -pkg.environment "PATH", "$(PATH):/opt/pl-build-tools/bin:/usr/local/bin:/opt/csw/bin:/usr/ccs/bin:/usr/sfw/bin" +if platform.name == 'sles-11-x86_64' + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" +else + pkg.environment "PATH", "$(PATH):/opt/pl-build-tools/bin:/usr/local/bin:/opt/csw/bin:/usr/ccs/bin:/usr/sfw/bin" +end + if platform.is_aix? if platform.name == 'aix-7.1-ppc' pkg.environment "CC", "/opt/pl-build-tools/bin/gcc" diff --git a/configs/components/ruby-3.2.3.rb b/configs/components/ruby-3.2.3.rb index 378d9f6dc..762407c0c 100644 --- a/configs/components/ruby-3.2.3.rb +++ b/configs/components/ruby-3.2.3.rb @@ -78,6 +78,9 @@ pkg.environment 'optflags', "-O2 -fPIC -g0 " elsif platform.is_solaris? pkg.environment 'optflags', '-O1' + elsif platform.name == 'sles-11-x86_64' + pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH)' + pkg.environment 'optflags', '-O2' else pkg.environment 'optflags', '-O2' end @@ -108,7 +111,9 @@ special_flags += " --with-baseruby=no --enable-dtrace=no " end special_flags += "--enable-close-fds-by-recvmsg-with-peek " - elsif platform.name =~ /el-6/ + elsif platform.name =~ /el-6/ || platform.name =~ /sles-11-x86_64/ + # Since we're not cross compiling, ignore old ruby versions that happen to be in the PATH + # and force ruby to build miniruby and use that to bootstrap the rest of the build special_flags += " --with-baseruby=no " elsif platform.is_windows? # ruby's configure script guesses the build host is `cygwin`, because we're using @@ -133,6 +138,7 @@ 'osx-11-arm64', 'osx-12-arm64', 'redhatfips-7-x86_64', + 'sles-11-x86_64', 'sles-12-ppc64le', 'solaris-11-sparc', 'solaris-113-sparc', diff --git a/configs/components/ruby-shadow.rb b/configs/components/ruby-shadow.rb index bb385adb4..be7e322cd 100644 --- a/configs/components/ruby-shadow.rb +++ b/configs/components/ruby-shadow.rb @@ -5,6 +5,8 @@ pkg.build_requires "ruby-#{settings[:ruby_version]}" if !platform.is_cross_compiled? && platform.architecture == 'sparc' pkg.environment "PATH", "$(PATH):/opt/pl-build-tools/bin:/usr/ccs/bin:/usr/sfw/bin" + elsif platform.name == 'sles-11-x86_64' + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" else pkg.environment "PATH", "$(PATH):/usr/ccs/bin:/usr/sfw/bin" end diff --git a/configs/components/rubygem-ffi.rb b/configs/components/rubygem-ffi.rb index 408c54cce..489ceff11 100644 --- a/configs/components/rubygem-ffi.rb +++ b/configs/components/rubygem-ffi.rb @@ -87,6 +87,10 @@ else pkg.environment "PATH", "/opt/pl-build-tools/bin:/opt/csw/bin:$(PATH)" end + elsif platform.is_aix? + pkg.environment 'PATH', '/opt/freeware/bin:/opt/pl-build-tools/bin:$(PATH)' + elsif platform.name == 'sles-11-x86_64' + pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH)' end # With Ruby 3.2 on Solaris-11 we install OpenSCW's libffi, no need to copy over the system libffi @@ -97,7 +101,6 @@ end pkg.environment 'PKG_CONFIG_PATH', '/opt/puppetlabs/puppet/lib/pkgconfig:$(PKG_CONFIG_PATH)' - pkg.environment 'PATH', '/opt/freeware/bin:/opt/pl-build-tools/bin:$(PATH)' if platform.is_aix? if platform.is_cross_compiled? && !platform.is_macos? base_ruby = case platform.name diff --git a/configs/components/runtime-agent.rb b/configs/components/runtime-agent.rb index eaa24f08c..fdcf2186d 100644 --- a/configs/components/runtime-agent.rb +++ b/configs/components/runtime-agent.rb @@ -3,6 +3,12 @@ pkg.environment "PROJECT_SHORTNAME", "puppet" pkg.add_source "file://resources/files/runtime/runtime.sh" + if platform.name =~ /sles-11-x86_64/ && settings[:ruby_version] =~ /2.7/ + pkg.install do + "zypper install -y --oldpackage pl-gcc=4.8.2-1" + end + end + if platform.is_cross_compiled? if platform.architecture =~ /aarch64|ppc64$|ppc64le/ libdir = File.join("/opt/pl-build-tools", settings[:platform_triple], "lib64") diff --git a/configs/platforms/sles-11-x86_64.rb b/configs/platforms/sles-11-x86_64.rb index 0aaddf3f7..955643a4b 100644 --- a/configs/platforms/sles-11-x86_64.rb +++ b/configs/platforms/sles-11-x86_64.rb @@ -17,7 +17,6 @@ "zlib-devel" ] plat.provision_with("zypper -n --no-gpg-checks install -y #{packages.join(' ')}") - plat.provision_with "zypper install -y --oldpackage pl-gcc=4.8.2-1" plat.provision_with "zypper install -y --oldpackage pl-cmake=3.2.3-13.sles11" plat.install_build_dependencies_with "zypper -n --no-gpg-checks install -y" plat.vmpooler_template "sles-11-x86_64"