Skip to content

Commit

Permalink
Merge branch 'master' into PA-4872/openssl_3_solaris_11_x86
Browse files Browse the repository at this point in the history
  • Loading branch information
cthorn42 committed Jul 6, 2023
2 parents 52bfb2b + 46c127e commit 4e30a3b
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 19 deletions.
12 changes: 10 additions & 2 deletions configs/components/_base-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@
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"
pkg.environment 'CC', "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-gcc"
# See PA-5639, if we decide to go without OpenCSW GCC then we can simplify this logic
if ruby_version_y >= '3.0'
pkg.environment 'PATH', "#{settings[:bindir]}:/opt/csw/bin:/usr/ccs/bin:/usr/sfw/bin:$(PATH)"
pkg.environment 'CC', '/opt/csw/bin/gcc'
pkg.environment 'LD', '/opt/csw/bin/gld'
pkg.environment 'AR', '/opt/csw/bin/gar'
else
pkg.environment 'PATH', "#{settings[:bindir]}:/usr/ccs/bin:/usr/sfw/bin:$(PATH):/opt/csw/bin"
pkg.environment 'CC', "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-gcc"
end
pkg.environment 'CXX', "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-g++"
pkg.environment 'LDFLAGS', "-Wl,-rpath=#{settings[:libdir]}"
if platform.os_version == '10'
Expand Down
17 changes: 17 additions & 0 deletions configs/components/curl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@
configure_options << "--disable-dependency-tracking"
end

if platform.name == 'aix-7.2-ppc'
# yum on aix installs an old version of libcurl.a that /opt/freeware/bin/gcc seems
# to use no matter what -L search path I use, so use the same workaround as bbf248fb6
pkg.configure do
[
'mkdir -p /opt/freeware/lib/hide',
'mv /opt/freeware/lib/libcurl.a /opt/freeware/lib/hide/libcurl.a'
]
end
end

pkg.configure do
["CPPFLAGS='#{settings[:cppflags]}' \
LDFLAGS='#{settings[:ldflags]}' \
Expand All @@ -59,6 +70,12 @@
["#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1)"]
end

if platform.name == 'aix-7.2-ppc'
pkg.build do
['mv /opt/freeware/lib/hide/libcurl.a /opt/freeware/lib/libcurl.a']
end
end

install_steps = [
"#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install",
]
Expand Down
4 changes: 2 additions & 2 deletions configs/components/openssl-1.1.1.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
component 'openssl' do |pkg, settings, platform|
pkg.version '1.1.1t'
pkg.sha256sum '8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b'
pkg.version '1.1.1u'
pkg.sha256sum 'e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6'
pkg.url "https://openssl.org/source/openssl-#{pkg.get_version}.tar.gz"
pkg.mirror "#{settings[:buildsources_url]}/openssl-#{pkg.get_version}.tar.gz"

Expand Down
11 changes: 5 additions & 6 deletions configs/components/openssl-3.0.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
component 'openssl' do |pkg, settings, platform|
pkg.version '3.0.8'
pkg.sha256sum '6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e'
pkg.version '3.0.9'
pkg.sha256sum 'eb1ab04781474360f77c318ab89d8c5a03abc38e63d65a603cabbf1b00a1dc90'
pkg.url "https://openssl.org/source/openssl-#{pkg.get_version}.tar.gz"
pkg.mirror "#{settings[:buildsources_url]}/openssl-#{pkg.get_version}.tar.gz"

Expand Down Expand Up @@ -55,8 +55,9 @@
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"
# see https://github.com/openssl/openssl/issues/18007 about -latomic
# see https://www.ibm.com/docs/en/aix/7.2?topic=l-ld-command about -R<path>, which is equivalent to -rpath
ldflags = "#{settings[:ldflags]} -Wl,-R#{settings[:libdir]} -latomic -lm"
target = 'aix-gcc'
elsif platform.is_solaris?
pkg.environment 'PATH', '/opt/csw/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin'
Expand Down Expand Up @@ -113,7 +114,6 @@
target,
sslflags,
'no-camellia',
'no-ec2m',
'no-md2',
'no-ssl3',
'no-ssl3-method',
Expand All @@ -122,7 +122,6 @@
'no-aria',
# 'no-bf', pgcrypto is requires this cipher in postgres for puppetdb
# 'no-cast', pgcrypto is requires this cipher in postgres for puppetdb
'no-rc2',
'no-rc5',
# 'no-md4', puppet infra uses the agent's runtime and runs WinRM tasks using NTLM, so it needs DES & MD4
'no-mdc2',
Expand Down
4 changes: 3 additions & 1 deletion configs/components/ruby-3.2.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
# collect2: error: ld returned 16 exit status

pkg.environment 'optflags', "-O2 -fPIC -g0 "
elsif platform.is_solaris?
pkg.environment 'optflags', '-O1'
else
pkg.environment 'optflags', '-O2'
end
Expand Down Expand Up @@ -223,7 +225,7 @@
elsif platform.name =~ /osx-12/
rbconfig_changes["CC"] = 'clang -target arm64-apple-macos12'
else
rbconfig_changes["CC"] = "gcc"
rbconfig_changes["CC"] = 'gcc'
rbconfig_changes["warnflags"] = "-Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized"
end
if platform.name =~ /el-7-ppc64/
Expand Down
12 changes: 9 additions & 3 deletions configs/components/rubygem-ffi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,15 @@
pkg.environment "CPATH", "/opt/csw/lib/libffi-3.2.1/include" if platform.name =~ /solaris-11/
pkg.environment "MAKE", platform[:make] if platform.is_solaris?

if platform.is_cross_compiled_linux? || platform.is_solaris?
pkg.environment "PATH", "/opt/pl-build-tools/bin:/opt/csw/bin:$(PATH)"
end
if platform.is_cross_compiled_linux?
pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH)"
elsif platform.is_solaris?
if settings[:runtime_project] == 'agent-runtime-main'
pkg.environment "PATH", "/opt/csw/bin:/opt/pl-build-tools/bin:$(PATH)"
else
pkg.environment "PATH", "/opt/pl-build-tools/bin:/opt/csw/bin:$(PATH)"
end
end

if platform.name =~ /solaris-11-i386/
pkg.install_file "/usr/lib/libffi.so.5.0.10", "#{settings[:libdir]}/libffi.so"
Expand Down
4 changes: 2 additions & 2 deletions configs/components/rubygem-hiera-eyaml.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
component 'rubygem-hiera-eyaml' do |pkg, settings, platform|
pkg.version '3.3.0'
pkg.md5sum '6f3eee8a30aa6c77736be2e640afafe9'
pkg.version '3.4.0'
pkg.sha256sum 'cdacb683dc5efefcae9bc668ab881f17ce5597cac1c0493aee7c4387c7c8ff54'

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

Expand Down
1 change: 1 addition & 0 deletions configs/platforms/aix-7.1-ppc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
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;
/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 install -y gcc8-c++;
ln -sf /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/libgcc_s.a /opt/freeware/lib/libgcc_s.a]

Expand Down
10 changes: 9 additions & 1 deletion configs/platforms/aix-7.2-ppc.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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"
Expand All @@ -14,6 +13,12 @@
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]

# 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 %[
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]

packages = %w(
autoconf
cmake
Expand All @@ -40,6 +45,9 @@
# 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"

# lots of things expect mktemp to be installed in the usual place, so link it
plat.provision_with "ln -sf /opt/freeware/bin/mktemp /usr/bin/mktemp"

plat.install_build_dependencies_with "yum install --assumeyes "
plat.vmpooler_template "aix-7.2-power"
end
8 changes: 8 additions & 0 deletions configs/platforms/osx-13-x86_64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
platform 'osx-13-x86_64' do |plat|
plat.inherit_from_default

packages = %w[cmake pkg-config yaml-cpp]
plat.provision_with "su test -c '/usr/local/bin/brew install #{packages.join(' ')}'"

plat.output_dir File.join('apple', '13', 'PC1', 'x86_64')
end
2 changes: 1 addition & 1 deletion configs/platforms/solaris-11-i386.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
basedir=default" > /var/tmp/vanagon-noask;
echo "mirror=https://artifactory.delivery.puppetlabs.net/artifactory/generic__remote_opencsw_mirror/testing" > /var/tmp/vanagon-pkgutil.conf;
pkgadd -n -a /var/tmp/vanagon-noask -d http://get.opencsw.org/now all
/opt/csw/bin/pkgutil --config=/var/tmp/vanagon-pkgutil.conf -y -i libffi_dev autoconf gcc4core|| exit 1;
/opt/csw/bin/pkgutil --config=/var/tmp/vanagon-pkgutil.conf -y -i libffi_dev autoconf gcc4core || exit 1;
ntpdate pool.ntp.org]
plat.output_dir File.join("solaris", "11", "PC1")
Expand Down
2 changes: 1 addition & 1 deletion configs/projects/_shared-agent-components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
proj.component "openssl-#{proj.openssl_version}"
end

proj.component 'curl' if platform.name != 'aix-7.2-ppc' # PA-5618
proj.component 'curl'
proj.component 'puppet-ca-bundle'
proj.component "ruby-#{proj.ruby_version}"
proj.component "readline" if platform.is_macos?
Expand Down

0 comments on commit 4e30a3b

Please sign in to comment.