sqlite3 1.5.0.rc1-aarch64-linux → 1.5.0.rc2-aarch64-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: 198e73330e05c4276212f8009f2fc7c04ceb8b973a38ca62dece4eb9ba26c02a
4
- data.tar.gz: 67b6d5a69c58159d8caf44794ba019af0ae7bf9d8a0eba1a6fa43351e7ad0291
3
+ metadata.gz: 8d70928612f54b30f44495cd9b70238532bfe9ef0851b69f85a0738c9a9ddc6e
4
+ data.tar.gz: 9ec1eb6ecaa82acbc7b3ac87c58ae189b0949fff2cade1e8f8b6fdffe7e0c9b6
5
5
  SHA512:
6
- metadata.gz: a973371aeee2cdf056b36f44e74baca1ef230008d3b24e7aafb0e8df76fc84d9475edd90e1dfbbe137cab0401616b373a240f0baf1326529bdc8604e0850a841
7
- data.tar.gz: 2222a5223391656f362748da37678f65c8625d45f1b517c9c32dc4826cf07b42482fe350c8fb5119e07efe6ed2a60edba3a43fec6c33aad53a73208bdac646c2
6
+ metadata.gz: b64408a11202ff40ed5266e16ccb4d285eac91a5b3add15885539dc1bd20bb51e6439762bc4ce6992412ef1f756a4a2afa80d40ebb9f95aeb60efb21e9924e7e
7
+ data.tar.gz: f280afb22d8b3399bea201f1c22b62de8317562aedb65366eb64b66d3aabd1070f309d5970016b8c7ba2b2b4fb293dc314492dee6ae1fc8ab4e63c6c04148b4a
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: aarch64-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