leptris 1.9.163.7 → 1.9.174.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: a191c85c5149a0f263ca7d7ee5f8ec63b58570f2f56ecd9c3cfc6333a974eff0
4
- data.tar.gz: 7f126b1b774331af49faaea1b2dadffa7e8a170a47b917a9c3ea03d89377bbee
3
+ metadata.gz: cd97282aa1d1c93dd600491c6209a122c436effa4cf65e9c3f5e71d830343aac
4
+ data.tar.gz: 28e2d7a97cb72d10059674d512ffc657b3a22d3c2be28b1002c45192c05cb11a
5
5
  SHA512:
6
- metadata.gz: 47c7ae31a849c74b9dc651439de4b55d23a038098ed7b6dbfc8ff6ec2b740d45dfb39bb3ee42ac0b0d8a7ef467f03807e77c5cba70dfa5246a957f24c901726e
7
- data.tar.gz: 8530bd56c3a373dd9bff555ed3fae96212db9792de187be21a002081be24e961601816016a3dc899482b61527424b818910cfeb85288156e95f5cd96fa7e4d8a
6
+ metadata.gz: 687c5a22ea2c1bff192be56174588d1fdcb6cf6441bee2071e197950cbd095f123761bb92e15da497d0c30d9cdc394ca5c75514be82bcc98fde0ad449a80c44c
7
+ data.tar.gz: 468d6e81dbb1c7716da5bff232cde73cf247d04d0f895a842be8511aef07abfb8b2ad2f2f872bca25a8995397be27b2b89fc43d21c2cebb172622856dd106eac
data/CHANGELOG.md CHANGED
@@ -5,6 +5,55 @@ All notable changes to Leptris will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.9.174.1] - 2026-09-15
9
+
10
+ ### Fixed
11
+
12
+ - **Prebuilt native layer now loads on every Ruby minor (#207)**:
13
+ the Linux bundles were linked by mkmf against
14
+ `libruby.so.3.3` (plus a runner-specific RUNPATH), so they
15
+ failed to load on Ruby 3.4/4.0 — darwin's
16
+ `-undefined dynamic_lookup` contract now applies on Linux too:
17
+ the .so links without libruby and resolves rb_* from the
18
+ loading interpreter, one artifact serving every Ruby minor. A
19
+ build-log guard fails the compile if the artifact ever
20
+ references libruby again.
21
+ - **Windows platform gems no longer ship the native bundle**: a
22
+ PE DLL cannot leave Ruby imports unresolved — it would bind to
23
+ the build Ruby's `x64-ucrt-rubyNNN.dll` and fail on other
24
+ minors. The FFI surface is the Windows contract.
25
+ - **The auto-enable fallback is loud**: a failed native load now
26
+ warns (reason + FFI notice) on stderr instead of degrading
27
+ silently — the silent fallback is what hid #207 behind a
28
+ walk-speed regression.
29
+
30
+ ## [1.9.174.0] - 2026-09-15
31
+
32
+ ### Changed
33
+
34
+ - **libleptris 1.9.162 → 1.9.174** (lockstep): the vendored C
35
+ library moves ten upstream releases —
36
+ - **C14N spec conance** (1.9.164, upstream #1015): inclusive
37
+ C14N keeps element prefixes (`<x:b/>` no longer canonicalizes
38
+ to `<b/>`), escaping follows REC-xml-c14n 2.3 (text `>`
39
+ escapes; attribute TAB/CR/LF as character references), and
40
+ epilog PIs canonicalize correctly.
41
+ - **XSLT 3.0 xsl:iterate sequence with-params** (1.9.167,
42
+ upstream #1066 / #197): accumulated sequence members keep
43
+ their VALUES through xsl:next-iteration — the #197 repro now
44
+ joins "alpha,beta,gamma" (spec-pinned).
45
+ - HTML conformance run (1.9.165-174, upstream #659): the
46
+ WHATWG script-data state machine, before-head/frameset
47
+ phases, `</br>` handling, mid-document DOCTYPE, and 100+
48
+ html5lib corpus fixes; Nokogiri parity 785 → 793.
49
+ - XPath: cached-bytecode twin-compile store fix (1.9.172).
50
+
51
+ ### Added
52
+
53
+ - `FFI.leptris_document_first_child` — the document child-chain
54
+ head in one call (libleptris 1.9.174); `audit:symbols`
55
+ 307/307 in lockstep.
56
+
8
57
  ## [1.9.163.7] - 2026-09-15
9
58
 
10
59
  ### Changed
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.162"
11
+ LIBLEPTRIS_VERSION = "1.9.174"
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
@@ -127,33 +127,52 @@ task :compile do
127
127
  # Opt-in native read layer ext (#185): built and vendored beside
128
128
  # the library — no compile at install; resolves libleptris at
129
129
  # require time via dlsym.
130
- ext_dir = "ext/leptris/native"
131
- Dir.chdir(ext_dir) do
132
- sh "ruby extconf.rb"
130
+ if Gem.win_platform?
131
+ # #207: a PE DLL cannot leave Ruby imports unresolved — the
132
+ # bundle would bind to the build Ruby's x64-ucrt-rubyNNN.dll
133
+ # and fail on every other minor. No bundle ships for
134
+ # Windows; the FFI surface is the Windows contract (the
135
+ # auto-enable warns and falls back).
136
+ puts "Windows: native read layer not built — FFI is the Windows surface (#207)"
137
+ else
138
+ ext_dir = "ext/leptris/native"
139
+ Dir.chdir(ext_dir) do
140
+ sh "ruby extconf.rb"
141
+ if RUBY_PLATFORM =~ /darwin/
142
+ # Link the bundle ourselves: setup-ruby's custom rubies
143
+ # make mkmf link libruby by absolute runner path no matter
144
+ # which RbConfig entries are cleared, and any libruby
145
+ # LC_LOAD_DYLIB is unresolvable on user machines. Compile
146
+ # via the Makefile, link with pure -undefined
147
+ # dynamic_lookup (Ruby symbols resolve from the loading
148
+ # interpreter) and a conservative deployment target.
149
+ sh "make native.o"
150
+ sh "cc -dynamic -bundle -undefined dynamic_lookup " \
151
+ "-mmacosx-version-min=#{ENV['MACOSX_DEPLOYMENT_TARGET'] || '11.0'} " \
152
+ "-o native.bundle native.o"
153
+ else
154
+ # #207: the darwin contract on Linux too — mkmf's `make`
155
+ # linked libruby.so.3.3 (plus a runner runpath), which
156
+ # failed to load on 3.4/4.0. Link WITHOUT libruby: one
157
+ # .so serves every Ruby minor; rb_* resolve from the
158
+ # loading interpreter at dlopen (static rubies export
159
+ # their symbols via -rdynamic, like any extension .so).
160
+ sh "make native.o"
161
+ sh "#{RbConfig::CONFIG['CC']} -shared -fPIC -o native.so native.o"
162
+ # Guard the contract in the build log.
163
+ sh "if strings native.so | grep -q libruby; then " \
164
+ "echo 'ERROR: native.so links libruby (#207)'; exit 1; fi"
165
+ end
166
+ end
167
+ bundle = Dir.glob("#{ext_dir}/native.{bundle,so,dll}").first
168
+ raise "native layer bundle not found after build" unless bundle
133
169
  if RUBY_PLATFORM =~ /darwin/
134
- # Link the bundle ourselves: setup-ruby's custom rubies make
135
- # mkmf link libruby by absolute runner path no matter which
136
- # RbConfig entries are cleared, and any libruby
137
- # LC_LOAD_DYLIB is unresolvable on user machines. Compile
138
- # via the Makefile, link with pure -undefined dynamic_lookup
139
- # (Ruby symbols resolve from the loading interpreter) and a
140
- # conservative deployment target.
141
- sh "make native.o"
142
- sh "cc -dynamic -bundle -undefined dynamic_lookup " \
143
- "-mmacosx-version-min=#{ENV['MACOSX_DEPLOYMENT_TARGET'] || '11.0'} " \
144
- "-o native.bundle native.o"
145
- else
146
- sh "make"
170
+ # Build-log proof of the linkage contract: libSystem only.
171
+ puts `otool -L #{bundle}`
147
172
  end
173
+ cp(bundle, "lib/leptris/xml/#{File.basename(bundle)}")
174
+ puts "Vendored native layer (#{File.basename(bundle)}) into lib/leptris/xml/"
148
175
  end
149
- bundle = Dir.glob("#{ext_dir}/native.{bundle,so,dll}").first
150
- raise "native layer bundle not found after build" unless bundle
151
- if RUBY_PLATFORM =~ /darwin/
152
- # Build-log proof of the linkage contract: libSystem only.
153
- puts `otool -L #{bundle}`
154
- end
155
- cp(bundle, "lib/leptris/xml/#{File.basename(bundle)}")
156
- puts "Vendored native layer (#{File.basename(bundle)}) into lib/leptris/xml/"
157
176
  end
158
177
 
159
178
  task spec: :compile unless ENV.key?("LEPTRIS_LIB_PATH")
@@ -264,7 +283,11 @@ platforms.each do |platform|
264
283
  spec.platform = Gem::Platform.new(platform)
265
284
  spec.files += Dir.glob("lib/libleptris.{dll,so,dylib}")
266
285
  spec.files += Dir.glob("lib/{libutf8proc.3.dylib,libutf8proc.so.3,libutf8proc.so,utf8proc.dll}")
267
- spec.files += Dir.glob("lib/leptris/xml/native.{bundle,so,dll}")
286
+ # #207: no native bundle in Windows gems (PE cannot resolve
287
+ # Ruby imports without binding the build Ruby's DLL).
288
+ unless platform.include?("mingw")
289
+ spec.files += Dir.glob("lib/leptris/xml/native.{bundle,so,dll}")
290
+ end
268
291
  task = Gem::PackageTask.new(spec)
269
292
  task.define
270
293
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.163.7"
4
+ VERSION = "1.9.174.1"
5
5
  end
@@ -332,6 +332,11 @@ attach_function :leptris_parse_string,
332
332
  # 1.9.7, upstream #580; the libxml2 model).
333
333
  attach_function :leptris_document_node,
334
334
  [:leptris_document], :leptris_node_ref
335
+ # First node of the document child chain in one call — the
336
+ # prolog head (libleptris 1.9.174; document_node +
337
+ # node_first_child without the intermediate handle).
338
+ attach_function :leptris_document_first_child,
339
+ [:leptris_document], :leptris_node_ref
335
340
  # Wrap-free subtree visitation (1.9.20, upstream #645a):
336
341
  # enter/leave pairs for elements, depth from the walk's root,
337
342
  # one C call — no NodeSet/Array churn per level. The document
data/lib/leptris.rb CHANGED
@@ -42,7 +42,12 @@ end
42
42
  unless ENV["LEPTRIS_NO_NATIVE"] == "1"
43
43
  begin
44
44
  require "leptris/xml/native_layer"
45
- rescue LoadError
46
- nil
45
+ rescue LoadError => e
46
+ # #207: a silent fallback hides a platform-gem packaging bug
47
+ # behind a walk-speed regression. Say so, then continue on
48
+ # the FFI surface (the explicit require still raises its full
49
+ # error for callers that opt in).
50
+ warn "leptris: native acceleration unavailable " \
51
+ "(#{e.message.lines.first.strip}); using the FFI surface"
47
52
  end
48
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.163.7
4
+ version: 1.9.174.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.