Skip to content

Commit

Permalink
Merge pull request #599 from larskanis/update-postgres
Browse files Browse the repository at this point in the history
Update postgres and openssl
  • Loading branch information
larskanis authored Oct 24, 2024
2 parents 94f1d7f + ca8e69c commit 342bdbb
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/binary-gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- os: windows-latest
ruby: "3.3"
platform: "x64-mingw-ucrt"
PGVERSION: 16.0-1-windows-x64
PGVERSION: 17.0-1-windows-x64
- os: windows-latest
ruby: "3.1.4-1"
platform: "x86-mingw32"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/source-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ jobs:
include:
- os: windows
ruby: "head"
PGVERSION: 16.0-1-windows-x64
PGVER: "16"
PGVERSION: 17.0-1-windows-x64
PGVER: "17"
- os: windows
ruby: "2.5"
PGVERSION: 9.4.26-1-windows-x64
PGVER: "9.4"
- os: windows
ruby: "mswin"
PGVERSION: 16.0-1-windows-x64
PGVER: "16"
PGVERSION: 17.0-1-windows-x64
PGVER: "17"
- os: ubuntu
ruby: "head"
PGVER: "16"
PGVER: "17"
- os: ubuntu
ruby: "3.2"
PGVER: "12"
Expand All @@ -69,11 +69,11 @@ jobs:
PGVER: "13"
- os: ubuntu
ruby: "truffleruby-head"
PGVER: "16"
PGVER: "17"
- os: macos
ruby: "head"
PGVERSION: 16.0-1-osx
PGVER: "16"
PGVERSION: 17.0-1-osx
PGVER: "17"

runs-on: ${{ matrix.os }}-${{ matrix.os_ver || 'latest' }}
env:
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ end

desc "Update list of server error codes"
task :update_error_codes do
URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=refs/tags/REL_16_0"
URL_ERRORCODES_TXT = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/utils/errcodes.txt;hb=refs/tags/REL_17_0"

ERRORCODES_TXT = "ext/errorcodes.txt"
sh "wget #{URL_ERRORCODES_TXT.inspect} -O #{ERRORCODES_TXT.inspect} || curl #{URL_ERRORCODES_TXT.inspect} -o #{ERRORCODES_TXT.inspect}"
Expand Down
9 changes: 7 additions & 2 deletions Rakefile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class CrossLibrary < OpenStruct
self.host_platform = toolchain

# Cross-compilation constants
self.openssl_version = ENV['OPENSSL_VERSION'] || '3.3.2'
self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '16.4'
self.openssl_version = ENV['OPENSSL_VERSION'] || '3.4.0'
self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '17.0'

# Check if symlinks work in the current working directory.
# This fails, if rake-compiler-dock is running on a Windows box.
Expand Down Expand Up @@ -206,6 +206,10 @@ class CrossLibrary < OpenStruct
chdir( static_postgresql_srcdir + "common" ) do
sh 'make', "-j#{NUM_CPUS}"
end
# Work around missing dependency to errorcodes.h in PostgreSQL-17.0
chdir( static_postgresql_srcdir + "backend" + "utils" ) do
sh 'make', "-j#{NUM_CPUS}"
end
chdir( static_postgresql_srcdir + "port" ) do
sh 'make', "-j#{NUM_CPUS}"
end
Expand Down Expand Up @@ -289,6 +293,7 @@ CrossLibraries.each do |xlib|
task "gem:windows:#{platform}" => ['gem:windows:prepare', xlib.openssl_tarball, xlib.postgresql_tarball] do
RakeCompilerDock.sh <<-EOT, platform: platform
(cp build/gem/gem-*.pem ~/.gem/ || true) &&
sudo apt-get update && sudo apt-get install -y bison flex &&
bundle install --local &&
rake native:#{platform} pkg/#{$gem_spec.full_name}-#{platform}.gem MAKEOPTS=-j`nproc` RUBY_CC_VERSION=3.3.0:3.2.0:3.1.0:3.0.0:2.7.0:2.6.0:2.5.0
EOT
Expand Down
9 changes: 4 additions & 5 deletions ext/errorcodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@
VALUE klass = define_error_class( "IdleInTransactionSessionTimeout", "25" );
register_error_class( "25P03", klass );
}
{
VALUE klass = define_error_class( "TransactionTimeout", "25" );
register_error_class( "25P04", klass );
}
{
VALUE klass = define_error_class( "InvalidSqlStatementName", NULL );
register_error_class( "26000", klass );
Expand Down Expand Up @@ -885,11 +889,6 @@
VALUE klass = define_error_class( "DuplicateFile", "58" );
register_error_class( "58P02", klass );
}
{
VALUE klass = define_error_class( "SnapshotTooOld", NULL );
register_error_class( "72000", klass );
register_error_class( "72", klass );
}
{
VALUE klass = define_error_class( "ConfigFileError", NULL );
register_error_class( "F0000", klass );
Expand Down
7 changes: 2 additions & 5 deletions ext/errorcodes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# errcodes.txt
# PostgreSQL error codes
#
# Copyright (c) 2003-2023, PostgreSQL Global Development Group
# Copyright (c) 2003-2024, PostgreSQL Global Development Group
#
# This list serves as the basis for generating source files containing error
# codes. It is kept in a common format to make sure all these source files have
Expand Down Expand Up @@ -252,6 +252,7 @@ Section: Class 25 - Invalid Transaction State
25P01 E ERRCODE_NO_ACTIVE_SQL_TRANSACTION no_active_sql_transaction
25P02 E ERRCODE_IN_FAILED_SQL_TRANSACTION in_failed_sql_transaction
25P03 E ERRCODE_IDLE_IN_TRANSACTION_SESSION_TIMEOUT idle_in_transaction_session_timeout
25P04 E ERRCODE_TRANSACTION_TIMEOUT transaction_timeout

Section: Class 26 - Invalid SQL Statement Name

Expand Down Expand Up @@ -439,10 +440,6 @@ Section: Class 58 - System Error (errors external to PostgreSQL itself)
58P01 E ERRCODE_UNDEFINED_FILE undefined_file
58P02 E ERRCODE_DUPLICATE_FILE duplicate_file

Section: Class 72 - Snapshot Failure
# (class borrowed from Oracle)
72000 E ERRCODE_SNAPSHOT_TOO_OLD snapshot_too_old

Section: Class F0 - Configuration File Error

# (PostgreSQL-specific error class)
Expand Down
2 changes: 0 additions & 2 deletions spec/pg/connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,6 @@
end

it "doesn't notify the wrong thread about closed socket (Bug #564)" do
skip "this spec crashs silently on Windows for some reason (pending investigation)" if RUBY_PLATFORM=~/mingw|mswin/i

10.times do
10.times.map do
Thread.new do
Expand Down

0 comments on commit 342bdbb

Please sign in to comment.