diff --git a/configs/components/curl.rb b/configs/components/curl.rb index 2faf0cdb5..4efed05c5 100644 --- a/configs/components/curl.rb +++ b/configs/components/curl.rb @@ -12,6 +12,7 @@ pkg.build_requires "openssl-#{settings[:openssl_version]}" pkg.build_requires "puppet-ca-bundle" + ldflags = settings[:ldflags] if platform.is_cross_compiled_linux? pkg.build_requires "runtime-#{settings[:runtime_project]}" pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" @@ -22,7 +23,10 @@ pkg.environment "PATH", "$(shell cygpath -u #{settings[:gcc_bindir]}):$(PATH)" pkg.environment "CYGWIN", settings[:cygwin] elsif platform.is_aix? && platform.name != 'aix-7.1-ppc' + pkg.environment "PKG_CONFIG_PATH", "/opt/puppetlabs/puppet/lib/pkgconfig" pkg.environment 'PATH', "/opt/freeware/bin:$(PATH):#{settings[:bindir]}" + # exclude -Wl,-brtl + ldflags = "-L#{settings[:libdir]}" else pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" end @@ -43,7 +47,7 @@ pkg.configure do ["CPPFLAGS='#{settings[:cppflags]}' \ - LDFLAGS='#{settings[:ldflags]}' \ + LDFLAGS='#{ldflags}' \ ./configure --prefix=#{settings[:prefix]} \ #{configure_options.join(" ")} \ --enable-threaded-resolver \ diff --git a/configs/components/ruby-3.2.2.rb b/configs/components/ruby-3.2.2.rb index 8957b747b..25c6f7058 100644 --- a/configs/components/ruby-3.2.2.rb +++ b/configs/components/ruby-3.2.2.rb @@ -48,6 +48,7 @@ end if platform.is_aix? + pkg.apply_patch "#{base}/reline_disable_terminfo.patch" # TODO: Remove this patch once PA-1607 is resolved. # pkg.apply_patch "#{base}/aix_configure.patch" # pkg.apply_patch "#{base}/aix-fix-libpath-in-configure.patch" diff --git a/configs/components/runtime-agent.rb b/configs/components/runtime-agent.rb index 478cd9a6a..9f2abddcb 100644 --- a/configs/components/runtime-agent.rb +++ b/configs/components/runtime-agent.rb @@ -29,6 +29,11 @@ pkg.install_file File.join(libdir, "libgcc_s.a"), "/opt/puppetlabs/puppet/lib/libgcc_s.a" if platform.name != 'aix-7.1-ppc' pkg.install_file File.join(libdir, "libatomic.a"), "/opt/puppetlabs/puppet/lib/libatomic.a" + pkg.install_file "/opt/freeware/lib/libiconv.a", "/opt/puppetlabs/puppet/lib/libiconv.a" + pkg.install_file "/opt/freeware/lib/libncurses.so.6.3.0", "/opt/puppetlabs/puppet/lib/libncurses.so.6.3.0" + pkg.link "libncurses.so.6.3.0", "/opt/puppetlabs/puppet/lib/libncurses.so" + pkg.install_file "/opt/freeware/lib/libreadline.a", "/opt/puppetlabs/puppet/lib/libreadline.a" + pkg.install_file "/opt/freeware/lib/libz.a", "/opt/puppetlabs/puppet/lib/libz.a" end elsif platform.is_windows? lib_type = platform.architecture == "x64" ? "seh" : "sjlj" diff --git a/configs/platforms/aix-7.2-ppc.rb b/configs/platforms/aix-7.2-ppc.rb index 9e4658087..582e0c86b 100644 --- a/configs/platforms/aix-7.2-ppc.rb +++ b/configs/platforms/aix-7.2-ppc.rb @@ -6,24 +6,35 @@ plat.servicetype "aix" plat.tar "/opt/freeware/bin/tar" - plat.provision_with %[ + plat.provision_with %( curl -O https://artifactory.delivery.puppetlabs.net/artifactory/generic__buildsources/openssl-1.1.2.2000.tar.Z; uncompress openssl-1.1.2.2000.tar.Z; tar xvf openssl-1.1.2.2000.tar; cd openssl-1.1.2.2000 && /usr/sbin/installp -acgwXY -d $PWD openssl.base; -curl --output yum.sh https://artifactory.delivery.puppetlabs.net/artifactory/generic__buildsources/buildsources/aix-yum.sh && sh yum.sh] +curl --output yum.sh https://artifactory.delivery.puppetlabs.net/artifactory/generic__buildsources/buildsources/aix-yum.sh && sh yum.sh) + + # Since we updated openssl.base, run updtvpkg so that RPM packages that we install + # later build against the new openssl. + # See https://www.ibm.com/support/pages/understanding-aix-virtual-rpm-package-rpmrte + plat.provision_with 'updtvpkg' # After installing yum, but before yum installing packages, point yum to artifactory # AIX sed doesn't support in-place replacement, so download GNU sed and use that - plat.provision_with %[ + plat.provision_with %( rpm -Uvh https://artifactory.delivery.puppetlabs.net/artifactory/rpm__remote_aix_linux_toolbox/RPMS/ppc/sed/sed-4.1.1-1.aix5.1.ppc.rpm; -/opt/freeware/bin/sed -i 's|https://anonymous:anonymous@public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS|https://artifactory.delivery.puppetlabs.net/artifactory/rpm__remote_aix_linux_toolbox/RPMS|' /opt/freeware/etc/yum/yum.conf] +/opt/freeware/bin/sed -i 's|https://anonymous:anonymous@public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS|https://artifactory.delivery.puppetlabs.net/artifactory/rpm__remote_aix_linux_toolbox/RPMS|' /opt/freeware/etc/yum/yum.conf) + + # yum.sh downloads rpm.rte containing several base packages including curl + # 7.51. However, that version isn't compatible with cmake. If we update curl + # specifically, then yum/python/libcurl will be in an inconsistent state. So + # run `yum update` to update to newer versions while maintaining compatible + # versions. + plat.provision_with 'yum update --assumeyes --skip-broken' packages = %w( autoconf cmake coreutils - curl-7.86.0 gawk gcc gcc-c++ diff --git a/resources/patches/ruby_32/reline_disable_terminfo.patch b/resources/patches/ruby_32/reline_disable_terminfo.patch new file mode 100644 index 000000000..486887709 --- /dev/null +++ b/resources/patches/ruby_32/reline_disable_terminfo.patch @@ -0,0 +1,23 @@ +commit e0e58e7f5ee53e14f7a87a7399ad977a1381861a +Author: Josh Cooper +Date: Mon Jul 10 22:34:25 2023 -0700 + + Disable terminfo + + If curses libraries can be loaded but terminfo isn't installed, then + reline raises, killing irb. Apply this patch to disable terminfo + integration. + +diff --git a/lib/reline/terminfo.rb b/lib/reline/terminfo.rb +index f53642b919..e0633f802b 100644 +--- a/lib/reline/terminfo.rb ++++ b/lib/reline/terminfo.rb +@@ -163,7 +163,7 @@ def self.tigetnum(capname) + end + + def self.enabled? +- true ++ false + end + end if Reline::Terminfo.curses_dl +