From 86f9fc2ee16742604388c16d53685d5e5c103ca1 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 12 Jun 2023 22:05:56 -0700 Subject: [PATCH 1/9] (PA-4719) Fix regex typo Escape dots when matching platform name :? means match colon 0 or 1 times, so it matched 0 times. We actually want ?: which is a non-capturing group. --- configs/components/yaml-cpp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/components/yaml-cpp.rb b/configs/components/yaml-cpp.rb index e44e99a4a..546cea981 100644 --- a/configs/components/yaml-cpp.rb +++ b/configs/components/yaml-cpp.rb @@ -34,7 +34,7 @@ pkg.environment "CYGWIN", settings[:cygwin] cmake = "C:/ProgramData/chocolatey/bin/cmake.exe -G \"MinGW Makefiles\"" cmake_toolchain_file = "-DCMAKE_TOOLCHAIN_FILE=#{settings[:tools_root]}/pl-build-toolchain.cmake" - elsif platform.is_aix? || platform.name =~ /debian-9|el-[567]|redhatfips-7|sles-(:?11|12)|ubuntu-18.04-amd64/ + elsif platform.is_aix? || platform.name =~ /debian-9|el-[567]|redhatfips-7|sles-(?:11|12)|ubuntu-18\.04-amd64/ cmake = "#{settings[:tools_root]}/bin/cmake" cmake_toolchain_file = "-DCMAKE_TOOLCHAIN_FILE=#{settings[:tools_root]}/pl-build-toolchain.cmake" else From 58e934ddced6f771df029eacfe70a900335a7392 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 12 Jun 2023 22:27:56 -0700 Subject: [PATCH 2/9] (PA-4719) Make CC/PATH conditional only aix platform name When building puppet7 on AIX 7.1, we use pl-build-tools. When building puppet8 on 7.2, we don't, so make the CC and PATH environment variables conditional. --- configs/components/_base-ruby-augeas.rb | 9 +++++++-- configs/components/_base-ruby.rb | 7 +++++-- configs/components/augeas.rb | 8 ++++++-- configs/components/libffi.rb | 6 +++++- configs/components/libxml2.rb | 6 +++++- configs/components/libxslt.rb | 6 +++++- configs/components/libyaml.rb | 6 +++++- configs/components/ruby-3.2.2.rb | 6 +++++- configs/components/runtime-agent.rb | 8 ++++++-- configs/projects/_shared-agent-components.rb | 2 +- configs/projects/_shared-agent-settings.rb | 8 ++++++-- 11 files changed, 56 insertions(+), 16 deletions(-) diff --git a/configs/components/_base-ruby-augeas.rb b/configs/components/_base-ruby-augeas.rb index 02abdd9af..7f17a2291 100644 --- a/configs/components/_base-ruby-augeas.rb +++ b/configs/components/_base-ruby-augeas.rb @@ -21,8 +21,13 @@ pkg.environment "PATH", "$(PATH):/opt/pl-build-tools/bin:/usr/local/bin:/opt/csw/bin:/usr/ccs/bin:/usr/sfw/bin" if platform.is_aix? - # We still use pl-gcc for AIX 7.1 - pkg.environment "CC", "/opt/pl-build-tools/bin/gcc" + if platform.name == 'aix-7.1-ppc' + pkg.environment "CC", "/opt/pl-build-tools/bin/gcc" + # pl-build-tools was added to PATH above + else + pkg.environment "CC", "/opt/freeware/bin/gcc" + pkg.environment "PATH", "$(PATH):/opt/freeware/bin" + end pkg.environment "RUBY", host_ruby pkg.environment "LDFLAGS", " -brtl #{settings[:ldflags]}" end diff --git a/configs/components/_base-ruby.rb b/configs/components/_base-ruby.rb index 5bc01b238..3c899885c 100644 --- a/configs/components/_base-ruby.rb +++ b/configs/components/_base-ruby.rb @@ -22,8 +22,11 @@ ############# if platform.is_aix? - # We still use pl-gcc for AIX 7.1 - pkg.environment "CC", "/opt/pl-build-tools/bin/gcc" + if platform.name == 'aix-7.1-ppc' + pkg.environment "CC", "/opt/pl-build-tools/bin/gcc" + else + pkg.environment "CC", "/opt/freeware/bin/gcc" + end pkg.environment 'LDFLAGS', "#{settings[:ldflags]} -Wl,-bmaxdata:0x80000000" elsif platform.is_solaris? pkg.environment 'PATH', "#{settings[:bindir]}:/usr/ccs/bin:/usr/sfw/bin:$(PATH):/opt/csw/bin" diff --git a/configs/components/augeas.rb b/configs/components/augeas.rb index 30b05275b..e959ccd37 100644 --- a/configs/components/augeas.rb +++ b/configs/components/augeas.rb @@ -56,8 +56,12 @@ pkg.environment "PKG_CONFIG_PATH", "#{settings[:libdir]}/pkgconfig" if platform.is_aix? - # We still use pl-gcc for AIX 7.1 - pkg.environment "CC", "/opt/pl-build-tools/bin/gcc" + if platform.name == 'aix-7.1-ppc' + pkg.environment "CC", "/opt/pl-build-tools/bin/gcc" + else + pkg.environment "CC", "/opt/freeware/bin/gcc" + pkg.environment "PATH", "/opt/freeware/bin:$(PATH):#{settings[:bindir]}" + end pkg.build_requires "runtime-#{settings[:runtime_project]}" pkg.environment "LDFLAGS", settings[:ldflags] pkg.environment "CFLAGS", "-I#{settings[:includedir]}" diff --git a/configs/components/libffi.rb b/configs/components/libffi.rb index 5f25a064c..0f753b653 100644 --- a/configs/components/libffi.rb +++ b/configs/components/libffi.rb @@ -5,7 +5,11 @@ pkg.mirror "#{settings[:buildsources_url]}/#{pkg.get_name}-#{pkg.get_version}.tar.gz" if platform.is_aix? - pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" + if platform.name == 'aix-7.1-ppc' + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" + else + pkg.environment "PATH", "/opt/freeware/bin:$(PATH)" + end elsif platform.is_cross_compiled_linux? pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" pkg.environment "CFLAGS", settings[:cflags] diff --git a/configs/components/libxml2.rb b/configs/components/libxml2.rb index 292657066..9e3413192 100644 --- a/configs/components/libxml2.rb +++ b/configs/components/libxml2.rb @@ -9,7 +9,11 @@ # So we generate a configure file manually, compress as tar.gz, and host internally. if platform.is_aix? - pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" + if platform.name == 'aix-7.1-ppc' + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" + else + pkg.environment "PATH", "/opt/freeware/bin:$(PATH)" + end elsif platform.is_cross_compiled_linux? pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" pkg.environment "CFLAGS", settings[:cflags] diff --git a/configs/components/libxslt.rb b/configs/components/libxslt.rb index 8a83fe0b0..cfc109839 100644 --- a/configs/components/libxslt.rb +++ b/configs/components/libxslt.rb @@ -11,7 +11,11 @@ pkg.build_requires "libxml2" if platform.is_aix? - pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" + if platform.name == 'aix-7.1-ppc' + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" + else + pkg.environment "PATH", "/opt/freeware/bin:$(PATH)" + end elsif platform.is_cross_compiled_linux? pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" pkg.environment "CFLAGS", settings[:cflags] diff --git a/configs/components/libyaml.rb b/configs/components/libyaml.rb index facb847e0..29551c780 100644 --- a/configs/components/libyaml.rb +++ b/configs/components/libyaml.rb @@ -5,7 +5,11 @@ pkg.mirror "#{settings[:buildsources_url]}/yaml-#{pkg.get_version}.tar.gz" if platform.is_aix? - pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" + if platform.name == 'aix-7.1-ppc' + pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" + else + pkg.environment "PATH", "/opt/freeware/bin:$(PATH)" + end elsif platform.is_cross_compiled_linux? pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" pkg.environment "CFLAGS", settings[:cflags] diff --git a/configs/components/ruby-3.2.2.rb b/configs/components/ruby-3.2.2.rb index b4e3c3a63..47ce80410 100644 --- a/configs/components/ruby-3.2.2.rb +++ b/configs/components/ruby-3.2.2.rb @@ -140,7 +140,11 @@ # TODO: Remove this once PA-1607 is resolved. # TODO: Can we use native autoconf? The dependencies seemed a little too extensive if platform.is_aix? - pkg.configure { ["/opt/pl-build-tools/bin/autoconf"] } + if platform.name == 'aix-7.1-ppc' + pkg.configure { ["/opt/pl-build-tools/bin/autoconf"] } + else + pkg.configure { ["/opt/freeware/bin/autoconf"] } + end else pkg.configure { ["bash autogen.sh"] } end diff --git a/configs/components/runtime-agent.rb b/configs/components/runtime-agent.rb index 83a8dd637..72e0febbf 100644 --- a/configs/components/runtime-agent.rb +++ b/configs/components/runtime-agent.rb @@ -9,8 +9,12 @@ else libdir = File.join("/opt/pl-build-tools", settings[:platform_triple], "lib") end - elsif platform.name == "aix-7.1-ppc" - libdir = "/opt/pl-build-tools/lib/gcc/powerpc-ibm-aix7.1.0.0/5.2.0/" + elsif platform.is_aix? + if platform.name == "aix-7.1-ppc" + libdir = "/opt/pl-build-tools/lib/gcc/powerpc-ibm-aix7.1.0.0/5.2.0/" + else + libdir = "/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/" + end elsif platform.is_solaris? || platform.architecture =~ /i\d86/ libdir = "/opt/pl-build-tools/lib" elsif platform.architecture =~ /64/ diff --git a/configs/projects/_shared-agent-components.rb b/configs/projects/_shared-agent-components.rb index f4f675531..3ac821be9 100644 --- a/configs/projects/_shared-agent-components.rb +++ b/configs/projects/_shared-agent-components.rb @@ -13,7 +13,7 @@ # Common components required by all agent branches proj.component 'runtime-agent' -matchdata = platform.settings[:ruby_version].match /(\d+)\.\d+\.\d+/ +matchdata = platform.settings[:ruby_version].match(/(\d+)\.\d+\.\d+/) ruby_major_version = matchdata[1].to_i # Ruby 3.2 does not package these two libraries so we need to add them as a component if ruby_major_version >= 3 diff --git a/configs/projects/_shared-agent-settings.rb b/configs/projects/_shared-agent-settings.rb index 0909b3dcb..eec0e18d7 100644 --- a/configs/projects/_shared-agent-settings.rb +++ b/configs/projects/_shared-agent-settings.rb @@ -156,7 +156,7 @@ proj.setting(:ldflags, "-L#{proj.libdir} -Wl,-rpath=#{proj.libdir},-z,relro,-z,now") end -if ruby_version_x == "3" && !platform.is_aix? && !platform.is_solaris? +if ruby_version_x == "3" && !platform.is_solaris? proj.setting(:openssl_version, '3.0') elsif platform.name =~ /^redhatfips-/ proj.setting(:openssl_version, '1.1.1-fips') @@ -208,7 +208,11 @@ end if platform.is_aix? - proj.setting(:ldflags, "-Wl,-brtl -L#{proj.libdir} -L/opt/pl-build-tools/lib") + if platform.name == 'aix-7.1-ppc' + proj.setting(:ldflags, "-Wl,-brtl -L#{proj.libdir} -L/opt/pl-build-tools/lib") + else + proj.setting(:ldflags, "-Wl,-brtl -L#{proj.libdir}") + end end if platform.is_solaris? From 1940f4f323c16c7ba6ff4d1687dc073a8cdbab53 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 12 Jun 2023 22:34:16 -0700 Subject: [PATCH 3/9] (PA-4719) Use readline on AIX 7.2 But continue using libedit on AIX 7.1 --- configs/components/_base-ruby.rb | 6 +++++- configs/components/augeas.rb | 7 ++++++- configs/components/readline.rb | 4 +++- configs/projects/_shared-agent-components.rb | 2 +- configs/projects/agent-runtime-main.rb | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/configs/components/_base-ruby.rb b/configs/components/_base-ruby.rb index 3c899885c..d3b6e67bb 100644 --- a/configs/components/_base-ruby.rb +++ b/configs/components/_base-ruby.rb @@ -70,7 +70,11 @@ if platform.is_aix? pkg.build_requires "runtime-#{settings[:runtime_project]}" - pkg.build_requires "libedit" + if platform.name == 'aix-7.1-ppc' + pkg.build_requires "libedit" + else + pkg.build_requires "readline" + end elsif platform.is_solaris? pkg.build_requires "runtime-#{settings[:runtime_project]}" pkg.build_requires "libedit" if platform.name =~ /^solaris-10-sparc/ diff --git a/configs/components/augeas.rb b/configs/components/augeas.rb index e959ccd37..84556ca22 100644 --- a/configs/components/augeas.rb +++ b/configs/components/augeas.rb @@ -63,9 +63,14 @@ pkg.environment "PATH", "/opt/freeware/bin:$(PATH):#{settings[:bindir]}" end pkg.build_requires "runtime-#{settings[:runtime_project]}" + if platform.name == 'aix-7.1-ppc' + pkg.build_requires 'libedit' + else + pkg.build_requires 'readline' + end + pkg.environment "LDFLAGS", settings[:ldflags] pkg.environment "CFLAGS", "-I#{settings[:includedir]}" - pkg.build_requires 'libedit' end if platform.is_rpm? && !platform.is_aix? diff --git a/configs/components/readline.rb b/configs/components/readline.rb index 5424588bb..fa8ece6b1 100644 --- a/configs/components/readline.rb +++ b/configs/components/readline.rb @@ -5,7 +5,9 @@ pkg.mirror "#{settings[:buildsources_url]}/#{pkg.get_name}-#{pkg.get_version}.tar.gz" if platform.is_aix? - pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)" + raise "readline is not supported on older AIX" if platform.name == 'aix-7.1-ppc' + + pkg.environment "PATH", "/opt/freeware/bin:$(PATH)" elsif platform.is_cross_compiled_linux? pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" pkg.environment "CFLAGS", settings[:cflags] diff --git a/configs/projects/_shared-agent-components.rb b/configs/projects/_shared-agent-components.rb index 3ac821be9..2a03db874 100644 --- a/configs/projects/_shared-agent-components.rb +++ b/configs/projects/_shared-agent-components.rb @@ -48,7 +48,7 @@ end # libedit is used instead of readline on these platforms -if platform.is_solaris? || platform.is_aix? +if platform.is_solaris? || platform.name == 'aix-7.1-ppc' proj.component 'libedit' end diff --git a/configs/projects/agent-runtime-main.rb b/configs/projects/agent-runtime-main.rb index f3692dbd9..c31ad00a0 100644 --- a/configs/projects/agent-runtime-main.rb +++ b/configs/projects/agent-runtime-main.rb @@ -6,7 +6,7 @@ proj.setting :rubygem_hocon_version, '1.4.0' # Solaris and AIX depend on libedit which breaks augeas compliation starting with 1.13.0 - if platform.is_solaris? || platform.is_aix? + if platform.is_solaris? || platform.name == 'aix-7.1-ppc' proj.setting :augeas_version, '1.12.0' else proj.setting :augeas_version, '1.13.0' From fcc547c51dd99a86f7c49c133f3588f3a44646eb Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 12 Jun 2023 22:35:22 -0700 Subject: [PATCH 4/9] (PA-4719) Build openssl 3 on AIX 7.2 Our Solaris build host only has openssl 1.0.2 which isn't new enough to boostrap miniruby. So bump to openssl 3 and link against libatomic, which must also be vendored/redistributed in the runtime. --- configs/components/openssl-3.0.rb | 26 ++++++++++++++++---------- configs/components/runtime-agent.rb | 3 +++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/configs/components/openssl-3.0.rb b/configs/components/openssl-3.0.rb index 6d5f8d100..3240a0c44 100644 --- a/configs/components/openssl-3.0.rb +++ b/configs/components/openssl-3.0.rb @@ -46,11 +46,16 @@ # elsif platform.architecture =~ /ppc64/ # Big-endian # 'linux-ppc64' # end - # elsif platform.is_aix? - # pkg.environment 'CC', '/opt/pl-build-tools/bin/gcc' + elsif platform.is_aix? + raise "openssl-3.0 is not supported on older AIX" if platform.name == 'aix-7.1-ppc' - # cflags = '$${CFLAGS} -static-libgcc' - # target = 'aix-gcc' + # REMIND: why not PATH? + pkg.environment 'CC', '/opt/freeware/bin/gcc' + + cflags = "#{settings[:cflags]} -static-libgcc" + # see https://github.com/openssl/openssl/issues/18007 + ldflags = "#{settings[:ldflags]} -latomic -lm" + target = 'aix-gcc' # elsif platform.is_solaris? # pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin' # pkg.environment 'CC', "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-gcc" @@ -127,9 +132,9 @@ # Individual projects may provide their own openssl configure flags: project_flags = settings[:openssl_extra_configure_flags] || [] perl_exec = '' - # if platform.is_aix? - # perl_exec = '/opt/freeware/bin/perl' - # end + if platform.is_aix? + perl_exec = '/opt/freeware/bin/perl' + end configure_flags << project_flags pkg.environment 'CFLAGS', cflags @@ -169,9 +174,10 @@ install_prefix = platform.is_windows? ? '' : 'INSTALL_PREFIX=/' install_commands = [] - # if platform.is_aix? - # install_commands << "slibclean" - # end + if platform.is_aix? + # "Removes any currently unused modules in kernel and library memory." + install_commands << "slibclean" + end # Skip man and html docs install_commands << "#{platform[:make]} #{install_prefix} install_sw install_ssldirs" diff --git a/configs/components/runtime-agent.rb b/configs/components/runtime-agent.rb index 72e0febbf..478cd9a6a 100644 --- a/configs/components/runtime-agent.rb +++ b/configs/components/runtime-agent.rb @@ -27,6 +27,9 @@ if platform.is_aix? pkg.install_file File.join(libdir, "libstdc++.a"), "/opt/puppetlabs/puppet/lib/libstdc++.a" 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" + end elsif platform.is_windows? lib_type = platform.architecture == "x64" ? "seh" : "sjlj" pkg.install_file "#{settings[:gcc_bindir]}/libgcc_s_#{lib_type}-1.dll", "#{settings[:bindir]}/libgcc_s_#{lib_type}-1.dll" From 313832de632e1f668c0a8395082b2cdfd8207035 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 12 Jun 2023 22:41:03 -0700 Subject: [PATCH 5/9] (PA-4719) Build Ruby 3.2 on AIX 7.2 --- configs/components/ruby-3.2.2.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configs/components/ruby-3.2.2.rb b/configs/components/ruby-3.2.2.rb index 47ce80410..88023608a 100644 --- a/configs/components/ruby-3.2.2.rb +++ b/configs/components/ruby-3.2.2.rb @@ -76,6 +76,15 @@ pkg.environment 'MAKE', 'make' elsif platform.is_cross_compiled? pkg.environment 'CROSS_COMPILING', 'true' + elsif platform.is_aix? + # When using the default -ggdb3 I was seeing linker errors like, so use -g0 instead: + # + # ld: 0711-759 INTERNAL ERROR: Source file dwarf.c, line 528. + # Depending on where this product was acquired, contact your service + # representative or the approved supplier. + # collect2: error: ld returned 16 exit status + + pkg.environment 'optflags', "-O2 -fPIC -g0 " else pkg.environment 'optflags', '-O2' end @@ -117,6 +126,7 @@ without_dtrace = [ 'aix-7.1-ppc', + 'aix-7.2-ppc', 'el-7-ppc64le', 'osx-11-arm64', 'osx-12-arm64', @@ -182,6 +192,7 @@ target_doubles = { 'powerpc-ibm-aix7.1.0.0' => 'powerpc-aix7.1.0.0', + 'powerpc-ibm-aix7.2.0.0' => 'powerpc-aix7.2.0.0', 'aarch64-apple-darwin' => 'arm64-darwin', 'aarch64-redhat-linux' => 'aarch64-linux', 'ppc64-redhat-linux' => 'powerpc64-linux', From 56a016f23691d345470b6480181f1e4d8d8a9512 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 12 Jun 2023 22:42:00 -0700 Subject: [PATCH 6/9] (PA-4719) Build boost on AIX 7.2 Use gcc 10.3.0 to build boost. --- configs/components/boost.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/configs/components/boost.rb b/configs/components/boost.rb index b47c31a4a..dfc93ccaf 100644 --- a/configs/components/boost.rb +++ b/configs/components/boost.rb @@ -113,7 +113,12 @@ install_only_flags = "boost.locale.iconv=off" elsif platform.is_aix? pkg.environment "NO_CXX11_CHECK", "1" - pkg.environment "CXX", "/opt/freeware/bin/g++-8" + if platform.name == 'aix-7.1-ppc' + pkg.environment "CXX", "/opt/freeware/bin/g++-8" + else + pkg.environment "CXX", "/opt/freeware/bin/g++-10" + gpp = "/opt/freeware/bin/g++" + end pkg.environment "CXXFLAGS", "-pthread" pkg.environment "PATH", "/opt/freeware/bin:/opt/pl-build-tools/bin:$(PATH)" linkflags = "-Wl,-L#{settings[:libdir]},-L/opt/pl-build-tools/lib" @@ -130,8 +135,14 @@ if platform.is_windows? userconfigjam = %Q{using gcc : : #{gpp} ;} else - if platform.architecture =~ /arm/ || platform.is_aix? + if platform.architecture =~ /arm/ userconfigjam = %Q{using gcc : 5.2.0 : #{gpp} : "#{linkflags}" "#{cflags}" "#{cxxflags}" ;} + elsif platform.is_aix? + if platform.name == 'aix-7.1-ppc' + userconfigjam = %Q{using gcc : 5.2.0 : #{gpp} : "#{linkflags}" "#{cflags}" "#{cxxflags}" ;} + else + userconfigjam = %Q{using gcc : 10.3.0 : #{gpp} : "#{linkflags}" "#{cflags}" "#{cxxflags}" ;} + end else userconfigjam = %Q{using gcc : 4.8.2 : #{gpp} : "#{linkflags}" "#{cflags}" "#{cxxflags}" ;} end From 54bb1dad1f2f76e7ee7c915366a2eb3f2e38b88e Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 12 Jun 2023 22:42:50 -0700 Subject: [PATCH 7/9] (PA-4719) Build yaml-cpp on AIX 7.2 Skip yaml-cpp for now on AIX 7.2 --- configs/components/yaml-cpp.rb | 5 ++++- configs/projects/agent-runtime-main.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configs/components/yaml-cpp.rb b/configs/components/yaml-cpp.rb index 546cea981..62ad3367f 100644 --- a/configs/components/yaml-cpp.rb +++ b/configs/components/yaml-cpp.rb @@ -34,10 +34,13 @@ pkg.environment "CYGWIN", settings[:cygwin] cmake = "C:/ProgramData/chocolatey/bin/cmake.exe -G \"MinGW Makefiles\"" cmake_toolchain_file = "-DCMAKE_TOOLCHAIN_FILE=#{settings[:tools_root]}/pl-build-toolchain.cmake" - elsif platform.is_aix? || platform.name =~ /debian-9|el-[567]|redhatfips-7|sles-(?:11|12)|ubuntu-18\.04-amd64/ + elsif platform.name =~ /aix-7\.1-ppc|debian-9|el-[567]|redhatfips-7|sles-(?:11|12)|ubuntu-18\.04-amd64/ cmake = "#{settings[:tools_root]}/bin/cmake" cmake_toolchain_file = "-DCMAKE_TOOLCHAIN_FILE=#{settings[:tools_root]}/pl-build-toolchain.cmake" else + if platform.is_aix? + pkg.environment "PATH", "$PATH:/opt/freeware/bin" + end pkg.environment 'CPPFLAGS', settings[:cppflags] pkg.environment 'CFLAGS', settings[:cflags] pkg.environment 'LDFLAGS', settings[:ldflags] diff --git a/configs/projects/agent-runtime-main.rb b/configs/projects/agent-runtime-main.rb index c31ad00a0..ed32747aa 100644 --- a/configs/projects/agent-runtime-main.rb +++ b/configs/projects/agent-runtime-main.rb @@ -80,5 +80,5 @@ proj.component 'rubygem-prime' proj.component 'boost' if ENV['NO_PXP_AGENT'].to_s.empty? - proj.component 'yaml-cpp' if ENV['NO_PXP_AGENT'].to_s.empty? + proj.component 'yaml-cpp' if ENV['NO_PXP_AGENT'].to_s.empty? && platform.name != 'aix-7.2-ppc' # PA-5617 end From 322f9ea012e1a1308b901992a3aa7093b7d9fd99 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 12 Jun 2023 22:46:58 -0700 Subject: [PATCH 8/9] (PA-4719) Build curl on AIX 7.2 Skip curl for now. --- configs/components/curl.rb | 2 ++ configs/projects/_shared-agent-components.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configs/components/curl.rb b/configs/components/curl.rb index 86234ceff..2faf0cdb5 100644 --- a/configs/components/curl.rb +++ b/configs/components/curl.rb @@ -21,6 +21,8 @@ pkg.build_requires "runtime-#{settings[:runtime_project]}" 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 'PATH', "/opt/freeware/bin:$(PATH):#{settings[:bindir]}" else pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):#{settings[:bindir]}" end diff --git a/configs/projects/_shared-agent-components.rb b/configs/projects/_shared-agent-components.rb index 2a03db874..4d0b059b5 100644 --- a/configs/projects/_shared-agent-components.rb +++ b/configs/projects/_shared-agent-components.rb @@ -30,7 +30,7 @@ proj.component "openssl-#{proj.openssl_version}" end -proj.component 'curl' +proj.component 'curl' if platform.name != 'aix-7.2-ppc' # PA-5618 proj.component 'puppet-ca-bundle' proj.component "ruby-#{proj.ruby_version}" proj.component "readline" if platform.is_macos? From b49b9db5f0b8e2d8c7bf4d30e3ac859411c96380 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 12 Jun 2023 22:52:11 -0700 Subject: [PATCH 9/9] (PA-4719) Add AIX 7.2 platform We still need to bootstrap openssl 1.0.2 so that we can connect to artifactory to download aix-yum.sh, which installs yum on AIX. Then we can use yum to install non-pl-build-tools gcc, etc. --- configs/platforms/aix-7.2-ppc.rb | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 configs/platforms/aix-7.2-ppc.rb diff --git a/configs/platforms/aix-7.2-ppc.rb b/configs/platforms/aix-7.2-ppc.rb new file mode 100644 index 000000000..2d6d5d222 --- /dev/null +++ b/configs/platforms/aix-7.2-ppc.rb @@ -0,0 +1,45 @@ +platform "aix-7.2-ppc" do |plat| + # os_version = 7.2 + plat.make "gmake" + plat.mktemp "/opt/freeware/bin/mktemp -d -p /var/tmp" + plat.patch "/opt/freeware/bin/patch" + plat.rpmbuild "/usr/bin/rpm" + plat.servicetype "aix" + plat.tar "/opt/freeware/bin/tar" + + plat.provision_with %[ +curl -O https://artifactory.delivery.puppetlabs.net/artifactory/generic__buildsources/openssl-1.0.2.1800.tar.Z; +uncompress openssl-1.0.2.1800.tar.Z; +tar xvf openssl-1.0.2.1800.tar; +cd openssl-1.0.2.1800 && /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] + +packages = %w( + autoconf + cmake + coreutils + gawk + gcc + gcc-c++ + gdbm + gmp + libffi + libyaml + make + perl + pkg-config + readline + readline-devel + sed + tar + zlib + zlib-devel + ) + plat.provision_with "yum install --assumeyes #{packages.join(' ')}" + + # No upstream rsync packages + plat.provision_with "rpm -Uvh https://artifactory.delivery.puppetlabs.net/artifactory/rpm__remote_aix_linux_toolbox/RPMS/ppc/rsync/rsync-3.0.6-1.aix5.3.ppc.rpm" + + plat.install_build_dependencies_with "yum install --assumeyes " + plat.vmpooler_template "aix-7.2-power" +end