diff --git a/omnibus/config/software/oc_id.rb b/omnibus/config/software/oc_id.rb index 96b0b5ab7c..89017d12a9 100644 --- a/omnibus/config/software/oc_id.rb +++ b/omnibus/config/software/oc_id.rb @@ -27,7 +27,7 @@ # and makeds more sense than adding the thing that is stopping # it from building on s390 (libxml2). dependency "nokogiri" -dependency "postgresql13" # for libpq +dependency "postgresql14" # for libpq dependency "ruby" relative_path "oc-id" diff --git a/omnibus/config/software/partybus.rb b/omnibus/config/software/partybus.rb index 0167b6334d..e02fc7d4b7 100644 --- a/omnibus/config/software/partybus.rb +++ b/omnibus/config/software/partybus.rb @@ -21,7 +21,7 @@ license :project_license dependency "ruby" -dependency "postgresql13" +dependency "postgresql14" build do env = with_standard_compiler_flags(with_embedded_path) diff --git a/omnibus/config/software/perl_pg_driver.rb b/omnibus/config/software/perl_pg_driver.rb index a44257c4fc..dd33f09ba5 100644 --- a/omnibus/config/software/perl_pg_driver.rb +++ b/omnibus/config/software/perl_pg_driver.rb @@ -22,7 +22,7 @@ dependency "perl" dependency "cpanminus" -dependency "postgresql13" +dependency "postgresql14" source url: "http://search.cpan.org/CPAN/authors/id/T/TU/TURNSTEP/DBD-Pg-#{version}.tar.gz", md5: "547de1382a47d66872912fe64282ff55" diff --git a/omnibus/config/software/postgresql14.rb b/omnibus/config/software/postgresql14.rb new file mode 100644 index 0000000000..de42ce284f --- /dev/null +++ b/omnibus/config/software/postgresql14.rb @@ -0,0 +1,64 @@ +# +# Copyright:: Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "postgresql14" + +default_version "14.20" + +license "PostgreSQL" +license_file "COPYRIGHT" +skip_transitive_dependency_licensing true + +dependency "zlib" +dependency "openssl" +dependency "libedit" +dependency "ncurses" +dependency "libossp-uuid" +dependency "config_guess" + +# version_list: url=https://ftp.postgresql.org/pub/source/v#{version}/ filter=*.tar.bz2 + +version("14.20") { source sha256: "7527f10f1640761bc280ad97d105d286d0cf72e54d36d78cf68e5e5f752b646b" } + +source url: "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2" + +relative_path "postgresql-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + short_version = version.gsub(/^([0-9]+).[0-9]+$/, '\1') + + update_config_guess(target: "config") + + command "./configure" \ + " --prefix=#{install_dir}/embedded/postgresql/#{short_version}" \ + " --with-libedit-preferred" \ + " --with-openssl" \ + " --with-ossp-uuid" \ + " --with-includes=#{install_dir}/embedded/include" \ + " --with-libraries=#{install_dir}/embedded/lib", env: env + + make "world -j #{workers}", env: env + make "install-world -j #{workers}", env: env + + block do + Dir.glob("#{install_dir}/embedded/postgresql/#{short_version}/bin/*").sort.each do |bin| + link bin, "#{install_dir}/embedded/bin/#{File.basename(bin)}" + end + + delete "#{install_dir}/embedded/postgresql/#{short_version}/share/doc" + end +end diff --git a/omnibus/config/software/private-chef-ctl.rb b/omnibus/config/software/private-chef-ctl.rb index ff467c8f34..af83c94219 100644 --- a/omnibus/config/software/private-chef-ctl.rb +++ b/omnibus/config/software/private-chef-ctl.rb @@ -21,7 +21,7 @@ license :project_license skip_transitive_dependency_licensing true -dependency "postgresql13" # for libpq +dependency "postgresql14" # for libpq dependency "omnibus-ctl" build do diff --git a/omnibus/config/software/server-complete.rb b/omnibus/config/software/server-complete.rb index d77ab14716..f4aaf81883 100644 --- a/omnibus/config/software/server-complete.rb +++ b/omnibus/config/software/server-complete.rb @@ -30,7 +30,8 @@ # the backend dependency "postgresql96-bin" # for upgrading 9.6 -> 13 -dependency "postgresql13" +dependency "postgresql13" # for upgrading 13 -> 14 +dependency "postgresql14" dependency "valkey" # dynamic routing controls dependency "haproxy" dependency "opensearch" # used by search diff --git a/omnibus/files/server-ctl-cookbooks/infra-server/attributes/default.rb b/omnibus/files/server-ctl-cookbooks/infra-server/attributes/default.rb index 86686323b8..276147f6ee 100755 --- a/omnibus/files/server-ctl-cookbooks/infra-server/attributes/default.rb +++ b/omnibus/files/server-ctl-cookbooks/infra-server/attributes/default.rb @@ -575,7 +575,7 @@ ### # For now, we're hardcoding the version directory suffix here. # Since postgresql 10, only use major version numbers. -default['private_chef']['postgresql']['version'] = '13' +default['private_chef']['postgresql']['version'] = '14' # In the future, we're probably going to want to do something more elegant so we # don't accidentally overwrite this directory if we upgrade PG to 9.3: keeping these # directories straight is important because in the distant future (the year 2000) diff --git a/omnibus/files/server-ctl-cookbooks/infra-server/libraries/preflight_postgres_validator.rb b/omnibus/files/server-ctl-cookbooks/infra-server/libraries/preflight_postgres_validator.rb index 686a17f59e..f10666df1d 100644 --- a/omnibus/files/server-ctl-cookbooks/infra-server/libraries/preflight_postgres_validator.rb +++ b/omnibus/files/server-ctl-cookbooks/infra-server/libraries/preflight_postgres_validator.rb @@ -21,10 +21,10 @@ class PostgresqlPreflightValidator < PreflightValidator # we ship. When we bumped the version we ship to 9.6, we haven't yet # introduced any changes that _require_ 9.6. So, these constants reflect the # actually required PG version. - REQUIRED_VERSION = PgVersion.new('9.6') + REQUIRED_VERSION = PgVersion.new('9.6') # supported PG version - SUPPORTED_VERSION = PgVersion.new('13') + SUPPORTED_VERSION = PgVersion.new('14') def run! warn_about_removed_attribute('checkpoint_segments') @@ -190,7 +190,7 @@ def backend_verify_postgres_version(connection) v = PgVersion.new /^([0-9\.]+)/.match(r.first['server_version']).to_a.first # Note that we're looking for the same major, and using our minor as the minimum version - # This provides compatibility with external databases that use < 13 before we make use + # This provides compatibility with external databases that use < 14 before we make use # of any features available in > 9.6. if v.major == REQUIRED_VERSION || v.major == SUPPORTED_VERSION diff --git a/omnibus/files/server-ctl-cookbooks/infra-server/spec/libraries/preflight_postgres_validator_spec.rb b/omnibus/files/server-ctl-cookbooks/infra-server/spec/libraries/preflight_postgres_validator_spec.rb index 3b50fe14c9..e14f6571e6 100644 --- a/omnibus/files/server-ctl-cookbooks/infra-server/spec/libraries/preflight_postgres_validator_spec.rb +++ b/omnibus/files/server-ctl-cookbooks/infra-server/spec/libraries/preflight_postgres_validator_spec.rb @@ -102,8 +102,8 @@ class ConnectionBad < RuntimeError; end end end - context 'when external version is > 13.x' do - let(:version) { '14.0' } + context 'when external version is > 14.x' do + let(:version) { '15.0' } it 'fails with a CSPG014 error' do expect(postgres_validator).to receive(:fail_with).with(error_message)