leptris 1.9.174.1 → 1.9.174.2

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: cd97282aa1d1c93dd600491c6209a122c436effa4cf65e9c3f5e71d830343aac
4
- data.tar.gz: 28e2d7a97cb72d10059674d512ffc657b3a22d3c2be28b1002c45192c05cb11a
3
+ metadata.gz: fb172d69b816cff764e249cd5708a2394e7e4886a5c5281bf69160f876550c20
4
+ data.tar.gz: 22ff15b7a5dbaee59a9643f150662321e6f52267cb96b47c6621e73957615f46
5
5
  SHA512:
6
- metadata.gz: 687c5a22ea2c1bff192be56174588d1fdcb6cf6441bee2071e197950cbd095f123761bb92e15da497d0c30d9cdc394ca5c75514be82bcc98fde0ad449a80c44c
7
- data.tar.gz: 468d6e81dbb1c7716da5bff232cde73cf247d04d0f895a842be8511aef07abfb8b2ad2f2f872bca25a8995397be27b2b89fc43d21c2cebb172622856dd106eac
6
+ metadata.gz: d86e101b19a89c87b3ff67fc6fae563da827d3b389618fbada51cb9bcd387e772b474315e4d3d9f21bd6dd4bb1429df5b5f1de624787fc02db889dd6b1dc6efc
7
+ data.tar.gz: c20c6f8446a7aef0b0d08c672deccf1d5aaa7653fe04e8f69c6a8a1b0f641f6bb5221d44f0c28f0cabcfb901ce2762ce5eed3ed6fa427b2231935bda1c6bd9b9
data/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ 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.2] - 2026-09-15
9
+
10
+ ### Changed
11
+
12
+ - **The native layer returns to Windows, one DLL per Ruby minor
13
+ (#227)**: a PE DLL must bind its build Ruby's runtime, so the
14
+ Windows platform gems now ship `native-3.3.so` / `native-3.4.so`
15
+ / `native-4.0.so` and the loader picks by `RUBY_VERSION` at
16
+ require. The release workflow compiles each minor's artifact on
17
+ the Windows legs (a minor unavailable on a runner degrades to
18
+ the loud FFI fallback for that cell); local `rake compile` on
19
+ Windows builds the current minor's DLL. Windows test legs now
20
+ exercise the full native suite instead of FFI-only.
21
+
8
22
  ## [1.9.174.1] - 2026-09-15
9
23
 
10
24
  ### Fixed
data/Rakefile CHANGED
@@ -128,12 +128,14 @@ task :compile do
128
128
  # the library — no compile at install; resolves libleptris at
129
129
  # require time via dlsym.
130
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)"
131
+ # #207: a PE DLL cannot leave Ruby imports unresolved — it
132
+ # binds the build Ruby's x64-ucrt-rubyNNN.dll. The Windows
133
+ # gems therefore ship one DLL per supported Ruby minor
134
+ # (native-<minor>.so), and native_layer picks by RUBY_VERSION
135
+ # (#227). Local compile builds just the current minor's DLL;
136
+ # the release workflow runs the build script under 3.3/3.4/
137
+ # 4.0 to produce the full set.
138
+ sh "#{RbConfig.ruby} ext/build_windows_native.rb"
137
139
  else
138
140
  ext_dir = "ext/leptris/native"
139
141
  Dir.chdir(ext_dir) do
@@ -283,9 +285,10 @@ platforms.each do |platform|
283
285
  spec.platform = Gem::Platform.new(platform)
284
286
  spec.files += Dir.glob("lib/libleptris.{dll,so,dylib}")
285
287
  spec.files += Dir.glob("lib/{libutf8proc.3.dylib,libutf8proc.so.3,libutf8proc.so,utf8proc.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")
288
+ if platform.include?("mingw")
289
+ # #207/#227: per-Ruby-minor DLLs (PE must bind its Ruby).
290
+ spec.files += Dir.glob("lib/leptris/xml/native-*.so")
291
+ else
289
292
  spec.files += Dir.glob("lib/leptris/xml/native.{bundle,so,dll}")
290
293
  end
291
294
  task = Gem::PackageTask.new(spec)
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Builds the native read layer DLL for the CURRENT Ruby and
4
+ # installs it under its minor-versioned name
5
+ # (lib/leptris/xml/native-<major.minor>.so).
6
+ #
7
+ # #207/#227: a PE DLL cannot resolve Ruby imports lazily — it
8
+ # must bind the build Ruby's x64-ucrt-rubyNNN.dll. One DLL per
9
+ # supported minor therefore ships in the Windows platform gems,
10
+ # and native_layer picks by RUBY_VERSION at require.
11
+ #
12
+ # Standalone by design: the release workflow runs this under each
13
+ # Ruby minor (3.3/3.4/4.0) with no bundler context.
14
+
15
+ require "rbconfig"
16
+ require "fileutils"
17
+
18
+ root = File.expand_path("..", __dir__)
19
+ ext_dir = File.join(root, "ext", "leptris", "native")
20
+ minor = RUBY_VERSION[/\A\d+\.\d+/]
21
+
22
+ Dir.chdir(ext_dir) do
23
+ system(RbConfig.ruby, "extconf.rb") or abort "extconf failed under #{RUBY_VERSION}"
24
+ # mkmf's link binds the CURRENT Ruby's runtime DLL — exactly
25
+ # what the versioned naming is for.
26
+ success = system("make")
27
+ abort "make failed under #{RUBY_VERSION}" unless success
28
+ so = Dir.glob("native.{so,dll}").first
29
+ abort "native bundle not produced under #{RUBY_VERSION}" unless so
30
+ dest = File.join(root, "lib", "leptris", "xml", "native-#{minor}.so")
31
+ # The artifact must reference only this minor's Ruby DLL.
32
+ imported = `strings #{so} 2>/dev/null`[/[a-z0-9-]*ruby\d{3,}\.dll/i]
33
+ if imported && !imported.include?("ruby#{minor.delete('.')}")
34
+ abort "#{so} imports #{imported} but was built under #{RUBY_VERSION} — refuse to mis-name it"
35
+ end
36
+ FileUtils.cp(so, dest)
37
+ puts "Installed native layer for Ruby #{minor} -> #{dest} (#{imported || 'no ruby dll string found'})"
38
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.174.1"
4
+ VERSION = "1.9.174.2"
5
5
  end
@@ -17,11 +17,17 @@
17
17
  require "ffi" unless defined?(::FFI::Library)
18
18
 
19
19
  begin
20
- # The compiled bundle (feature "leptris/xml/native" resolves
21
- # native.bundle). A sanctioned require exception: a .bundle
22
- # cannot go through autoload. Missing in installs that do not
23
- # vendor it (ruby-platform gem).
24
- require "leptris/xml/native"
20
+ # The compiled bundle. A sanctioned require exception: a
21
+ # .bundle/.so cannot go through autoload. Missing in installs
22
+ # that do not vendor it (ruby-platform gem). Windows names the
23
+ # artifact per Ruby minor (#207/#227): a PE DLL must bind its
24
+ # build Ruby's runtime, so one DLL per supported minor ships
25
+ # and RUBY_VERSION selects.
26
+ if Gem.win_platform?
27
+ require "leptris/xml/native-#{RUBY_VERSION[/\A\d+\.\d+/]}"
28
+ else
29
+ require "leptris/xml/native"
30
+ end
25
31
  rescue LoadError => e
26
32
  raise LoadError, <<~MSG
27
33
  leptris: the compiled native read layer is not available in
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.174.1
4
+ version: 1.9.174.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -115,6 +115,7 @@ files:
115
115
  - docs/adr/0004-lifetime-guard.md
116
116
  - docs/adr/0005-autoload-manifest-ordering.md
117
117
  - docs/adr/0006-ruby-variant-policy.md
118
+ - ext/build_windows_native.rb
118
119
  - ext/leptris/native/extconf.rb
119
120
  - ext/leptris/native/native.c
120
121
  - leptris.gemspec