leptris 1.9.174.0 → 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 +4 -4
- data/CHANGELOG.md +22 -0
- data/Rakefile +48 -25
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris.rb +7 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd97282aa1d1c93dd600491c6209a122c436effa4cf65e9c3f5e71d830343aac
|
|
4
|
+
data.tar.gz: 28e2d7a97cb72d10059674d512ffc657b3a22d3c2be28b1002c45192c05cb11a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 687c5a22ea2c1bff192be56174588d1fdcb6cf6441bee2071e197950cbd095f123761bb92e15da497d0c30d9cdc394ca5c75514be82bcc98fde0ad449a80c44c
|
|
7
|
+
data.tar.gz: 468d6e81dbb1c7716da5bff232cde73cf247d04d0f895a842be8511aef07abfb8b2ad2f2f872bca25a8995397be27b2b89fc43d21c2cebb172622856dd106eac
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ 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
|
+
|
|
8
30
|
## [1.9.174.0] - 2026-09-15
|
|
9
31
|
|
|
10
32
|
### Changed
|
data/Rakefile
CHANGED
|
@@ -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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
#
|
|
135
|
-
|
|
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
|
-
|
|
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
|
data/lib/leptris/version.rb
CHANGED
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
|
-
|
|
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
|