leptris 1.9.403.0 → 1.9.403.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: 9ebfe2b30ce92337532b49a43280042b311479e6e86859b97bde9e9359ff0904
4
- data.tar.gz: bf4fc28871fbb610089542182af8fb232e4d9fed7d8b31bc73cf40df26d29b4d
3
+ metadata.gz: e693194897d5163da1aac3e2b46c4ac2c5f95259545142f7becd2d482eab0da1
4
+ data.tar.gz: 70beaf7b58dce1921048dde8b20a9d0413509ce8426d9f2942622461a5f1497d
5
5
  SHA512:
6
- metadata.gz: d431e17e7d8fbe1dfcd557876b11e7953f42ff00b77e9e384b92fd7e2fa27eb577b6d4c46c6f5e454dd5a069f828103f2ce5efef2569b06b34755152b1de899d
7
- data.tar.gz: 88e75cd2106e5e68b9158bb543e82be5e8cb629f3760dcafcb90c9ec2c73e5e76b061600fd5fcbfb8ffbcace6ab19935f2bab86200bf5402160af5b2ddf3be70
6
+ metadata.gz: 334d3583a98d67c1eaff192e46635f78cb0817eb6058e2dcb4a8b592bd9d50f8ad1eb87e2cc77dc665068ab7b82fd485814e0b5ca143174a3fff4e26e9f90c01
7
+ data.tar.gz: 159e84e937d7e84e1649b5c0f98350df901a31d29739b4fd19bcc7e4c11d22c2b19e2e0d806f393aafc1c9ae68d5a06ad6a7552e189e2ba2b84ed717ebc6b8c3
data/Rakefile CHANGED
@@ -273,6 +273,23 @@ task :compile do
273
273
  raise "utf8proc shared library not found after build" unless u8_lib
274
274
  cp(u8_lib, "lib/#{File.basename(u8_lib)}")
275
275
  sign_darwin_binaries("lib/libleptris#{ext}", "lib/#{File.basename(u8_lib)}")
276
+ # ruby#582 dev follow-through: a source checkout carrying the
277
+ # release-assembly vendor copy (lib/leptris/vendor/<platform>/)
278
+ # would shadow the fresh lib/ dylib — ffi_lib prefers vendor_dirs.
279
+ # Sync the platform copy so `rake compile` keeps every vendored
280
+ # location at the built engine version (CI source-install lanes
281
+ # hit the same shadow).
282
+ # the vendor dir spelling comes from the FFI loader's own platform
283
+ # derivation (RUBY_PLATFORM carries the darwin OS version:
284
+ # "arm64-darwin23" -> vendor "arm64-darwin")
285
+ cpu = RUBY_PLATFORM.split('-').first
286
+ os = RUBY_PLATFORM.include?('darwin') ? 'darwin' : 'linux'
287
+ vendor_dir = "lib/leptris/vendor/#{cpu}-#{os}"
288
+ if Dir.exist?(vendor_dir)
289
+ cp(lib, File.join(vendor_dir, "libleptris#{ext}"))
290
+ sign_darwin_binaries(File.join(vendor_dir, "libleptris#{ext}"))
291
+ puts "Synced #{vendor_dir}/libleptris#{ext}"
292
+ end
276
293
  puts "Vendored #{File.basename(lib)} + #{File.basename(u8_lib)} into lib/"
277
294
 
278
295
  # Opt-in native read layer ext (#185): built and vendored beside
@@ -165,4 +165,10 @@ end
165
165
  # same basename — exported by native.c and pinned in the Windows
166
166
  # .def above.
167
167
  minor_us = RUBY_VERSION[/\A\d+\.\d+/].tr(".", "_")
168
+ # ruby#582: hide every internal symbol; only the Init_* entry
169
+ # points opt back in (visibility("default")). Linux's flat symbol
170
+ # scope otherwise lets another gem's exports hijack our calls.
171
+ unless RUBY_PLATFORM =~ /mswin|mingw/
172
+ append_cflags("-fvisibility=hidden")
173
+ end
168
174
  create_makefile("leptris/xml/native_#{minor_us}")
@@ -3701,6 +3701,11 @@ static VALUE leptris_native_resolve_rb(VALUE self, VALUE lib_path)
3701
3701
  */
3702
3702
  #if defined(_WIN32)
3703
3703
  # define LEPTRIS_INIT_EXPORT __declspec(dllexport)
3704
+ #elif defined(__GNUC__) || defined(__clang__)
3705
+ /* -fvisibility=hidden (extconf) keeps every internal symbol off
3706
+ * the dynamic table; the entry points opt back in (#582) so no
3707
+ * internal name can clash with another gem's exports. */
3708
+ # define LEPTRIS_INIT_EXPORT __attribute__((visibility("default")))
3704
3709
  #else
3705
3710
  # define LEPTRIS_INIT_EXPORT
3706
3711
  #endif
@@ -3993,7 +3998,15 @@ static VALUE nf_capabilities(VALUE module) {
3993
3998
  return hash;
3994
3999
  }
3995
4000
 
3996
- LEPTRIS_INIT_EXPORT void Init_native(void)
4001
+ /* leptris-ruby#582: the setup body is PRIVATE (static) so the
4002
+ * per-minor entry points call leptris's own code unconditionally.
4003
+ * MRI loads extensions into the global symbol scope on Linux —
4004
+ * when the per-minor entries called the exported `Init_native`,
4005
+ * a second gem's `Init_native` (loaded first) hijacked the call
4006
+ * and leptris's setup never ran (NativeNode undefined). The
4007
+ * exported plain `Init_native` stays only for the mkmf .def
4008
+ * contract; nothing in the gem loads it. */
4009
+ static void leptris_native_setup(void)
3997
4010
  {
3998
4011
  VALUE m_leptris, m_xml, m_native;
3999
4012
 
@@ -4236,9 +4249,17 @@ LEPTRIS_INIT_EXPORT void Init_native(void)
4236
4249
  * unconditionally on every platform since ruby#476: the darwin/
4237
4250
  * Linux per-minor bundles (native_<minor>) resolve these too —
4238
4251
  * an artifact only ever loads under the Ruby minor it was built
4239
- * against. */
4240
- LEPTRIS_INIT_EXPORT void Init_native_3_1(void) { Init_native(); }
4241
- LEPTRIS_INIT_EXPORT void Init_native_3_2(void) { Init_native(); }
4242
- LEPTRIS_INIT_EXPORT void Init_native_3_3(void) { Init_native(); }
4243
- LEPTRIS_INIT_EXPORT void Init_native_3_4(void) { Init_native(); }
4244
- LEPTRIS_INIT_EXPORT void Init_native_4_0(void) { Init_native(); }
4252
+ * against. Each entry calls the PRIVATE setup directly (#582):
4253
+ * routing through the exported `Init_native` let whichever gem
4254
+ * defined that symbol first win the call on Linux's flat
4255
+ * namespace. */
4256
+ LEPTRIS_INIT_EXPORT void Init_native_3_1(void) { leptris_native_setup(); }
4257
+ LEPTRIS_INIT_EXPORT void Init_native_3_2(void) { leptris_native_setup(); }
4258
+ LEPTRIS_INIT_EXPORT void Init_native_3_3(void) { leptris_native_setup(); }
4259
+ LEPTRIS_INIT_EXPORT void Init_native_3_4(void) { leptris_native_setup(); }
4260
+ LEPTRIS_INIT_EXPORT void Init_native_4_0(void) { leptris_native_setup(); }
4261
+
4262
+ /* The plain entry stays exported for the mkmf .def contract (see
4263
+ * the LEPTRIS_INIT_EXPORT note); the gem's own loader only ever
4264
+ * requires the per-minor bundles. */
4265
+ LEPTRIS_INIT_EXPORT void Init_native(void) { leptris_native_setup(); }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.403.0"
4
+ VERSION = "1.9.403.1"
5
5
  end
@@ -209,7 +209,12 @@ class Leptris::XML::Descriptor
209
209
  # libleptris 1.9.312 (#1551): the root plan's serialization
210
210
  # prefix (ns_form EXACT rows emit "prefix:local" and the
211
211
  # xmlns declaration lands once on the output root).
212
- ep[:ns_prefix] = anchor_string(anchors, plan[:ns_prefix]) if plan[:ns_prefix]
212
+ # leptris#1941: the compiler's tree ns Hash carries the wire
213
+ # prefix ({exact:, prefix:}) — the emission prefix rides the
214
+ # same slot as an explicit plan[:ns_prefix].
215
+ prefix_src = plan[:ns_prefix] ||
216
+ (plan[:ns].is_a?(Hash) ? plan[:ns][:prefix] : nil)
217
+ ep[:ns_prefix] = anchor_string(anchors, prefix_src) if prefix_src
213
218
  attrs = plan[:attributes] || []
214
219
  attr_memory = attrs.empty? ? nil :
215
220
  ::FFI::MemoryPointer.new(Leptris::XML::FFI::AttrPlan, attrs.size)
@@ -233,7 +238,9 @@ class Leptris::XML::Descriptor
233
238
  anchor_string(anchors, row[:ns].fetch(:exact)) : nil
234
239
  # libleptris 1.9.312 (#1551): serialization prefix — with
235
240
  # ns_form EXACT the attribute emits as "prefix:local".
236
- ap[:ns_prefix] = anchor_string(anchors, row[:ns_prefix]) if row[:ns_prefix]
241
+ aprefix = row[:ns_prefix] ||
242
+ (row[:ns].is_a?(Hash) ? row[:ns][:prefix] : nil)
243
+ ap[:ns_prefix] = anchor_string(anchors, aprefix) if aprefix
237
244
  pack_predicates(ap, row, anchors)
238
245
  end
239
246
  ep[:attribute_count] = attrs.size
@@ -271,7 +278,9 @@ class Leptris::XML::Descriptor
271
278
  # libleptris 1.9.312 (#1551): serialization prefix — with
272
279
  # ns_form EXACT the element emits as "prefix:local" and
273
280
  # its declaration lands once on the output root.
274
- cp[:ns_prefix] = anchor_string(anchors, row[:ns_prefix]) if row[:ns_prefix]
281
+ cprefix = row[:ns_prefix] ||
282
+ (row[:ns].is_a?(Hash) ? row[:ns][:prefix] : nil)
283
+ cp[:ns_prefix] = anchor_string(anchors, cprefix) if cprefix
275
284
  pack_predicates(cp, row, anchors)
276
285
  end
277
286
  ep[:child_count] = children.size
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.403.0
4
+ version: 1.9.403.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.