leptris 1.9.335.0-ppc64le-linux → 1.9.337.0-ppc64le-linux

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: a28806b919f8a4a8c3afff49f972713477e6c48aba6290ce988ec494a5564907
4
- data.tar.gz: b3c61e5b3304608da316db83dfc3e2e911fc5914bf8fca78ed4ad8a1889a47ba
3
+ metadata.gz: 9b16b2c2997e682098627f0106ad0ca71ee007ed3b95c4ad46ca695eacc462c8
4
+ data.tar.gz: 558a0ed9fd03ab9e530011a939ee2f4cdba38578043107d14f6810743550a232
5
5
  SHA512:
6
- metadata.gz: c8275ee8cc2269f43a68aa94eb19722de3ed04aa0c8309d263c97bda37d05cea06b96092b01bc389d646a89f84f330e7630a1b4712082798a8e3af5806318297
7
- data.tar.gz: 491b13abf8b1e1d60b2e9aeca96ba41e847eaf308b3ba367488c215bd1d071d9bf74136915a50759ece0c6a068f670e9aea04563265041efae5d6c378951f57f
6
+ metadata.gz: 8f6c19ab3800dc480177f865381ce8d739bfc2e66647cb3c6178e13943083e88519208ab2ec7003499b453d5f5578ce9e6ec5fc1102734dbdb04677493abaecd
7
+ data.tar.gz: de4f19dc07fbb7e1b890e5b8543f3d676ad10b9d807eeb3783b28088a86d2c85c9c6ed5b400bc2d1763e32429e450d6fedcbbc4af87012d0ccc08531f8989296
data/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## [1.9.337.0] - 2026-10-11
2
+
3
+ ### Added — engine sync (libleptris 1.9.337)
4
+
5
+ - **XSD instance errors carry the owning element and source
6
+ position (#419, engine PR #1632)**: the libxml2/Nokogiri-
7
+ presentable shape — `element 'pgMar' @2:22: attribute 'header':
8
+ required but absent` — across attribute rows (required-absent,
9
+ fixed mismatch, strict-undeclared), strict elements, unresolved
10
+ types, and content-model failures (the #1626 culprit naming
11
+ rides along). Position from the recorded parse-time source
12
+ stamp; prior form for skipped-position parses and
13
+ `simple_valid`. Pinned for attribute and content shapes.
14
+
15
+ ## [1.9.336.0] - 2026-10-11
16
+
17
+ ### Fixed — engine sync (libleptris 1.9.336)
18
+
19
+ - **build_result members emit in op order on every platform
20
+ (#1625, engine PR #1629)**: the serializer's byte-position
21
+ qsort broke ties on unspecified libc behavior and REVERSED
22
+ builder-created members on Windows (x64 and arm64). Builder
23
+ values carry a dense insertion rank now — the comparator is a
24
+ total order and platform-independent. Pinned with the
25
+ four-member out-of-row-order shape (the Windows CI legs
26
+ enforce it); walk output undisturbed.
27
+
1
28
  ## [1.9.335.0] - 2026-10-11
2
29
 
3
30
  ### Fixed — engine sync (libleptris 1.9.335)
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.335"
11
+ LIBLEPTRIS_VERSION = "1.9.337"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.335.0"
4
+ VERSION = "1.9.337.0"
5
5
  end
data/lib/libleptris.so CHANGED
Binary file
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.335
4
+ - libleptris v1.9.337
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,41 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.337] - 2026-10-11
4
+
5
+ ### Added
6
+
7
+ - **XSD instance errors carry the owning element and source
8
+ position (leptris-ruby#419, PR #1632).** In the libxml2/Nokogiri
9
+ shape consumers present: `element 'pgMar' @2:3: attribute
10
+ 'header': required but absent`. Applied to attribute rows
11
+ (required-absent, fixed mismatch, strict-undeclared), strict
12
+ elements, unresolved types, and content-model failures — the
13
+ #1626 culprit naming rides along. The position comes from the
14
+ recorded parse-time source stamp and falls back to the prior
15
+ form for skipped-positions parses and the public `simple_valid`
16
+ face. Compile-time schema errors are unchanged.
17
+
18
+
19
+
20
+ ## [1.9.336] - 2026-10-10
21
+
22
+ ### Fixed
23
+
24
+ - **plan_result_build members emit in op order on every platform
25
+ (leptris#1625, PR #1629).** The serializer orders children by
26
+ byte position with an unstable qsort; builder-created values
27
+ carry no position, so the tie fell to unspecified libc behavior
28
+ and collection members reversed on Windows (both x64 and
29
+ arm64). Builder values now take a dense insertion rank before
30
+ push — fixing an off-by-one in the element branch besides — and
31
+ the comparator breaks position ties on it, making the order
32
+ total and platform-independent. Walk output is undisturbed (the
33
+ walk's own ranks are dense already). The binding's round-trip
34
+ spec can flip to strict member order once a release carries
35
+ this.
36
+
37
+
38
+
3
39
  ## [1.9.335] - 2026-10-10
4
40
 
5
41
  ### Fixed
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.335
6
+ VERSION 1.9.337
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -1344,6 +1344,11 @@ static int dp_kid_pos_cmp(const void* a, const void* b) {
1344
1344
  (const struct leptris_plan_result* const*)b;
1345
1345
  if ((*ka)->position < (*kb)->position) return -1;
1346
1346
  if ((*ka)->position > (*kb)->position) return 1;
1347
+ /* #1625: position ties (builder nodes, offset-less rows) fall
1348
+ * to the dense insertion rank - qsort is not stable, and an
1349
+ * unspecified tie reordered members per platform libc. */
1350
+ if ((*ka)->order_index < (*kb)->order_index) return -1;
1351
+ if ((*ka)->order_index > (*kb)->order_index) return 1;
1347
1352
  return 0;
1348
1353
  }
1349
1354
 
@@ -1586,12 +1591,16 @@ LEPTRIS_API LeptrisPlanResult leptris_plan_result_build(
1586
1591
  return NULL;
1587
1592
  }
1588
1593
  root = v;
1589
- } else if (!dp_value_push(stack[sp - 1], v)) {
1590
- dp_result_free_rec(v);
1591
- goto oom;
1594
+ } else {
1595
+ /* rank BEFORE push (kid_count is post-increment) -
1596
+ * every value needs one: the serializer's qsort
1597
+ * breaks position ties on it (#1625) */
1598
+ v->order_index = (uint32_t)stack[sp - 1]->kid_count;
1599
+ if (!dp_value_push(stack[sp - 1], v)) {
1600
+ dp_result_free_rec(v);
1601
+ goto oom;
1602
+ }
1592
1603
  }
1593
- v->order_index = (uint32_t)
1594
- (sp == 0 ? 0 : stack[sp - 1]->kid_count);
1595
1604
  stack[sp++] = v;
1596
1605
  } else if (op->kind == LEPTRIS_PLAN_OP_SCALAR) {
1597
1606
  if (sp == 0) {
@@ -1609,6 +1618,7 @@ LEPTRIS_API LeptrisPlanResult leptris_plan_result_build(
1609
1618
  if (!dp_value_set_str(v, op->value ? op->value : "",
1610
1619
  op->value ? op->value_len : 0))
1611
1620
  dp_value_set_str(v, "", 0);
1621
+ v->order_index = (uint32_t)stack[sp - 1]->kid_count;
1612
1622
  if (!dp_value_push(stack[sp - 1], v)) {
1613
1623
  dp_result_free_rec(v);
1614
1624
  goto oom;
@@ -86,6 +86,38 @@ static void verrf(struct xsd_validator* v, const char* what,
86
86
  verr_push(v, buf);
87
87
  }
88
88
 
89
+ /* leptris-ruby#419: instance-side errors carry the owning element
90
+ * and its source position (libxml2/Nokogiri shape). The element's
91
+ * own name rides the prefix; the position comes from the recorded
92
+ * source stamp (0 = unlocated — a skipped-positions parse). */
93
+ static void verrf_at(struct xsd_validator* v, LeptrisElement elem,
94
+ const char* what, const char* name,
95
+ const char* detail) {
96
+ char buf[320];
97
+ const char* el = NULL;
98
+ leptris_element_expanded_name(elem, &el, NULL, NULL);
99
+ if (!el) el = "?";
100
+ int line = 0, col = 0;
101
+ {
102
+ LeptrisSourcePosition pos;
103
+ leptris_node_source_position((LeptrisNodeRef)elem, &pos);
104
+ line = pos.line;
105
+ col = pos.col_start;
106
+ }
107
+ int w;
108
+ if (line > 0)
109
+ w = snprintf(buf, sizeof(buf),
110
+ "element '%s' @%d:%d: %s '%s': %s", el, line,
111
+ col, what, name ? name : "?",
112
+ detail ? detail : "invalid");
113
+ else
114
+ w = snprintf(buf, sizeof(buf), "element '%s': %s '%s': %s",
115
+ el, what, name ? name : "?",
116
+ detail ? detail : "invalid");
117
+ (void)w;
118
+ verr_push(v, buf);
119
+ }
120
+
89
121
  /* ---- lexical helpers ---------------------------------------------- */
90
122
 
91
123
  static int simple_is_numeric(struct leptris_xsd_schema* s,
@@ -106,7 +138,12 @@ static int text_valid(struct xsd_validator* v,
106
138
  r = xsd_simple_valid_chain(s, st, lexical);
107
139
  }
108
140
  if (r == 0) {
109
- verrf(v, what, name, "lexical value does not match its type");
141
+ if (elem)
142
+ verrf_at(v, elem, what, name,
143
+ "lexical value does not match its type");
144
+ else
145
+ verrf(v, what, name,
146
+ "lexical value does not match its type");
110
147
  return 0;
111
148
  }
112
149
  /* XSD 1.1 xs:assertion facet (document validation only):
@@ -255,7 +292,7 @@ static void validate_children(struct xsd_validator* v,
255
292
  ? "children do not match the content model (at '%s')"
256
293
  : "children do not match the content model",
257
294
  culprit ? culprit : "");
258
- verrf(v, "element", local, msg);
295
+ verrf_at(v, elem, "element", local, msg);
259
296
  free(names);
260
297
  free(uris);
261
298
  }
@@ -384,13 +421,14 @@ static void validate_attributes(struct xsd_validator* v,
384
421
  }
385
422
  if (!val) {
386
423
  if (a->required)
387
- verrf(v, "attribute", a->name, "required but absent");
424
+ verrf_at(v, elem, "attribute", a->name,
425
+ "required but absent");
388
426
  continue;
389
427
  }
390
428
  text_valid(v, s, a->type, val, "attribute", a->name, elem);
391
429
  if (a->fixed && strcmp(val, a->fixed) != 0)
392
- verrf(v, "attribute", a->name,
393
- "value does not match the fixed value");
430
+ verrf_at(v, elem, "attribute", a->name,
431
+ "value does not match the fixed value");
394
432
  }
395
433
  /* strict: every instance attribute must be declared (or pass
396
434
  * the type's xs:anyAttribute grammar). Namespace declarations
@@ -416,7 +454,8 @@ static void validate_attributes(struct xsd_validator* v,
416
454
  xsd_target_ns(s)))
417
455
  continue;
418
456
  }
419
- verrf(v, "attribute", local, "not declared (strict)");
457
+ verrf_at(v, elem, "attribute", local,
458
+ "not declared (strict)");
420
459
  }
421
460
  }
422
461
 
@@ -431,7 +470,7 @@ static void validate_element(struct xsd_validator* v,
431
470
  if (!d) {
432
471
  /* strict: the instance uses an element the schema never
433
472
  * declared (a local particle would have typed it) */
434
- verrf(v, "element", local, "not declared (strict)");
473
+ verrf_at(v, elem, "element", local, "not declared (strict)");
435
474
  return;
436
475
  }
437
476
 
@@ -510,7 +549,8 @@ static void validate_local(struct xsd_validator* v,
510
549
  }
511
550
  /* neither complex nor simple nor builtin: the schema is
512
551
  * incomplete — loud, never a silent accept (#1615 class) */
513
- verrf(v, "element", local, "type not found in the schema");
552
+ verrf_at(v, elem, "element", local,
553
+ "type not found in the schema");
514
554
  }
515
555
 
516
556
  /* ---- slice 6: identity constraints -------------------------------- */
@@ -2163,15 +2163,21 @@ TEST(Plan408, ResultBuildFeedsSerialize) {
2163
2163
  leptris_plan_row_op ops[] = {
2164
2164
  {LEPTRIS_PLAN_OP_ELEMENT, 0, UINT32_MAX, NULL, NULL, 0},
2165
2165
  {LEPTRIS_PLAN_OP_ATTR, 0, UINT32_MAX, "id", "7", 1},
2166
- {LEPTRIS_PLAN_OP_SCALAR, 0, 0, NULL, "first", 5},
2166
+ {LEPTRIS_PLAN_OP_SCALAR, 0, 0, NULL, "alpha", 5},
2167
+ {LEPTRIS_PLAN_OP_SCALAR, 0, 0, NULL, "beta", 4},
2168
+ {LEPTRIS_PLAN_OP_SCALAR, 0, 0, NULL, "gamma", 5},
2167
2169
  {LEPTRIS_PLAN_OP_END, 0, UINT32_MAX, NULL, NULL, 0},
2168
2170
  };
2169
2171
  LeptrisPlanResult r =
2170
- leptris_plan_result_build(plan, ops, 4, &st);
2172
+ leptris_plan_result_build(plan, ops, 6, &st);
2171
2173
  ASSERT_NE(r, nullptr);
2172
2174
  char* out = leptris_plan_serialize(plan, r, &st);
2173
2175
  ASSERT_NE(out, nullptr);
2174
- EXPECT_STREQ(out, "<b id=\"7\"><p>first</p></b>");
2176
+ /* #1625: multi-member order is the OP order on every platform
2177
+ * (position ties fell to unstable qsort and reversed members
2178
+ * on Windows) */
2179
+ EXPECT_STREQ(out,
2180
+ "<b id=\"7\"><p>alpha</p><p>beta</p><p>gamma</p></b>");
2175
2181
  leptris_free_string(out);
2176
2182
  leptris_plan_result_free(r);
2177
2183
  leptris_plan_free(plan);
@@ -1624,3 +1624,62 @@ TEST(XsdImport1626, MisorderReportsOnceNamed) {
1624
1624
  }
1625
1625
 
1626
1626
  } // namespace
1627
+
1628
+ // ---- leptris-ruby#419: error context (element + location) -------
1629
+ namespace {
1630
+
1631
+ TEST(XsdErrorContext, AttributeErrorCarriesElementAndPosition) {
1632
+ const char* x =
1633
+ "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
1634
+ "<xs:complexType name=\"CT_PgMar\">"
1635
+ "<xs:attribute name=\"header\" type=\"xs:integer\""
1636
+ " use=\"required\"/>"
1637
+ "<xs:attribute name=\"gutter\" type=\"xs:integer\""
1638
+ " use=\"required\"/>"
1639
+ "</xs:complexType>"
1640
+ "<xs:element name=\"pgMar\" type=\"CT_PgMar\"/>"
1641
+ "</xs:schema>";
1642
+ LeptrisStatus st = LEPTRIS_OK;
1643
+ LeptrisXsdSchema s = leptris_xsd_compile(x, strlen(x), &st);
1644
+ ASSERT_NE(s, (LeptrisXsdSchema)0);
1645
+ const char* doc =
1646
+ "\n <pgMar/>\n";
1647
+ LeptrisDocument d = leptris_parse_string(doc, strlen(doc), &st);
1648
+ ASSERT_NE(d, nullptr);
1649
+ EXPECT_EQ(leptris_xsd_validate(s, d), 0);
1650
+ size_t n = leptris_xsd_error_count(s);
1651
+ ASSERT_GE(n, 1u);
1652
+ const char* e = leptris_xsd_error_at(s, 0);
1653
+ ASSERT_NE(e, nullptr);
1654
+ EXPECT_NE(strstr(e, "pgMar"), nullptr) << e;
1655
+ EXPECT_NE(strstr(e, "@2:"), nullptr) << e;
1656
+ leptris_document_free(d);
1657
+ leptris_xsd_free(s);
1658
+ }
1659
+
1660
+ TEST(XsdErrorContext, ContentModelErrorCarriesPosition) {
1661
+ const char* x =
1662
+ "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">"
1663
+ "<xs:complexType name=\"T\">"
1664
+ "<xs:sequence>"
1665
+ "<xs:element name=\"a\" type=\"xs:token\"/>"
1666
+ "<xs:element name=\"b\" type=\"xs:token\"/>"
1667
+ "</xs:sequence>"
1668
+ "</xs:complexType>"
1669
+ "<xs:element name=\"r\" type=\"T\"/>"
1670
+ "</xs:schema>";
1671
+ LeptrisStatus st = LEPTRIS_OK;
1672
+ LeptrisXsdSchema s = leptris_xsd_compile(x, strlen(x), &st);
1673
+ ASSERT_NE(s, (LeptrisXsdSchema)0);
1674
+ const char* doc = "<r>\n <a/>\n <b/>\n <c/>\n</r>\n";
1675
+ LeptrisDocument d = leptris_parse_string(doc, strlen(doc), &st);
1676
+ ASSERT_NE(d, nullptr);
1677
+ EXPECT_EQ(leptris_xsd_validate(s, d), 0);
1678
+ const char* e = leptris_xsd_error_at(s, 0);
1679
+ ASSERT_NE(e, nullptr);
1680
+ EXPECT_NE(strstr(e, "@1:"), nullptr) << e;
1681
+ leptris_document_free(d);
1682
+ leptris_xsd_free(s);
1683
+ }
1684
+
1685
+ } // namespace
@@ -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.335",
4
+ "version": "1.9.337",
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.335.0
4
+ version: 1.9.337.0
5
5
  platform: ppc64le-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-10 00:00:00.000000000 Z
11
+ date: 2026-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi