pg 1.6.0.rc2-aarch64-mingw-ucrt → 1.6.2-aarch64-mingw-ucrt
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +38 -27
- data/Gemfile +1 -1
- data/README.md +55 -16
- data/Rakefile +14 -3
- data/ext/extconf.rb +38 -9
- data/ext/pg_binary_decoder.c +1 -1
- data/ext/pg_binary_encoder.c +2 -2
- data/ext/pg_coder.c +2 -0
- data/ext/pg_result.c +7 -7
- data/ext/pg_text_decoder.c +1 -1
- data/ext/pg_text_encoder.c +2 -2
- data/ext/pg_tuple.c +5 -5
- data/ext/pg_type_map.c +3 -1
- data/ext/pg_util.c +2 -2
- data/ext/pg_util.h +2 -2
- data/lib/3.4/pg_ext.so +0 -0
- data/lib/pg/coder.rb +3 -2
- data/lib/pg/connection.rb +4 -2
- data/lib/pg/version.rb +2 -1
- data/lib/pg.rb +156 -135
- data/misc/glibc/Dockerfile +20 -0
- data/misc/glibc/docker-compose.yml +9 -0
- data/misc/glibc/glibc_spec.rb +5 -0
- data/ports/aarch64-mingw-ucrt/lib/libpq.dll +0 -0
- data/ports/patches/krb5/1.22.1/0002-unknown-command-line-option-on-clang.patch +12 -0
- data.tar.gz.sig +3 -4
- metadata +11 -8
- metadata.gz.sig +1 -1
- /data/ports/patches/krb5/{1.21.3 → 1.22.1}/0001-Allow-static-linking-krb5-library.patch +0 -0
- /data/ports/patches/openssl/{3.5.1 → 3.5.2}/0001-aarch64-mingw.patch +0 -0
- /data/ports/patches/postgresql/{17.5 → 17.6}/0001-Use-workaround-of-__builtin_setjmp-only-on-MINGW-on-.patch +0 -0
- /data/ports/patches/postgresql/{17.5 → 17.6}/0001-libpq-Process-buffered-SSL-read-bytes-to-support-rec.patch +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 984b83b9e8f407fdd8da4848cc6454954089fd267f935b4a3b01fa73c264a085
|
4
|
+
data.tar.gz: 65b83fd002e05796313b0080870cc61df81fe452ad35d1dfb032712eaa80575c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05f2869a9d275928d9a69dacb7091a348cc7c43257205fb5064286f85f8d240fa2fc349fe73f6803b3a91463dcae689abf52ae08c7e7840b1a2ae805dc7d80e0
|
7
|
+
data.tar.gz: 95a3ae567ef63e43778bb9c8be0973c259ae6e5f34ec4f9d1d260453ade220fa8f7310eb7a35b69064105de913f1729ffa5730fe2640f25c65b79b87f237897e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,49 +1,60 @@
|
|
1
|
-
## v1.6.
|
1
|
+
## v1.6.2 [2025-09-02] Lars Kanis <lars@greiz-reinsdorf.de>
|
2
|
+
|
3
|
+
- Remove several absolute paths from native binaries which pointed to build directories. [#668](https://github.com/ged/ruby-pg/pull/668)
|
4
|
+
- Fix bad fallback path to `pg_service.conf`. [#666](https://github.com/ged/ruby-pg/pull/666)
|
5
|
+
- Use `rbpg_` prefix for `base64_*` functions to avoid name clashes with functions provided by other libraries like Heimdal on Macos. [#667](https://github.com/ged/ruby-pg/pull/667)
|
6
|
+
- Raise a more descriptive error message in case of `pg_ext` LoadError. [#664](https://github.com/ged/ruby-pg/pull/664)
|
7
|
+
- Freeze some constants to make them available in a Ractor context. [#660](https://github.com/ged/ruby-pg/pull/660)
|
8
|
+
- Several documentation improvements.
|
9
|
+
- Update native binary gems to OpenSSL-3.5.2, krb5-1.22.1 and PostgreSQL-17.6.
|
10
|
+
|
11
|
+
|
12
|
+
## v1.6.1 [2025-08-03] Lars Kanis <lars@greiz-reinsdorf.de>
|
13
|
+
|
14
|
+
- Add binary gems for platforms `aarch64-linux-musl` and `x86_64-linux-musl` without the need to install package `gcompat`. [#657](https://github.com/ged/ruby-pg/pull/657).
|
15
|
+
- Serialize CompositeCoder#dimensions only when set. [#652](https://github.com/ged/ruby-pg/pull/652)
|
16
|
+
This fixes the compatibility to pg-1.5.9, when deserializing Marshal data from pg-1.6, as long as the new attribute isn't used.
|
17
|
+
- Remove dependency to MSYS2 package "postgresql" from binary Windows gem [#654](https://github.com/ged/ruby-pg/pull/654)
|
18
|
+
|
19
|
+
|
20
|
+
## v1.6.0 [2025-07-27] Lars Kanis <lars@greiz-reinsdorf.de>
|
2
21
|
|
3
22
|
Added:
|
4
23
|
|
5
24
|
- Add binary gems for Ruby 3.4.
|
6
|
-
- Add fat binary gem for platform `aarch64-mingw-ucrt` aka Windows on ARM [#626](https://github.com/ged/ruby-pg/pull/626), for platform Macos on Intel and ARM [#643](https://github.com/ged/ruby-pg/pull/643)
|
25
|
+
- Add fat binary gem for platform `aarch64-mingw-ucrt` aka Windows on ARM [#626](https://github.com/ged/ruby-pg/pull/626), for platform Macos on Intel and ARM [#643](https://github.com/ged/ruby-pg/pull/643), for platform `aarch64-linux` [#646](https://github.com/ged/ruby-pg/pull/646) and for platform `x86_64-linux` [#551](https://github.com/ged/ruby-pg/pull/551#issuecomment-2504715762).
|
7
26
|
- Update fat binary gem to OpenSSL-3.5.1 and PostgreSQL-17.5.
|
8
27
|
- Add a patch to libpq to avoid starvation on bigger SSL records, which some database engines other than vanilla PostgreSQL use.
|
9
28
|
This patch applies to platform specific binary gems only.
|
10
29
|
[#616](https://github.com/ged/ruby-pg/pull/616)
|
11
|
-
-
|
12
|
-
This
|
13
|
-
|
30
|
+
- Add support for new query cancel functions of PostgreSQL-17.
|
31
|
+
This adds the new class `PG::CancelConnection` which provides the ability to cancel a query per blocking or per non-blocking functions.
|
32
|
+
If the new functions are available they are used and the older are no longer compiled in.
|
33
|
+
This way we can get rid of reading out the internal `PGcancel` struct by `Connection#backend_key`.
|
34
|
+
[#614](https://github.com/ged/ruby-pg/pull/614)
|
35
|
+
- Add PG::BinaryDecoder::Array and PG::BinaryEncoder::Array to parse and encode PostgreSQL arrays in binary format.
|
36
|
+
[#603](https://github.com/ged/ruby-pg/pull/603)
|
14
37
|
- Add possibility to define the number of array dimensions to be encoded.
|
15
38
|
Setting dimensions is especially useful, when a Record shall be encoded into an Array, since the Array encoder can not distinguish if the array shall be encoded as a higher dimension or as a record otherwise.
|
16
39
|
[#622](https://github.com/ged/ruby-pg/pull/622)
|
40
|
+
- Add Connection#set_chunked_rows_mode [#610](https://github.com/ged/ruby-pg/pull/610)
|
41
|
+
- Add PG::Connection#close_prepared, PG::Connection#close_portal, PG::Connection#send_close_prepared and PG::Connection#send_close_portal which are new in PostgreSQL-17.
|
42
|
+
[#611](https://github.com/ged/ruby-pg/pull/611)
|
43
|
+
- Add Connection#send_pipeline_sync, async_pipeline_sync and release GVL at PQ(sendP|P)ipelineSync.
|
44
|
+
[#612](https://github.com/ged/ruby-pg/pull/612)
|
17
45
|
- Add MINGW package dependency which is resolved by RubyInstaller.
|
18
46
|
[#617](https://github.com/ged/ruby-pg/pull/617)
|
19
47
|
- Change `conn.server_version` and `conn.protocol_version` to raise instead of return 0 on error.
|
20
48
|
[#632](https://github.com/ged/ruby-pg/pull/632)
|
49
|
+
- Fix connecting to multiple hosts after `connnect_timeout`.
|
50
|
+
[#637](https://github.com/ged/ruby-pg/pull/637)
|
21
51
|
- Fix making PG::BasicTypeMapForQueries shareable for Ractor in ruby-3.5.
|
22
52
|
[#636](https://github.com/ged/ruby-pg/pull/636)
|
53
|
+
- Fix missing array input verification in PG::TypeMapByColumn.
|
54
|
+
This could cause a segfault.
|
55
|
+
[#620](https://github.com/ged/ruby-pg/pull/620)
|
23
56
|
- Rename `History.md` to `CHANGELOG.md`, which is more common.
|
24
57
|
[#642](https://github.com/ged/ruby-pg/pull/642)
|
25
|
-
- Fix connecting to multiple hosts after `connnect_timeout`.
|
26
|
-
[#637](https://github.com/ged/ruby-pg/pull/637)
|
27
|
-
|
28
|
-
|
29
|
-
## v1.6.0.rc1 [2024-11-28] Lars Kanis <lars@greiz-reinsdorf.de>
|
30
|
-
|
31
|
-
Added:
|
32
|
-
|
33
|
-
- Add fat binary gem for platform `x86_64-linux`.
|
34
|
-
[#551](https://github.com/ged/ruby-pg/pull/551#issuecomment-2504715762)
|
35
|
-
- Add PG::BinaryDecoder::Array and PG::BinaryEncoder::Array to parse and encode PostgreSQL arrays in binary format.
|
36
|
-
[#603](https://github.com/ged/ruby-pg/pull/603)
|
37
|
-
- Add support for new query cancel functions of PostgreSQL-17.
|
38
|
-
This adds the new class `PG::CancelConnection` which provides the ability to cancel a query per blocking or per non-blocking functions.
|
39
|
-
If the new functions are available they are used and the older are no longer compiled in.
|
40
|
-
This way we can get rid of reading out the internal `PGcancel` struct by `Connection#backend_key`.
|
41
|
-
[#614](https://github.com/ged/ruby-pg/pull/614)
|
42
|
-
- Add Connection#set_chunked_rows_mode [#610](https://github.com/ged/ruby-pg/pull/610)
|
43
|
-
- Add PG::Connection#close_prepared, PG::Connection#close_portal, PG::Connection#send_close_prepared and PG::Connection#send_close_portal which are new in PostgreSQL-17.
|
44
|
-
[#611](https://github.com/ged/ruby-pg/pull/611)
|
45
|
-
- Add Connection#send_pipeline_sync, async_pipeline_sync and release GVL at PQ(sendP|P)ipelineSync.
|
46
|
-
[#612](https://github.com/ged/ruby-pg/pull/612)
|
47
58
|
|
48
59
|
Removed:
|
49
60
|
|
data/Gemfile
CHANGED
@@ -13,7 +13,7 @@ end
|
|
13
13
|
group :test do
|
14
14
|
gem "bundler", ">= 1.16", "< 3.0"
|
15
15
|
gem "rake-compiler", "~> 1.0"
|
16
|
-
gem "rake-compiler-dock", "~> 1.9.1"
|
16
|
+
gem "rake-compiler-dock", "~> 1.9.1", git: "https://github.com/rake-compiler/rake-compiler-dock"
|
17
17
|
gem "rspec", "~> 3.5"
|
18
18
|
# "bigdecimal" is a gem on ruby-3.4+ and it's optional for ruby-pg.
|
19
19
|
# Specs should succeed without it, but 4 examples are then excluded.
|
data/README.md
CHANGED
@@ -40,29 +40,33 @@ A small example usage:
|
|
40
40
|
## Requirements
|
41
41
|
|
42
42
|
* Ruby 2.7 or newer
|
43
|
-
* PostgreSQL 10.x or later
|
43
|
+
* PostgreSQL 10.x or later
|
44
|
+
* When installing the source gem: libpq with headers, -dev packages, etc.
|
44
45
|
|
45
|
-
It usually works with earlier versions of Ruby/PostgreSQL as well, but those are
|
46
|
-
not regularly tested.
|
47
46
|
|
47
|
+
## How To Install
|
48
48
|
|
49
|
-
|
49
|
+
Install via RubyGems:
|
50
50
|
|
51
|
-
|
51
|
+
gem install pg
|
52
52
|
|
53
|
-
|
53
|
+
This installs the binary gem, specific to the running platform by default.
|
54
54
|
|
55
|
-
|
55
|
+
### Binary gem
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
```
|
57
|
+
The binary gems don't depend on the libpq package on the running system.
|
58
|
+
They have libpq builtin.
|
60
59
|
|
61
|
-
|
60
|
+
The gems for platform `x86_64-linux` and `aarch64-linux` run on Alpine Linux, but require the package `gcompat`, while the native gems for platform `*-linux-musl` work without that dependency.
|
62
61
|
|
63
|
-
|
62
|
+
There is one use case the binary gems don't support: Retrieval of connection [options from LDAP](https://www.postgresql.org/docs/current/libpq-ldap.html). To support this `libldap` would be necessary, but it has a lot of dependencies. It doesn't seem to be a widely used feature and that it's worth to support it. If it's necessary, the source gem can be forced.
|
64
63
|
|
65
|
-
|
64
|
+
### Source gem
|
65
|
+
|
66
|
+
The source gem can be forced by:
|
67
|
+
|
68
|
+
gem uninstall pg --all
|
69
|
+
gem install pg --platform ruby
|
66
70
|
|
67
71
|
You may need to specify the path to the 'pg_config' program installed with
|
68
72
|
Postgres:
|
@@ -73,6 +77,28 @@ If you're installing via Bundler, you can provide compile hints like so:
|
|
73
77
|
|
74
78
|
bundle config build.pg --with-pg-config=<path to pg_config>
|
75
79
|
|
80
|
+
### Bundler
|
81
|
+
|
82
|
+
To make sure, the necessary platforms and the source gem are fetched by bundler, they can be added like so
|
83
|
+
|
84
|
+
```
|
85
|
+
bundle lock --add-platform x86_64-linux
|
86
|
+
bundle lock --add-platform arm64-darwin
|
87
|
+
bundle lock --add-platform x64-mingw-ucrt
|
88
|
+
bundle lock --add-platform ruby
|
89
|
+
bundle package --all-platforms
|
90
|
+
```
|
91
|
+
|
92
|
+
A re-run of `bundle package` is also necessary after `bundle update`, in order to retrieve the new specific gems of all platforms.
|
93
|
+
|
94
|
+
If the binary gems don't work for some reason, it's easy to force the usage of the source gem in the Gemfile:
|
95
|
+
|
96
|
+
```
|
97
|
+
gem "pg", force_ruby_platform: true
|
98
|
+
```
|
99
|
+
|
100
|
+
### More
|
101
|
+
|
76
102
|
See README-OS_X.rdoc for more information about installing under MacOS X, and
|
77
103
|
README-Windows.rdoc for Windows build/installation instructions.
|
78
104
|
|
@@ -85,6 +111,19 @@ can be found in [the `certs` directory](https://github.com/ged/ruby-pg/tree/mast
|
|
85
111
|
of the repository.
|
86
112
|
|
87
113
|
|
114
|
+
## Versioning
|
115
|
+
|
116
|
+
We tag and release gems according to the [Semantic Versioning](http://semver.org/) principle.
|
117
|
+
|
118
|
+
As a result of this policy, you can (and should) specify a dependency on this gem using the [Pessimistic Version Constraint](http://guides.rubygems.org/patterns/#pessimistic-version-constraint) with two digits of precision.
|
119
|
+
|
120
|
+
For example:
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
spec.add_dependency 'pg', '~> 1.0'
|
124
|
+
```
|
125
|
+
|
126
|
+
|
88
127
|
## Type Casts
|
89
128
|
|
90
129
|
Pg can optionally type cast result values and query parameters in Ruby or
|
@@ -108,7 +147,7 @@ Very basic type casting can be enabled by:
|
|
108
147
|
But Pg's type casting is highly customizable. That's why it's divided into
|
109
148
|
2 layers:
|
110
149
|
|
111
|
-
### Encoders / Decoders (ext/pg_
|
150
|
+
### Encoders / Decoders (ext/pg_\*coder.c, lib/pg/\*coder.rb)
|
112
151
|
|
113
152
|
This is the lower layer, containing encoding classes that convert Ruby
|
114
153
|
objects for transmission to the DBMS and decoding classes to convert
|
@@ -150,9 +189,9 @@ The following text and binary formats can also be encoded although they are not
|
|
150
189
|
* Literal for insertion into SQL string: [TE](rdoc-ref:PG::TextEncoder::QuotedLiteral)
|
151
190
|
* SQL-Identifier: [TE](rdoc-ref:PG::TextEncoder::Identifier), [TD](rdoc-ref:PG::TextDecoder::Identifier)
|
152
191
|
|
153
|
-
###
|
192
|
+
### TypeMap and derivations (ext/pg_type_map\*.c, lib/pg/type_map\*.rb)
|
154
193
|
|
155
|
-
A TypeMap defines which value will be converted by which encoder/decoder.
|
194
|
+
A PG::TypeMap defines which value will be converted by which encoder/decoder.
|
156
195
|
There are different type map strategies, implemented by several derivations
|
157
196
|
of this class. They can be chosen and configured according to the particular
|
158
197
|
needs for type casting. The default type map is PG::TypeMapAllStrings.
|
data/Rakefile
CHANGED
@@ -50,7 +50,9 @@ CrossLibraries = [
|
|
50
50
|
['x86-mingw32', 'mingw', 'i686-w64-mingw32'],
|
51
51
|
['x64-mingw32', 'mingw64', 'x86_64-w64-mingw32'],
|
52
52
|
['x86_64-linux', 'linux-x86_64', 'x86_64-linux-gnu'],
|
53
|
+
['x86_64-linux-musl', 'linux-x86_64', 'x86_64-unknown-linux-musl'],
|
53
54
|
['aarch64-linux', 'linux-aarch64', 'aarch64-linux-gnu'],
|
55
|
+
['aarch64-linux-musl', 'linux-aarch64', 'aarch64-linux-musl'],
|
54
56
|
['x86_64-darwin', 'darwin64-x86_64', 'x86_64-apple-darwin'],
|
55
57
|
['arm64-darwin', 'darwin64-arm64', 'arm64-apple-darwin'],
|
56
58
|
].map do |platform, openssl_config, toolchain|
|
@@ -68,7 +70,13 @@ Rake::ExtensionTask.new do |ext|
|
|
68
70
|
ext.lib_dir = 'lib'
|
69
71
|
ext.source_pattern = "*.{c,h}"
|
70
72
|
ext.cross_compile = true
|
71
|
-
|
73
|
+
|
74
|
+
# Activate current cross compiled platform only.
|
75
|
+
# This is to work around the issue that `linux` platform is selected in `linux-musl` image.
|
76
|
+
ext.cross_platform = CrossLibraries.map(&:platform).select do |pl|
|
77
|
+
m = ENV["RCD_IMAGE"]&.match(/:(?<ruby_ver>[\w\.]+)-mri-(?<platform>[-\w]+)$/)
|
78
|
+
m && m[:platform] == pl
|
79
|
+
end
|
72
80
|
|
73
81
|
ext.cross_config_options += CrossLibraries.map do |xlib|
|
74
82
|
{
|
@@ -85,6 +93,9 @@ Rake::ExtensionTask.new do |ext|
|
|
85
93
|
spec.files << "ports/#{spec.platform.to_s}/lib/libpq-ruby-pg.so.1" if spec.platform.to_s =~ /linux/
|
86
94
|
spec.files << "ports/#{spec.platform.to_s}/lib/libpq-ruby-pg.1.dylib" if spec.platform.to_s =~ /darwin/
|
87
95
|
spec.files << "ports/#{spec.platform.to_s}/lib/libpq.dll" if spec.platform.to_s =~ /mingw|mswin/
|
96
|
+
|
97
|
+
# Binary gems don't postgresql header+lib files
|
98
|
+
spec.metadata.delete("msys2_mingw_dependencies")
|
88
99
|
end
|
89
100
|
end
|
90
101
|
|
@@ -95,7 +106,7 @@ task 'gem:native:prepare' do
|
|
95
106
|
# Copy gem signing key and certs to be accessible from the docker container
|
96
107
|
mkdir_p 'build/gem'
|
97
108
|
sh "cp ~/.gem/gem-*.pem build/gem/ || true"
|
98
|
-
sh "bundle package"
|
109
|
+
sh "bundle package --all"
|
99
110
|
begin
|
100
111
|
OpenSSL::PKey.read(File.read(File.expand_path("~/.gem/gem-private_key.pem")), ENV["GEM_PRIVATE_KEY_PASSPHRASE"] || "")
|
101
112
|
rescue OpenSSL::PKey::PKeyError
|
@@ -130,7 +141,7 @@ CrossLibraries.each do |xlib|
|
|
130
141
|
bundle install --local &&
|
131
142
|
#{ "rake install_darwin_mig[__arm64__]" if platform =~ /arm64-darwin/ }
|
132
143
|
#{ "rake install_darwin_mig[__x86_64__]" if platform =~ /x86_64-darwin/ }
|
133
|
-
rake native:#{platform} pkg/#{$gem_spec.full_name}-#{platform}.gem
|
144
|
+
rake native:#{platform} pkg/#{$gem_spec.full_name}-#{platform}.gem MAKEFLAGS="-j`nproc` V=1" RUBY_CC_VERSION=#{RakeCompilerDock.ruby_cc_version("~>2.7", "~>3.0")}
|
134
145
|
EOT
|
135
146
|
end
|
136
147
|
desc "Build the native binary gems"
|
data/ext/extconf.rb
CHANGED
@@ -27,13 +27,13 @@ if gem_platform=with_config("cross-build")
|
|
27
27
|
gem 'mini_portile2', '~>2.1'
|
28
28
|
require 'mini_portile2'
|
29
29
|
|
30
|
-
OPENSSL_VERSION = ENV['OPENSSL_VERSION'] || '3.5.
|
30
|
+
OPENSSL_VERSION = ENV['OPENSSL_VERSION'] || '3.5.2'
|
31
31
|
OPENSSL_SOURCE_URI = "http://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz"
|
32
32
|
|
33
|
-
KRB5_VERSION = ENV['KRB5_VERSION'] || '1.
|
33
|
+
KRB5_VERSION = ENV['KRB5_VERSION'] || '1.22.1'
|
34
34
|
KRB5_SOURCE_URI = "http://kerberos.org/dist/krb5/#{KRB5_VERSION[/^(\d+\.\d+)/]}/krb5-#{KRB5_VERSION}.tar.gz"
|
35
35
|
|
36
|
-
POSTGRESQL_VERSION = ENV['POSTGRESQL_VERSION'] || '17.
|
36
|
+
POSTGRESQL_VERSION = ENV['POSTGRESQL_VERSION'] || '17.6'
|
37
37
|
POSTGRESQL_SOURCE_URI = "http://ftp.postgresql.org/pub/source/v#{POSTGRESQL_VERSION}/postgresql-#{POSTGRESQL_VERSION}.tar.bz2"
|
38
38
|
|
39
39
|
class BuildRecipe < MiniPortile
|
@@ -49,6 +49,12 @@ if gem_platform=with_config("cross-build")
|
|
49
49
|
"#{target}/#{RUBY_PLATFORM}"
|
50
50
|
end
|
51
51
|
|
52
|
+
# Add "--prefix=/", to avoid our actual build install path compiled into the binary.
|
53
|
+
# Instead use DESTDIR variable of make to set our install path.
|
54
|
+
def configure_prefix
|
55
|
+
"--prefix="
|
56
|
+
end
|
57
|
+
|
52
58
|
def cook_and_activate
|
53
59
|
checkpoint = File.join(self.target, "#{self.name}-#{self.version}-#{RUBY_PLATFORM}.installed")
|
54
60
|
unless File.exist?(checkpoint)
|
@@ -70,13 +76,13 @@ if gem_platform=with_config("cross-build")
|
|
70
76
|
envs = []
|
71
77
|
envs << "CFLAGS=-DDSO_WIN32 -DOPENSSL_THREADS" if RUBY_PLATFORM =~ /mingw|mswin/
|
72
78
|
envs << "CFLAGS=-fPIC -DOPENSSL_THREADS" if RUBY_PLATFORM =~ /linux|darwin/
|
73
|
-
execute('configure', ['env', *envs, "./Configure", openssl_platform, "threads", "-static", "CROSS_COMPILE=#{host}-",
|
79
|
+
execute('configure', ['env', *envs, "./Configure", openssl_platform, "threads", "-static", "CROSS_COMPILE=#{host}-", "--prefix=/"], altlog: "config.log")
|
74
80
|
end
|
75
81
|
def compile
|
76
82
|
execute('compile', "#{make_cmd} build_libs")
|
77
83
|
end
|
78
84
|
def install
|
79
|
-
execute('install', "#{make_cmd} install_dev")
|
85
|
+
execute('install', "#{make_cmd} install_dev DESTDIR=#{path}")
|
80
86
|
end
|
81
87
|
end
|
82
88
|
|
@@ -104,6 +110,9 @@ if gem_platform=with_config("cross-build")
|
|
104
110
|
end
|
105
111
|
super
|
106
112
|
end
|
113
|
+
def install
|
114
|
+
execute('install', "#{make_cmd} install DESTDIR=#{path}")
|
115
|
+
end
|
107
116
|
end
|
108
117
|
# We specify -fcommon to get around duplicate definition errors in recent gcc.
|
109
118
|
# See https://github.com/cockroachdb/cockroach/issues/49734
|
@@ -112,6 +121,7 @@ if gem_platform=with_config("cross-build")
|
|
112
121
|
recipe.configure_options << "--without-keyutils"
|
113
122
|
recipe.configure_options << "--disable-nls"
|
114
123
|
recipe.configure_options << "--disable-silent-rules"
|
124
|
+
recipe.configure_options << "--disable-rpath"
|
115
125
|
recipe.configure_options << "--without-system-verto"
|
116
126
|
recipe.configure_options << "krb5_cv_attr_constructor_destructor=yes"
|
117
127
|
recipe.configure_options << "ac_cv_func_regcomp=yes"
|
@@ -146,12 +156,13 @@ if gem_platform=with_config("cross-build")
|
|
146
156
|
'--without-zlib',
|
147
157
|
'--without-icu',
|
148
158
|
'--without-readline',
|
159
|
+
'--disable-rpath',
|
149
160
|
'ac_cv_search_gss_store_cred_into=',
|
150
161
|
]
|
151
162
|
end
|
152
163
|
def compile
|
153
|
-
execute 'compile include', "#{make_cmd} -C src/include install"
|
154
|
-
execute 'compile interfaces', "#{make_cmd} -C src/interfaces install"
|
164
|
+
execute 'compile include', "#{make_cmd} -C src/include install DESTDIR=#{path}"
|
165
|
+
execute 'compile interfaces', "#{make_cmd} -C src/interfaces install DESTDIR=#{path}"
|
155
166
|
end
|
156
167
|
def install
|
157
168
|
end
|
@@ -169,6 +180,9 @@ if gem_platform=with_config("cross-build")
|
|
169
180
|
# Use our own library name for libpq to avoid loading of system libpq by accident.
|
170
181
|
FileUtils.ln_sf File.join(postgresql_recipe.port_path, "lib/#{libpq_orig}"),
|
171
182
|
File.join(postgresql_recipe.port_path, "lib/#{libpq_rubypg}")
|
183
|
+
# Link to libpq_rubypg in our ports directory without adding it as rpath (like dir_config does)
|
184
|
+
$CFLAGS << " -I#{postgresql_recipe.path}/include"
|
185
|
+
$LDFLAGS << " -L#{postgresql_recipe.path}/lib"
|
172
186
|
# Avoid dependency to external libgcc.dll on x86-mingw32
|
173
187
|
$LDFLAGS << " -static-libgcc" if RUBY_PLATFORM =~ /mingw|mswin/
|
174
188
|
# Avoid: "libpq.so: undefined reference to `dlopen'" in cross-ruby-2.7.8
|
@@ -176,8 +190,6 @@ if gem_platform=with_config("cross-build")
|
|
176
190
|
# Find libpq in the ports directory coming from lib/3.x
|
177
191
|
# It is shared between all compiled ruby versions.
|
178
192
|
$LDFLAGS << " '-Wl,-rpath=$$ORIGIN/../../ports/#{gem_platform}/lib'" if RUBY_PLATFORM =~ /linux/
|
179
|
-
# Don't use pg_config for cross build, but --with-pg-* path options
|
180
|
-
dir_config('pg', "#{postgresql_recipe.path}/include", "#{postgresql_recipe.path}/lib")
|
181
193
|
|
182
194
|
$defs.push( "-DPG_IS_BINARY_GEM")
|
183
195
|
else
|
@@ -318,3 +330,20 @@ end
|
|
318
330
|
create_header()
|
319
331
|
create_makefile( "pg_ext" )
|
320
332
|
|
333
|
+
if gem_platform
|
334
|
+
# exercise the strip command on native binary gems
|
335
|
+
# This approach borrowed from
|
336
|
+
# https://github.com/rake-compiler/rake-compiler-dock/blob/38066d479050f4fdb3956469255b35a05e5949ef/test/rcd_test/ext/mri/extconf.rb#L97C1-L110C42
|
337
|
+
strip_tool = RbConfig::CONFIG['STRIP']
|
338
|
+
strip_tool += ' -x' if RUBY_PLATFORM =~ /darwin/
|
339
|
+
File.open('Makefile.new', 'w') do |o|
|
340
|
+
o.puts 'hijack: all strip'
|
341
|
+
o.puts
|
342
|
+
o.write(File.read('Makefile'))
|
343
|
+
o.puts
|
344
|
+
o.puts 'strip: $(DLLIB)'
|
345
|
+
o.puts "\t$(ECHO) Stripping $(DLLIB)"
|
346
|
+
o.puts "\t$(Q) #{strip_tool} $(DLLIB)"
|
347
|
+
end
|
348
|
+
File.rename('Makefile.new', 'Makefile')
|
349
|
+
end
|
data/ext/pg_binary_decoder.c
CHANGED
@@ -117,7 +117,7 @@ pg_bin_dec_to_base64(t_pg_coder *conv, const char *val, int len, int tuple, int
|
|
117
117
|
/* create a buffer of the encoded length */
|
118
118
|
VALUE out_value = rb_str_new(NULL, encoded_len);
|
119
119
|
|
120
|
-
|
120
|
+
rbpg_base64_encode( RSTRING_PTR(out_value), val, len );
|
121
121
|
|
122
122
|
/* Is it a pure String conversion? Then we can directly send out_value to the user. */
|
123
123
|
if( this->comp.format == 0 && dec_func == pg_text_dec_string ){
|
data/ext/pg_binary_encoder.c
CHANGED
@@ -524,7 +524,7 @@ pg_bin_enc_from_base64(t_pg_coder *conv, VALUE value, char *out, VALUE *intermed
|
|
524
524
|
if(out){
|
525
525
|
/* Second encoder pass, if required */
|
526
526
|
strlen = enc_func(this->elem, value, out, intermediate, enc_idx);
|
527
|
-
strlen =
|
527
|
+
strlen = rbpg_base64_decode( out, out, strlen );
|
528
528
|
|
529
529
|
return strlen;
|
530
530
|
} else {
|
@@ -538,7 +538,7 @@ pg_bin_enc_from_base64(t_pg_coder *conv, VALUE value, char *out, VALUE *intermed
|
|
538
538
|
strlen = RSTRING_LENINT(subint);
|
539
539
|
out_str = rb_str_new(NULL, BASE64_DECODED_SIZE(strlen));
|
540
540
|
|
541
|
-
strlen =
|
541
|
+
strlen = rbpg_base64_decode( RSTRING_PTR(out_str), RSTRING_PTR(subint), strlen);
|
542
542
|
rb_str_set_len( out_str, strlen );
|
543
543
|
*intermediate = out_str;
|
544
544
|
|
data/ext/pg_coder.c
CHANGED
@@ -364,6 +364,7 @@ pg_coder_flags_get(VALUE self)
|
|
364
364
|
* Specifies whether the assigned #elements_type requires quotation marks to
|
365
365
|
* be transferred safely. Encoding with #needs_quotation=false is somewhat
|
366
366
|
* faster.
|
367
|
+
* It is only used by text coders and ignored by binary coders.
|
367
368
|
*
|
368
369
|
* The default is +true+. This option is ignored for decoding of values.
|
369
370
|
*/
|
@@ -397,6 +398,7 @@ pg_coder_needs_quotation_get(VALUE self)
|
|
397
398
|
* Specifies the character that separates values within the composite type.
|
398
399
|
* The default is a comma.
|
399
400
|
* This must be a single one-byte character.
|
401
|
+
* It is only used by text coders and ignored by binary coders.
|
400
402
|
*/
|
401
403
|
static VALUE
|
402
404
|
pg_coder_delimiter_set(VALUE self, VALUE delimiter)
|
data/ext/pg_result.c
CHANGED
@@ -617,7 +617,7 @@ pgresult_error_message(VALUE self)
|
|
617
617
|
* call-seq:
|
618
618
|
* res.verbose_error_message( verbosity, show_context ) -> String
|
619
619
|
*
|
620
|
-
* Returns a reformatted version of the error message associated with
|
620
|
+
* Returns a reformatted version of the error message associated with the PG::Result object.
|
621
621
|
*
|
622
622
|
*/
|
623
623
|
static VALUE
|
@@ -734,9 +734,9 @@ pgresult_nfields(VALUE self)
|
|
734
734
|
* call-seq:
|
735
735
|
* res.binary_tuples() -> Integer
|
736
736
|
*
|
737
|
-
* Returns 1 if the
|
737
|
+
* Returns 1 if the PG::Result contains binary data and 0 if it contains text data.
|
738
738
|
*
|
739
|
-
* This function is deprecated (except for its use in connection with COPY), because it is possible for a single
|
739
|
+
* This function is deprecated (except for its use in connection with COPY), because it is possible for a single PG::Result to contain text data in some columns and binary data in others.
|
740
740
|
* Result#fformat is preferred. binary_tuples returns 1 only if all columns of the result are binary (format 1).
|
741
741
|
*/
|
742
742
|
static VALUE
|
@@ -1402,7 +1402,7 @@ pgresult_fields(VALUE self)
|
|
1402
1402
|
* call-seq:
|
1403
1403
|
* res.type_map = typemap
|
1404
1404
|
*
|
1405
|
-
* Set the TypeMap that is used for type casts of result values to ruby objects.
|
1405
|
+
* Set the PG::TypeMap that is used for type casts of result values to ruby objects.
|
1406
1406
|
*
|
1407
1407
|
* All value retrieval methods will respect the type map and will do the
|
1408
1408
|
* type casts from PostgreSQL's wire format to Ruby objects on the fly,
|
@@ -1432,7 +1432,7 @@ pgresult_type_map_set(VALUE self, VALUE typemap)
|
|
1432
1432
|
* call-seq:
|
1433
1433
|
* res.type_map -> value
|
1434
1434
|
*
|
1435
|
-
* Returns the TypeMap that is currently set for type casts of result values to ruby objects.
|
1435
|
+
* Returns the PG::TypeMap that is currently set for type casts of result values to ruby objects.
|
1436
1436
|
*
|
1437
1437
|
*/
|
1438
1438
|
static VALUE
|
@@ -1572,8 +1572,8 @@ pgresult_stream_any(VALUE self, int (*yielder)(VALUE, int, int, void*), void* da
|
|
1572
1572
|
* wrapping each row into a dedicated result object, it delivers data in nearly
|
1573
1573
|
* the same speed as with ordinary results.
|
1574
1574
|
*
|
1575
|
-
* The base result must be in status PGRES_SINGLE_TUPLE or PGRES_TUPLES_CHUNK
|
1576
|
-
* It iterates over all tuples until the status changes to PGRES_TUPLES_OK
|
1575
|
+
* The base result must be in status +PGRES_SINGLE_TUPLE+ or +PGRES_TUPLES_CHUNK+.
|
1576
|
+
* It iterates over all tuples until the status changes to +PGRES_TUPLES_OK+.
|
1577
1577
|
* A PG::Error is raised for any errors from the server.
|
1578
1578
|
*
|
1579
1579
|
* Row description data does not change while the iteration. All value retrieval
|
data/ext/pg_text_decoder.c
CHANGED
@@ -579,7 +579,7 @@ pg_text_dec_from_base64(t_pg_coder *conv, const char *val, int len, int tuple, i
|
|
579
579
|
/* create a buffer of the expected decoded length */
|
580
580
|
VALUE out_value = rb_str_new(NULL, BASE64_DECODED_SIZE(len));
|
581
581
|
|
582
|
-
decoded_len =
|
582
|
+
decoded_len = rbpg_base64_decode( RSTRING_PTR(out_value), val, len );
|
583
583
|
rb_str_set_len(out_value, decoded_len);
|
584
584
|
|
585
585
|
/* Is it a pure String conversion? Then we can directly send out_value to the user. */
|
data/ext/pg_text_encoder.c
CHANGED
@@ -784,7 +784,7 @@ pg_text_enc_to_base64(t_pg_coder *conv, VALUE value, char *out, VALUE *intermedi
|
|
784
784
|
if(out){
|
785
785
|
/* Second encoder pass, if required */
|
786
786
|
strlen = enc_func(this->elem, value, out, intermediate, enc_idx);
|
787
|
-
|
787
|
+
rbpg_base64_encode( out, out, strlen );
|
788
788
|
|
789
789
|
return BASE64_ENCODED_SIZE(strlen);
|
790
790
|
} else {
|
@@ -799,7 +799,7 @@ pg_text_enc_to_base64(t_pg_coder *conv, VALUE value, char *out, VALUE *intermedi
|
|
799
799
|
out_str = rb_str_new(NULL, BASE64_ENCODED_SIZE(strlen));
|
800
800
|
PG_ENCODING_SET_NOCHECK(out_str, enc_idx);
|
801
801
|
|
802
|
-
|
802
|
+
rbpg_base64_encode( RSTRING_PTR(out_str), RSTRING_PTR(subint), strlen);
|
803
803
|
*intermediate = out_str;
|
804
804
|
|
805
805
|
return -1;
|
data/ext/pg_tuple.c
CHANGED
@@ -242,10 +242,10 @@ pg_tuple_materialize(VALUE self)
|
|
242
242
|
* An integer +key+ is interpreted as column index.
|
243
243
|
* Negative values of index count from the end of the array.
|
244
244
|
*
|
245
|
-
* Depending on Result#field_name_type= a string or symbol +key+ is interpreted as column name.
|
245
|
+
* Depending on PG::Result#field_name_type= a string or symbol +key+ is interpreted as column name.
|
246
246
|
*
|
247
247
|
* If the key can't be found, there are several options:
|
248
|
-
* With no other arguments, it will raise a IndexError exception;
|
248
|
+
* With no other arguments, it will raise a +IndexError+ exception;
|
249
249
|
* if default is given, then that will be returned;
|
250
250
|
* if the optional code block is specified, then that will be run and its result returned.
|
251
251
|
*/
|
@@ -302,7 +302,7 @@ pg_tuple_fetch(int argc, VALUE *argv, VALUE self)
|
|
302
302
|
* An integer +key+ is interpreted as column index.
|
303
303
|
* Negative values of index count from the end of the array.
|
304
304
|
*
|
305
|
-
* Depending on Result#field_name_type= a string or symbol +key+ is interpreted as column name.
|
305
|
+
* Depending on PG::Result#field_name_type= a string or symbol +key+ is interpreted as column name.
|
306
306
|
*
|
307
307
|
* If the key can't be found, it returns +nil+ .
|
308
308
|
*/
|
@@ -405,7 +405,7 @@ pg_tuple_each_value(VALUE self)
|
|
405
405
|
* tup.values -> Array
|
406
406
|
*
|
407
407
|
* Returns the values of this tuple as Array.
|
408
|
-
*
|
408
|
+
* <tt>res.tuple(i).values</tt> is equal to <tt>res.tuple_values(i)</tt> .
|
409
409
|
*/
|
410
410
|
static VALUE
|
411
411
|
pg_tuple_values(VALUE self)
|
@@ -474,7 +474,7 @@ pg_tuple_dump(VALUE self)
|
|
474
474
|
values = rb_ary_new4(this->num_fields, &this->values[0]);
|
475
475
|
a = rb_ary_new3(2, field_names, values);
|
476
476
|
|
477
|
-
|
477
|
+
rb_copy_generic_ivar(a, self);
|
478
478
|
|
479
479
|
return a;
|
480
480
|
}
|
data/ext/pg_type_map.c
CHANGED
@@ -187,7 +187,9 @@ init_pg_type_map(void)
|
|
187
187
|
*
|
188
188
|
* This is the base class for type maps.
|
189
189
|
* See derived classes for implementations of different type cast strategies
|
190
|
-
* ( PG::TypeMapByColumn, PG::TypeMapByOid ).
|
190
|
+
* ( PG::TypeMapByColumn, PG::TypeMapByOid, etc.).
|
191
|
+
*
|
192
|
+
* Find more type maps in the {README}[rdoc-ref:README.md@Type+Casts].
|
191
193
|
*
|
192
194
|
*/
|
193
195
|
rb_cTypeMap = rb_define_class_under( rb_mPG, "TypeMap", rb_cObject );
|
data/ext/pg_util.c
CHANGED
@@ -15,7 +15,7 @@ static const char base64_encode_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijk
|
|
15
15
|
* in-place (with _out_ == _in_).
|
16
16
|
*/
|
17
17
|
void
|
18
|
-
|
18
|
+
rbpg_base64_encode( char *out, const char *in, int len)
|
19
19
|
{
|
20
20
|
const unsigned char *in_ptr = (const unsigned char *)in + len;
|
21
21
|
char *out_ptr = out + BASE64_ENCODED_SIZE(len);
|
@@ -72,7 +72,7 @@ static const unsigned char base64_decode_table[] =
|
|
72
72
|
* It is possible to decode a string in-place (with _out_ == _in_).
|
73
73
|
*/
|
74
74
|
int
|
75
|
-
|
75
|
+
rbpg_base64_decode( char *out, const char *in, unsigned int len)
|
76
76
|
{
|
77
77
|
unsigned char a, b, c, d;
|
78
78
|
const unsigned char *in_ptr = (const unsigned char *)in;
|
data/ext/pg_util.h
CHANGED
@@ -57,8 +57,8 @@
|
|
57
57
|
#define BASE64_ENCODED_SIZE(strlen) (((strlen) + 2) / 3 * 4)
|
58
58
|
#define BASE64_DECODED_SIZE(base64len) (((base64len) + 3) / 4 * 3)
|
59
59
|
|
60
|
-
void
|
61
|
-
int
|
60
|
+
void rbpg_base64_encode( char *out, const char *in, int len);
|
61
|
+
int rbpg_base64_decode( char *out, const char *in, unsigned int len);
|
62
62
|
|
63
63
|
int rbpg_strncasecmp(const char *s1, const char *s2, size_t n);
|
64
64
|
|
data/lib/3.4/pg_ext.so
CHANGED
Binary file
|
data/lib/pg/coder.rb
CHANGED
@@ -72,12 +72,13 @@ module PG
|
|
72
72
|
|
73
73
|
class CompositeCoder < Coder
|
74
74
|
def to_h
|
75
|
-
{ **super,
|
75
|
+
h = { **super,
|
76
76
|
elements_type: elements_type,
|
77
77
|
needs_quotation: needs_quotation?,
|
78
78
|
delimiter: delimiter,
|
79
|
-
dimensions: dimensions,
|
80
79
|
}
|
80
|
+
h[:dimensions] = dimensions if dimensions # Write only when set, for Marshal compat with pg<1.6
|
81
|
+
h
|
81
82
|
end
|
82
83
|
|
83
84
|
def inspect
|
data/lib/pg/connection.rb
CHANGED
@@ -763,7 +763,7 @@ class PG::Connection
|
|
763
763
|
ihosts = iopts[:host]&.split(",", -1)
|
764
764
|
ihostaddrs = iopts[:hostaddr]&.split(",", -1)
|
765
765
|
iports = iopts[:port]&.split(",", -1)
|
766
|
-
iports = iports * (ihosts || ihostaddrs).size if iports&.size == 1
|
766
|
+
iports = iports * (ihosts || ihostaddrs || [1]).size if iports&.size == 1
|
767
767
|
|
768
768
|
idx = (ihosts || ihostaddrs || iports).index.with_index do |_, i|
|
769
769
|
(ihosts ? ihosts[i] == host : true) &&
|
@@ -863,7 +863,9 @@ class PG::Connection
|
|
863
863
|
# - All hosts are resolved before the first connection is tried.
|
864
864
|
# This means that when +load_balance_hosts+ is set to +random+, then all resolved addresses are tried randomly in one level.
|
865
865
|
# When a host resolves to more than one address, it is therefore tried more often than a host that has only one address.
|
866
|
-
# - When a timeout occurs due to the value of +connect_timeout+, then the given +host+, +hostaddr+ and +port+ combination is not tried a second time, even if it
|
866
|
+
# - When a timeout occurs due to the value of +connect_timeout+, then the given +host+, +hostaddr+ and +port+ combination is not tried a second time, even if it's specified several times.
|
867
|
+
# It's still possible to do load balancing with +load_balance_hosts+ set to +random+ and to increase the number of connections a node gets, when the hostname is provided multiple times in the host string.
|
868
|
+
# This is because in non-timeout cases the host is tried multiple times.
|
867
869
|
#
|
868
870
|
def new(*args)
|
869
871
|
conn = connect_to_hosts(*args)
|
data/lib/pg/version.rb
CHANGED
data/lib/pg.rb
CHANGED
@@ -5,140 +5,161 @@
|
|
5
5
|
# The top-level PG namespace.
|
6
6
|
module PG
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
8
|
+
# Is this file part of a fat binary gem with bundled libpq?
|
9
|
+
# This path must be enabled by add_dll_directory on Windows.
|
10
|
+
gplat = Gem::Platform.local
|
11
|
+
bundled_libpq_path = Dir[File.expand_path("../ports/#{gplat.cpu}-#{gplat.os}*/lib", __dir__)].first
|
12
|
+
if bundled_libpq_path
|
13
|
+
POSTGRESQL_LIB_PATH = bundled_libpq_path
|
14
|
+
else
|
15
|
+
# Try to load libpq path as found by extconf.rb
|
16
|
+
begin
|
17
|
+
require "pg/postgresql_lib_path"
|
18
|
+
rescue LoadError
|
19
|
+
# rake-compiler doesn't use regular "make install", but uses it's own install tasks.
|
20
|
+
# It therefore doesn't copy pg/postgresql_lib_path.rb in case of "rake compile".
|
21
|
+
POSTGRESQL_LIB_PATH = false
|
22
|
+
end
|
23
|
+
end
|
24
|
+
POSTGRESQL_LIB_PATH.freeze
|
25
|
+
|
26
|
+
add_dll_path = proc do |path, &block|
|
27
|
+
if RUBY_PLATFORM =~/(mswin|mingw)/i && path
|
28
|
+
BUNDLED_LIBPQ_WITH_UNIXSOCKET = false
|
29
|
+
begin
|
30
|
+
require 'ruby_installer/runtime'
|
31
|
+
RubyInstaller::Runtime.add_dll_directory(path, &block)
|
32
|
+
rescue LoadError
|
33
|
+
old_path = ENV['PATH']
|
34
|
+
ENV['PATH'] = "#{path};#{old_path}"
|
35
|
+
block.call
|
36
|
+
ENV['PATH'] = old_path
|
37
|
+
end
|
38
|
+
else
|
39
|
+
# libpq is found by a relative rpath in the cross compiled extension dll
|
40
|
+
# or by the system library loader
|
41
|
+
block.call
|
42
|
+
BUNDLED_LIBPQ_WITH_UNIXSOCKET = RUBY_PLATFORM=~/linux/i && PG::IS_BINARY_GEM
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Add a load path to the one retrieved from pg_config
|
47
|
+
add_dll_path.call(POSTGRESQL_LIB_PATH) do
|
48
|
+
begin
|
49
|
+
# Try the <major>.<minor> subdirectory for fat binary gems
|
50
|
+
major_minor = RUBY_VERSION[ /^(\d+\.\d+)/ ] or
|
51
|
+
raise "Oops, can't extract the major/minor version from #{RUBY_VERSION.dump}"
|
52
|
+
require "#{major_minor}/pg_ext"
|
53
|
+
rescue LoadError => error1
|
54
|
+
begin
|
55
|
+
require 'pg_ext'
|
56
|
+
rescue LoadError => error2
|
57
|
+
msg = <<~EOT
|
58
|
+
pg's C extension failed to load:
|
59
|
+
#{error1}
|
60
|
+
#{error2}
|
61
|
+
EOT
|
62
|
+
if msg =~ /GLIBC/
|
63
|
+
msg += <<~EOT
|
64
|
+
|
65
|
+
The GLIBC version of this system seems too old. Please use the source version of pg:
|
66
|
+
gem uninstall pg --all
|
67
|
+
gem install pg --platform ruby
|
68
|
+
or in your Gemfile:
|
69
|
+
gem "pg", force_ruby_platform: true
|
70
|
+
See also: https://deveiate.org/code/pg/README_md.html#label-Source+gem
|
71
|
+
EOT
|
72
|
+
end
|
73
|
+
raise error2, msg
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Get the PG library version.
|
79
|
+
#
|
80
|
+
# +include_buildnum+ is no longer used and any value passed will be ignored.
|
81
|
+
def self.version_string( include_buildnum=nil )
|
82
|
+
"%s %s" % [ self.name, VERSION ]
|
83
|
+
end
|
84
|
+
|
85
|
+
|
86
|
+
### Convenience alias for PG::Connection.new.
|
87
|
+
def self.connect( *args, &block )
|
88
|
+
Connection.new( *args, &block )
|
89
|
+
end
|
90
|
+
|
91
|
+
if defined?(Ractor.make_shareable)
|
92
|
+
def self.make_shareable(obj)
|
93
|
+
Ractor.make_shareable(obj)
|
94
|
+
end
|
95
|
+
else
|
96
|
+
def self.make_shareable(obj)
|
97
|
+
obj.freeze
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
module BinaryDecoder
|
102
|
+
%i[ TimestampUtc TimestampUtcToLocal TimestampLocal ].each do |klass|
|
103
|
+
autoload klass, 'pg/binary_decoder/timestamp'
|
104
|
+
end
|
105
|
+
autoload :Date, 'pg/binary_decoder/date'
|
106
|
+
end
|
107
|
+
module BinaryEncoder
|
108
|
+
%i[ TimestampUtc TimestampLocal ].each do |klass|
|
109
|
+
autoload klass, 'pg/binary_encoder/timestamp'
|
110
|
+
end
|
111
|
+
end
|
112
|
+
module TextDecoder
|
113
|
+
%i[ TimestampUtc TimestampUtcToLocal TimestampLocal TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass|
|
114
|
+
autoload klass, 'pg/text_decoder/timestamp'
|
115
|
+
end
|
116
|
+
autoload :Date, 'pg/text_decoder/date'
|
117
|
+
autoload :Inet, 'pg/text_decoder/inet'
|
118
|
+
autoload :JSON, 'pg/text_decoder/json'
|
119
|
+
autoload :Numeric, 'pg/text_decoder/numeric'
|
120
|
+
end
|
121
|
+
module TextEncoder
|
122
|
+
%i[ TimestampUtc TimestampWithoutTimeZone TimestampWithTimeZone ].each do |klass|
|
123
|
+
autoload klass, 'pg/text_encoder/timestamp'
|
124
|
+
end
|
125
|
+
autoload :Date, 'pg/text_encoder/date'
|
126
|
+
autoload :Inet, 'pg/text_encoder/inet'
|
127
|
+
autoload :JSON, 'pg/text_encoder/json'
|
128
|
+
autoload :Numeric, 'pg/text_encoder/numeric'
|
129
|
+
end
|
130
|
+
|
131
|
+
autoload :BasicTypeMapBasedOnResult, 'pg/basic_type_map_based_on_result'
|
132
|
+
autoload :BasicTypeMapForQueries, 'pg/basic_type_map_for_queries'
|
133
|
+
autoload :BasicTypeMapForResults, 'pg/basic_type_map_for_results'
|
134
|
+
autoload :BasicTypeRegistry, 'pg/basic_type_registry'
|
135
|
+
require 'pg/exceptions'
|
136
|
+
require 'pg/coder'
|
137
|
+
require 'pg/type_map_by_column'
|
138
|
+
require 'pg/connection'
|
139
|
+
require 'pg/cancel_connection'
|
140
|
+
require 'pg/result'
|
141
|
+
require 'pg/tuple'
|
142
|
+
autoload :VERSION, 'pg/version'
|
143
|
+
|
144
|
+
|
145
|
+
# Avoid "uninitialized constant Truffle::WarningOperations" on Truffleruby up to 22.3.1
|
146
|
+
if RUBY_ENGINE=="truffleruby" && !defined?(Truffle::WarningOperations)
|
147
|
+
module TruffleFixWarn
|
148
|
+
def warn(str, category=nil)
|
149
|
+
super(str)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
Warning.extend(TruffleFixWarn)
|
153
|
+
end
|
154
|
+
|
155
|
+
# Ruby-3.4+ prints a warning, if bigdecimal is required but not in the Gemfile.
|
156
|
+
# But it's a false positive, since we enable bigdecimal depending features only if it's available.
|
157
|
+
# And most people don't need these features.
|
158
|
+
def self.require_bigdecimal_without_warning
|
159
|
+
oldverb, $VERBOSE = $VERBOSE, nil
|
160
|
+
require "bigdecimal"
|
161
|
+
ensure
|
162
|
+
$VERBOSE = oldverb
|
163
|
+
end
|
143
164
|
|
144
165
|
end # module PG
|
@@ -0,0 +1,20 @@
|
|
1
|
+
FROM debian:10.13
|
2
|
+
|
3
|
+
WORKDIR /pg
|
4
|
+
|
5
|
+
# Debian 10.13 is EOL now:
|
6
|
+
RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list
|
7
|
+
|
8
|
+
RUN apt-get update && apt-get install ruby git wget gcc make libz-dev libffi-dev libreadline-dev libyaml-dev libssl-dev -y
|
9
|
+
|
10
|
+
ENV RBENV_ROOT=/usr/local/rbenv
|
11
|
+
|
12
|
+
RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
|
13
|
+
git clone https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \
|
14
|
+
$RBENV_ROOT/bin/rbenv init
|
15
|
+
|
16
|
+
RUN $RBENV_ROOT/bin/rbenv install 3.3.9 -- --disable-install-doc
|
17
|
+
RUN /usr/local/rbenv/versions/3.3.9/bin/gem inst rspec
|
18
|
+
|
19
|
+
CMD /usr/local/rbenv/versions/3.3.9/bin/gem inst --local pg-*.gem && \
|
20
|
+
/usr/local/rbenv/versions/3.3.9/bin/rspec glibc_spec.rb
|
Binary file
|
@@ -0,0 +1,12 @@
|
|
1
|
+
diff --git a/src/lib/krb5/krb/deltat.c b/src/lib/krb5/krb/deltat.c
|
2
|
+
index 03145c854..34cdf969e 100644
|
3
|
+
--- a/lib/krb5/krb/deltat.c
|
4
|
+
+++ b/lib/krb5/krb/deltat.c
|
5
|
+
@@ -44,7 +44,6 @@
|
6
|
+
#ifdef __GNUC__
|
7
|
+
#pragma GCC diagnostic push
|
8
|
+
#pragma GCC diagnostic ignored "-Wuninitialized"
|
9
|
+
-#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
10
|
+
#endif
|
11
|
+
|
12
|
+
#include "k5-int.h"
|
data.tar.gz.sig
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
���
|
2
|
-
|
3
|
-
�
|
4
|
-
�5Z�6Wgj%Ԫ'&�
|
1
|
+
-�ɂs)t���V S��^oY� �;:������(oΒx�����"�
|
2
|
+
Mpl�Kǐ�3M���s0�����ȹ}w.ML��S1�3�l9�ҥ��P<�A61Qh)�Z�����8��
|
3
|
+
o���a�}�
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: aarch64-mingw-ucrt
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -33,7 +33,7 @@ cert_chain:
|
|
33
33
|
DrkJ9tVlPQtJB0LqT0tvBap4upnwT1xYq721b5dwH6AF4Pi6iz/dc5vnq1/MH8bV
|
34
34
|
8VbbBzzeE7MsvgkP3sHlLmY8PtuyViJ8
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
36
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
37
37
|
dependencies: []
|
38
38
|
description: Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL
|
39
39
|
10 and later.
|
@@ -176,6 +176,9 @@ files:
|
|
176
176
|
- lib/pg/tuple.rb
|
177
177
|
- lib/pg/type_map_by_column.rb
|
178
178
|
- lib/pg/version.rb
|
179
|
+
- misc/glibc/Dockerfile
|
180
|
+
- misc/glibc/docker-compose.yml
|
181
|
+
- misc/glibc/glibc_spec.rb
|
179
182
|
- misc/openssl-pg-segfault.rb
|
180
183
|
- misc/postgres/History.txt
|
181
184
|
- misc/postgres/Manifest.txt
|
@@ -192,10 +195,11 @@ files:
|
|
192
195
|
- misc/yugabyte/pg-test.rb
|
193
196
|
- pg.gemspec
|
194
197
|
- ports/aarch64-mingw-ucrt/lib/libpq.dll
|
195
|
-
- ports/patches/krb5/1.
|
196
|
-
- ports/patches/
|
197
|
-
- ports/patches/
|
198
|
-
- ports/patches/postgresql/17.
|
198
|
+
- ports/patches/krb5/1.22.1/0001-Allow-static-linking-krb5-library.patch
|
199
|
+
- ports/patches/krb5/1.22.1/0002-unknown-command-line-option-on-clang.patch
|
200
|
+
- ports/patches/openssl/3.5.2/0001-aarch64-mingw.patch
|
201
|
+
- ports/patches/postgresql/17.6/0001-Use-workaround-of-__builtin_setjmp-only-on-MINGW-on-.patch
|
202
|
+
- ports/patches/postgresql/17.6/0001-libpq-Process-buffered-SSL-read-bytes-to-support-rec.patch
|
199
203
|
- rakelib/pg_gem_helper.rb
|
200
204
|
- rakelib/task_extension.rb
|
201
205
|
- sample/array_insert.rb
|
@@ -225,7 +229,6 @@ metadata:
|
|
225
229
|
source_code_uri: https://github.com/ged/ruby-pg
|
226
230
|
changelog_uri: https://github.com/ged/ruby-pg/blob/master/CHANGELOG.md
|
227
231
|
documentation_uri: http://deveiate.org/code/pg
|
228
|
-
msys2_mingw_dependencies: postgresql
|
229
232
|
rdoc_options:
|
230
233
|
- "--main"
|
231
234
|
- README.md
|
@@ -247,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
250
|
- !ruby/object:Gem::Version
|
248
251
|
version: '0'
|
249
252
|
requirements: []
|
250
|
-
rubygems_version: 3.6.
|
253
|
+
rubygems_version: 3.6.9
|
251
254
|
specification_version: 4
|
252
255
|
summary: Pg is the Ruby interface to the PostgreSQL RDBMS
|
253
256
|
test_files: []
|
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
���.�/�����ޟM(`��9l���x�,��M1���aT��]�œ��+$o65�dLc�"�f��dl�ވ
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|