Skip to content

Commit

Permalink
Merge pull request #696 from joshcooper/aix72_libz
Browse files Browse the repository at this point in the history
(PA-5645) Install additional runtime dependencies
  • Loading branch information
joshcooper committed Jul 12, 2023
2 parents 2e92026 + 7a461ec commit 5172806
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
6 changes: 5 additions & 1 deletion configs/components/curl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]}"
Expand All @@ -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
Expand All @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions configs/components/ruby-3.2.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions configs/components/runtime-agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 16 additions & 5 deletions configs/platforms/aix-7.2-ppc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
23 changes: 23 additions & 0 deletions resources/patches/ruby_32/reline_disable_terminfo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
commit e0e58e7f5ee53e14f7a87a7399ad977a1381861a
Author: Josh Cooper <joshcooper@users.noreply.github.com>
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

0 comments on commit 5172806

Please sign in to comment.