leptris 1.9.378.0 → 1.9.379.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8009a7ae6886ecfdbcd4be82af9cfa2ac043734dbb8f3cf4fba7ca7565055919
4
- data.tar.gz: 0476a4718adec9afccf5c11e4a9782f84df752693257c2a7068135b586264698
3
+ metadata.gz: 74ef1df6d8241bd9e0f6af269a87288a34903074d82d2bf9e7dadf4165aefe7e
4
+ data.tar.gz: 1a25523b7838f59744641ab62a280e690defab63536ae64a43371329bc8d24cd
5
5
  SHA512:
6
- metadata.gz: 4c5bbdd3873bb0efd129412e72fb413edb03aa125adfd510834b9e6ffc0a3284b8810fbdc14fcc754c898539cb20696ec0969bee8fd375451234cbb0f056574e
7
- data.tar.gz: c34657768065c3d22f1e7c2d5816801aeeed98d94b27c68dfe1b976074a2231c61cafe6297dedf77a14ace65acbe77a6a44c0d6c5a1f41ec0db981531580080f
6
+ metadata.gz: a9c74c1ce88e3059bb12d9afc795e43551b1aa62c91a38cd3b5dd3dd1e980a2a0085a75ca2d0b1c1b2d5f96742a86c478608534dde4b64299623285b70895537
7
+ data.tar.gz: 8912c0630d7edcdc56321e6873679a22cd164baab9c4fec8f0ea7895e1bb9830dbe67e821fd79524e3abd684ea6f727952b9c686cf647c880d1bd10f7907f233
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [1.9.379.1] - 2026-10-21
2
+
3
+ ### Added — native layer
4
+
5
+ - **The element mint pre-writes the consumer contract in C
6
+ (leptris/leptris-ruby#523)**: `NativeNode.create_element` takes
7
+ optional `(context, adapter)` and writes `@native` (the identity
8
+ contract: the node itself), `@context` and `@adapter` before
9
+ returning, so moxml's builder hot path skips its Ruby prime pass
10
+ per created element. The binding-agnostic consumer gates itself
11
+ by an arity probe; the two-argument call is unchanged for
12
+ existing callers.
13
+
14
+ ## [1.9.379.0] - 2026-10-21
15
+
16
+ ### Fixed — engine sync (libleptris 1.9.379)
17
+
18
+ - **Source builds under GCC 14 (leptris/leptris#1806)**: the
19
+ template-foster diagnostic passed a cast node where the accessor
20
+ takes a `LeptrisNodeRef`; GCC 14 treats incompatible pointer
21
+ types as an error, so `rake compile` from source failed. The
22
+ cast is gone. Prebuilt gems are unaffected in behavior.
23
+
1
24
  ## [1.9.378.0] - 2026-10-21
2
25
 
3
26
  ### Fixed — engine sync (libleptris 1.9.378)
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
8
8
  # Pin for `rake compile` and the platform-gem builds. Keep in lockstep
9
9
  # with .github/workflows/build.yml (which calls `rake compile`) and the
10
10
  # CHANGELOG when libleptris releases.
11
- LIBLEPTRIS_VERSION = "1.9.378"
11
+ LIBLEPTRIS_VERSION = "1.9.379"
12
12
  # Vendored alongside libleptris for fn:normalize-unicode (TODO
13
13
  # .restructure/20): built per platform with a RELOCATABLE @rpath
14
14
  # install name, loaded by ffi.rb before libleptris so the
@@ -205,6 +205,7 @@ static VALUE c_leptris_error;
205
205
  static VALUE c_b_document, c_b_freed, c_ffi_pointer;
206
206
  static ID id_ptr_new, id_freed_new, id_alive;
207
207
  static ID id_iv_c_address, id_iv_document, id_iv_parent;
208
+ static ID id_iv_mx_context, id_iv_mx_adapter, id_iv_mx_native;
208
209
  static ID id_iv_structure_memoizable, id_iv_native_fast;
209
210
  static ID id_iv_pub_document, id_iv_addr_reads_fast, id_iv_node_type;
210
211
  static void check_status_c(int st);
@@ -1411,11 +1412,18 @@ static VALUE nf_insert_binding_child(VALUE self, VALUE document,
1411
1412
 
1412
1413
  /* Builder factories (#149): create in C, wrap as NativeNode — no
1413
1414
  * FFI::Pointer, no Ruby wrap_fresh path. */
1414
- static VALUE nn_create_element(VALUE klass, VALUE document, VALUE name)
1415
+ static VALUE nn_create_element(int argc, VALUE *argv, VALUE klass)
1415
1416
  {
1417
+ VALUE document, name, mx_context, mx_adapter;
1416
1418
  void *ptr;
1417
- VALUE mk = doc_klass_for_kind(document, 0);
1419
+ VALUE mk, node;
1418
1420
  (void)klass;
1421
+ /* Optional (context, adapter): when the consumer passes its
1422
+ * contract state, the mint pre-writes the ivars in C and the
1423
+ * consumer's Ruby prime pass disappears from the build path. */
1424
+ rb_scan_args(argc, argv, "22", &document, &name,
1425
+ &mx_context, &mx_adapter);
1426
+ mk = doc_klass_for_kind(document, 0);
1419
1427
  ptr = f_elem_create(doc_ptr_of(document), StringValueCStr(name));
1420
1428
  if (!ptr)
1421
1429
  rb_raise(c_runtime_error, "leptris_element_create failed");
@@ -1423,8 +1431,18 @@ static VALUE nn_create_element(VALUE klass, VALUE document, VALUE name)
1423
1431
  * the unattached create factories are the build path (moxml's
1424
1432
  * create_element per record); plain NativeNode here forced the
1425
1433
  * consumer into wrapper-mode bridging for the whole document. */
1426
- if (!NIL_P(mk))
1427
- return mint_consumer_node(mk, document, ptr);
1434
+ if (!NIL_P(mk)) {
1435
+ node = mint_consumer_node(mk, document, ptr);
1436
+ if (!NIL_P(mx_context)) {
1437
+ /* The identity contract (#508): @native is the node
1438
+ * itself — exactly what the consumer's prime pass wrote.
1439
+ * Writing it here lets that pass disappear. */
1440
+ rb_ivar_set(node, id_iv_mx_native, node);
1441
+ rb_ivar_set(node, id_iv_mx_context, mx_context);
1442
+ rb_ivar_set(node, id_iv_mx_adapter, mx_adapter);
1443
+ }
1444
+ return node;
1445
+ }
1428
1446
  return wrap_new(document, ptr);
1429
1447
  }
1430
1448
 
@@ -3525,6 +3543,9 @@ LEPTRIS_INIT_EXPORT void Init_native(void)
3525
3543
  id_iv_binding_cache = rb_intern("@wrapper_cache");
3526
3544
  id_iv_c_address = rb_intern("@c_address");
3527
3545
  id_iv_document = rb_intern("@document");
3546
+ id_iv_mx_context = rb_intern("@context");
3547
+ id_iv_mx_native = rb_intern("@native");
3548
+ id_iv_mx_adapter = rb_intern("@adapter");
3528
3549
  id_iv_parent = rb_intern("@parent");
3529
3550
  id_iv_structure_memoizable = rb_intern("@structure_memoizable");
3530
3551
  id_iv_native_fast = rb_intern("@native_fast");
@@ -3552,7 +3573,7 @@ LEPTRIS_INIT_EXPORT void Init_native(void)
3552
3573
  rb_define_singleton_method(c_native_node, "from", nn_from, 2);
3553
3574
  rb_define_singleton_method(c_native_node, "install_child_klasses",
3554
3575
  nn_install_child_klasses, 1);
3555
- rb_define_singleton_method(c_native_node, "create_element", nn_create_element, 2);
3576
+ rb_define_singleton_method(c_native_node, "create_element", nn_create_element, -1);
3556
3577
  rb_define_singleton_method(c_native_node, "create_text", nn_create_text, 2);
3557
3578
  rb_define_singleton_method(c_native_node, "set_root", nn_set_root, 2);
3558
3579
  rb_define_method(c_native_node, "create_child", nn_create_child, 1);
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.378.0"
4
+ VERSION = "1.9.379.1"
5
5
  end
@@ -111,8 +111,17 @@ class Leptris::XML::Document
111
111
 
112
112
  # Builder factories that return NativeNodes (#149): one C call
113
113
  # and a TypedData wrap — no FFI::Pointer, no wrap_fresh path.
114
- def native_create_element(name)
115
- Leptris::XML::NativeNode.create_element(self, name.to_s)
114
+ # (context, adapter) pre-writes the consumer's contract ivars in
115
+ # C — the mint returns a node that already answers them, and the
116
+ # consumer's Ruby prime pass disappears from the build path.
117
+ # Older compiled exts take two args; pass through only when given.
118
+ def native_create_element(name, mx_context = nil, mx_adapter = nil)
119
+ if mx_context.nil?
120
+ Leptris::XML::NativeNode.create_element(self, name.to_s)
121
+ else
122
+ Leptris::XML::NativeNode.create_element(self, name.to_s,
123
+ mx_context, mx_adapter)
124
+ end
116
125
  end
117
126
 
118
127
  def native_create_text(content)
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.378
4
+ - libleptris v1.9.379
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,20 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.379] - 2026-10-21
4
+
5
+ ### Fixed
6
+
7
+ - **html: build under GCC 14 and the wasm32 zero-warning gate (PR
8
+ #1806).** The template-foster diagnostic added in #1803 passed
9
+ `(LeptrisTextNode*)n` to `leptris_text_node_get_content`, whose
10
+ parameter is `LeptrisNodeRef`. GCC 14 (manylinux) treats
11
+ incompatible pointer types as a hard error and emcc flags them as
12
+ warnings — which broke the 1.9.378 wheel builds (leptris-py) and
13
+ failed the leptris-ts zero-warning gate on every lane. The
14
+ accessor takes the node handle directly; no behavior change.
15
+ Full suite 2075/2075.
16
+
17
+
3
18
  ## [1.9.378] - 2026-10-21
4
19
 
5
20
  ### Added
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.378
6
+ VERSION 1.9.379
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -4228,8 +4228,7 @@ static void h_append(HBuilder* b, LeptrisNodeRef n) {
4228
4228
  leptris_node_get_type(n) == LEPTRIS_NODE_TYPE_TEXT &&
4229
4229
  b->depth > 0 &&
4230
4230
  b->open_id[b->depth - 1] == h_id_template) {
4231
- const char* tc =
4232
- leptris_text_node_get_content((LeptrisTextNode*)n);
4231
+ const char* tc = leptris_text_node_get_content(n);
4233
4232
  int nonws = 0;
4234
4233
  if (tc)
4235
4234
  for (const char* w = tc; *w; w++)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
3
3
  "name": "leptris",
4
- "version": "1.9.378",
4
+ "version": "1.9.379",
5
5
  "description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
6
6
  "homepage": "https://github.com/leptris/leptris",
7
7
  "license": "MIT",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.378.0
4
+ version: 1.9.379.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-20 00:00:00.000000000 Z
11
+ date: 2026-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi