sqlite3 1.5.0.rc1-arm-linux → 1.5.0.rc2-arm-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb021bcd830b6f8f3f7bcbd34d900c71b7465c9edc290d654c574af9db56225b
4
- data.tar.gz: 489bb2ed0b97919def407d11d9563a23148ef6c471ff254bccf8149217d729b5
3
+ metadata.gz: ac7285f3833251c16b52667f587512ab71b4d503bc1b5cba4d886c144d48b2de
4
+ data.tar.gz: e60321cff4535072475fd15a996d3fde1d67f150d66c503ae29e9ad6562ae9fd
5
5
  SHA512:
6
- metadata.gz: 306f49ab8ac6b987891e9d3dd8c16e59cb91cf44e4b8087bc7c819aa699791d9ef2d44566cd10e4bdd9728ccc1c20c87ee7f777317c600f31a9b34625ed7a6d7
7
- data.tar.gz: 568912cab905969a2d65082bce1e32eceaaaa6eb3a66204a3228a0d834388093b8ecb5445614cdeb33744aae05c16ba0494d6c2fece87cf9c27f092c49756c83
6
+ metadata.gz: 879a903f83d6e8a3dfd7ec0a90ddf15a7b29b60eb234b935e8ad2481e845b20de84d02678c28c02c5082724454f24eeba46e251fc8c8e0329866ef32bb6ec254
7
+ data.tar.gz: dd6844120fc41826d3d1a91c98f6a66c16b4a041341ba9eb2b7ec56d9fac0567a758545345313851908f4281c0df7c6104b9ca31d25ac0756d4b0df41523767a
data/CHANGELOG.md CHANGED
@@ -23,7 +23,7 @@ See [the README](https://github.com/sparklemotion/sqlite3-ruby#native-gems-recom
23
23
 
24
24
  #### More consistent developer experience
25
25
 
26
- Both the native (precompiled) gems and the vanilla "ruby platform" (source) gem include sqlite v3.39.0 by default.
26
+ Both the native (precompiled) gems and the vanilla "ruby platform" (source) gem include sqlite v3.39.2 by default.
27
27
 
28
28
  Defaulting to a consistent version of sqlite across all systems means that your development environment behaves exactly like your production environment, and you have access to the latest and greatest features of sqlite.
29
29
 
@@ -36,6 +36,7 @@ You can opt-out of the packaged version of sqlite (and use your system-installed
36
36
 
37
37
  * TruffleRuby is supported.
38
38
  * Apple Silicon is supported (M1, arm64-darwin).
39
+ * vcpkg system libraries supported. [#332] (Thanks, @MSP-Greg!)
39
40
 
40
41
 
41
42
  ### Added
@@ -43,6 +44,11 @@ You can opt-out of the packaged version of sqlite (and use your system-installed
43
44
  * `SQLite3::SQLITE_LOADED_VERSION` contains the version string of the sqlite3 library that is dynamically loaded (compare to `SQLite3::SQLITE_VERSION` which is the version at compile-time).
44
45
 
45
46
 
47
+ ### Fixed
48
+
49
+ * `SQLite3::Database#load_extensions` now raises a `TypeError` unless a String is passed as the file path. Previously it was possible to pass a non-string and cause a segfault. [#339]
50
+
51
+
46
52
  ## 1.4.4 / 2022-06-14
47
53
 
48
54
  ### Fixes
@@ -31,7 +31,7 @@ static char *
31
31
  utf16_string_value_ptr(VALUE str)
32
32
  {
33
33
  StringValue(str);
34
- rb_str_buf_cat(str, "\x00", 1L);
34
+ rb_str_buf_cat(str, "\x00\x00", 2L);
35
35
  return RSTRING_PTR(str);
36
36
  }
37
37
 
@@ -603,7 +603,7 @@ static VALUE load_extension(VALUE self, VALUE file)
603
603
  Data_Get_Struct(self, sqlite3Ruby, ctx);
604
604
  REQUIRE_OPEN_DB(ctx);
605
605
 
606
- status = sqlite3_load_extension(ctx->db, RSTRING_PTR(file), 0, &errMsg);
606
+ status = sqlite3_load_extension(ctx->db, StringValuePtr(file), 0, &errMsg);
607
607
  if (status != SQLITE_OK)
608
608
  {
609
609
  errexp = rb_exc_new2(rb_eRuntimeError, errMsg);
@@ -36,19 +36,26 @@ module Sqlite3
36
36
  end
37
37
 
38
38
  def sqlcipher?
39
- with_config("sqlcipher")
39
+ with_config("sqlcipher") ||
40
+ with_config("sqlcipher-dir") ||
41
+ with_config("sqlcipher-include") ||
42
+ with_config("sqlcipher-lib")
40
43
  end
41
44
 
42
45
  def configure_system_libraries
43
46
  pkg_config(libname)
44
- append_cflags("-DUSING_SQLCIPHER") if sqlcipher?
47
+ append_cppflags("-DUSING_SQLCIPHER") if sqlcipher?
45
48
  end
46
49
 
47
50
  def configure_packaged_libraries
48
51
  minimal_recipe.tap do |recipe|
49
52
  recipe.configure_options += ["--enable-shared=no", "--enable-static=yes"]
50
53
  ENV.to_h.tap do |env|
51
- env["CFLAGS"] = [env["CFLAGS"], "-fPIC"].join(" ") # needed for linking the static library into a shared library
54
+ additional_cflags = [
55
+ "-fPIC", # needed for linking the static library into a shared library
56
+ "-O2", # see https://github.com/sparklemotion/sqlite3-ruby/issues/335 for some benchmarks
57
+ ]
58
+ env["CFLAGS"] = [env["CFLAGS"], additional_cflags].flatten.join(" ")
52
59
  recipe.configure_options += env.select { |k,v| ENV_ALLOWLIST.include?(k) }
53
60
  .map { |key, value| "#{key}=#{value.strip}" }
54
61
  end
@@ -72,10 +79,17 @@ module Sqlite3
72
79
 
73
80
  def configure_extension
74
81
  if Gem::Requirement.new("< 2.7").satisfied_by?(Gem::Version.new(RUBY_VERSION))
75
- append_cflags("-DTAINTING_SUPPORT")
82
+ append_cppflags("-DTAINTING_SUPPORT")
83
+ end
84
+
85
+ if find_header("sqlite3.h")
86
+ # noop
87
+ elsif sqlcipher? && find_header("sqlcipher/sqlite3.h")
88
+ append_cppflags("-DUSING_SQLCIPHER_INC_SUBDIR")
89
+ else
90
+ abort_could_not_find("sqlite3.h")
76
91
  end
77
92
 
78
- abort_could_not_find("sqlite3.h") unless find_header("sqlite3.h")
79
93
  abort_could_not_find(libname) unless find_library(libname, "sqlite3_libversion_number", "sqlite3.h")
80
94
 
81
95
  # Functions defined in 1.9 but not 1.8
@@ -121,16 +135,16 @@ module Sqlite3
121
135
  sqlite3: {
122
136
  # checksum verified by first checking the published sha3(256) checksum:
123
137
  #
124
- # $ sha3sum -a 256 sqlite-autoconf-3390000.tar.gz
125
- # b8e5b3265992350d40c4ad31efc2e6dec6256813f1d5acc8f0ea805e9f33ca2a sqlite-autoconf-3390000.tar.gz
138
+ # $ sha3sum -a 256 ports/archives/sqlite-autoconf-3390200.tar.gz
139
+ # b195891eb32305481e61c6718b8cc3b090685b613c4824a076c63166a46c5bee ports/archives/sqlite-autoconf-3390200.tar.gz
126
140
  #
127
- # $ sha256sum sqlite-autoconf-3390000.tar.gz
128
- # e90bcaef6dd5813fcdee4e867f6b65f3c9bfd0aec0f1017f9f3bbce1e4ed09e2 sqlite-autoconf-3390000.tar.gz
141
+ # $ sha256sum ports/archives/sqlite-autoconf-3390200.tar.gz
142
+ # 852be8a6183a17ba47cee0bbff7400b7aa5affd283bf3beefc34fcd088a239de ports/archives/sqlite-autoconf-3390200.tar.gz
129
143
  #
130
- version: "3.39.0",
144
+ version: "3.39.2",
131
145
  files: [{
132
- url: "https://www.sqlite.org/2022/sqlite-autoconf-3390000.tar.gz",
133
- sha256: "e90bcaef6dd5813fcdee4e867f6b65f3c9bfd0aec0f1017f9f3bbce1e4ed09e2",
146
+ url: "https://www.sqlite.org/2022/sqlite-autoconf-3390200.tar.gz",
147
+ sha256: "852be8a6183a17ba47cee0bbff7400b7aa5affd283bf3beefc34fcd088a239de",
134
148
  }],
135
149
  }
136
150
  }
@@ -147,10 +161,89 @@ module Sqlite3
147
161
  def download
148
162
  minimal_recipe.download
149
163
  end
164
+
165
+ def print_help
166
+ print(<<~TEXT)
167
+ USAGE: ruby #{$PROGRAM_NAME} [options]
168
+
169
+ Flags that are always valid:
170
+
171
+ --disable-system-libraries
172
+ Use the packaged libraries, and ignore the system libraries.
173
+ (This is the default behavior.)
174
+
175
+ --enable-system-libraries
176
+ Use system libraries instead of building and using the packaged libraries.
177
+
178
+ --with-sqlcipher
179
+ Use libsqlcipher instead of libsqlite3.
180
+ (Implies `--enable-system-libraries`.)
181
+
182
+ --help
183
+ Display this message.
184
+
185
+
186
+ Flags only used when using system libraries:
187
+
188
+ General (applying to all system libraries):
189
+
190
+ --with-opt-dir=DIRECTORY
191
+ Look for headers and libraries in DIRECTORY.
192
+
193
+ --with-opt-lib=DIRECTORY
194
+ Look for libraries in DIRECTORY.
195
+
196
+ --with-opt-include=DIRECTORY
197
+ Look for headers in DIRECTORY.
198
+
199
+ Related to sqlcipher:
200
+
201
+ --with-sqlcipher-dir=DIRECTORY
202
+ Look for sqlcipher headers and library in DIRECTORY.
203
+ (Implies `--with-sqlcipher` and `--enable-system-libraries`.)
204
+
205
+ --with-sqlcipher-lib=DIRECTORY
206
+ Look for sqlcipher library in DIRECTORY.
207
+ (Implies `--with-sqlcipher` and `--enable-system-libraries`.)
208
+
209
+ --with-sqlcipher-include=DIRECTORY
210
+ Look for sqlcipher headers in DIRECTORY.
211
+ (Implies `--with-sqlcipher` and `--enable-system-libraries`.)
212
+
213
+
214
+ Flags only used when building and using the packaged libraries:
215
+
216
+ --enable-cross-build
217
+ Enable cross-build mode. (You probably do not want to set this manually.)
218
+
219
+
220
+ Environment variables used for compiling the C extension:
221
+
222
+ CC
223
+ Use this path to invoke the compiler instead of `RbConfig::CONFIG['CC']`
224
+
225
+
226
+ Environment variables passed through to the compilation of packaged libraries:
227
+
228
+ CC
229
+ CPPFLAGS
230
+ CFLAGS
231
+ LDFLAGS
232
+ LIBS
233
+ LT_SYS_LIBRARY_PATH
234
+ CPP
235
+
236
+ TEXT
237
+ end
150
238
  end
151
239
  end
152
240
  end
153
241
 
242
+ if arg_config("--help")
243
+ Sqlite3::ExtConf.print_help
244
+ exit!(0)
245
+ end
246
+
154
247
  if arg_config("--download-dependencies")
155
248
  Sqlite3::ExtConf.download
156
249
  exit!(0)
@@ -21,8 +21,11 @@
21
21
  #define SQLITE3_UTF8_STR_NEW2(_obj) \
22
22
  (rb_enc_associate_index(rb_str_new2(_obj), rb_utf8_encindex()))
23
23
 
24
-
25
- #include <sqlite3.h>
24
+ #ifdef USING_SQLCIPHER_INC_SUBDIR
25
+ # include <sqlcipher/sqlite3.h>
26
+ #else
27
+ # include <sqlite3.h>
28
+ #endif
26
29
 
27
30
  #ifndef HAVE_TYPE_SQLITE3_INT64
28
31
  typedef sqlite_int64 sqlite3_int64;
Binary file
Binary file
Binary file
Binary file
@@ -1,13 +1,13 @@
1
1
  module SQLite3
2
2
 
3
- VERSION = "1.5.0.rc1"
3
+ VERSION = "1.5.0.rc2"
4
4
 
5
5
  module VersionProxy
6
6
 
7
7
  MAJOR = 1
8
8
  MINOR = 5
9
9
  TINY = 0
10
- BUILD = "rc1"
10
+ BUILD = "rc2"
11
11
 
12
12
  STRING = [ MAJOR, MINOR, TINY, BUILD ].compact.join( "." )
13
13
  #:beta-tag:
@@ -534,5 +534,12 @@ module SQLite3
534
534
  end
535
535
  assert_includes error.message, "no such column: nope"
536
536
  end
537
+
538
+ def test_load_extension_with_nonstring_argument
539
+ db = SQLite3::Database.new(':memory:')
540
+ skip("extensions are not enabled") unless db.respond_to?(:load_extension)
541
+ assert_raises(TypeError) { db.load_extension(1) }
542
+ assert_raises(TypeError) { db.load_extension(Pathname.new("foo.so")) }
543
+ end
537
544
  end
538
545
  end
data/test/test_sqlite3.rb CHANGED
@@ -19,7 +19,12 @@ module SQLite3
19
19
  end
20
20
 
21
21
  def test_version_strings
22
+ skip if SQLite3::VERSION.include?("test") # see set-version-to-timestamp rake task
22
23
  assert_equal(SQLite3::VERSION, SQLite3::VersionProxy::STRING)
23
24
  end
25
+
26
+ def test_compiled_version_and_loaded_version
27
+ assert_equal(SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION)
28
+ end
24
29
  end
25
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqlite3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.rc1
4
+ version: 1.5.0.rc2
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Jamis Buck
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-07-05 00:00:00.000000000 Z
13
+ date: 2022-08-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: minitest