prebake 0.2.7 → 0.2.8
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/lib/prebake/platform_gem_builder.rb +15 -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: 5526a96f538034fd54828e704413a28c12d7ee26e6b7489bc93a8366615bab9d
|
|
4
|
+
data.tar.gz: 6f5c1ad1a6ae983ca8a0d7ddfbe13f633da314eefa5609716cb1c4a4569a804e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 616f1f3d581285820312d232bb64465cd179161f8c4b846db4d9c8904acfb08b92137651ceecb932eb83bee811ebdd6cf553dc764168bb2597b6916e8435c896
|
|
7
|
+
data.tar.gz: 4583a32a07fd38a498e3976a335fc106cae77e951c3a858d0a8d2df97af0c79fe2a08d397f7310779c551221412889d8903fa59f91fe566b629c2b5f40a87b95
|
|
@@ -56,14 +56,27 @@ module Prebake
|
|
|
56
56
|
ext_dir = @spec.extension_dir
|
|
57
57
|
if ext_dir && File.directory?(ext_dir)
|
|
58
58
|
# Collect binaries at root and one level deep (e.g., nokogiri/nokogiri.so).
|
|
59
|
-
# Skip deeper paths which are platform artifacts from dirty extension_dirs
|
|
60
|
-
# (e.g., extension/x86_64-linux/4.0.0/gem.so left by prior extractions).
|
|
61
59
|
binaries = Dir.glob(File.join(ext_dir, "*.{so,bundle,dll}")) +
|
|
62
60
|
Dir.glob(File.join(ext_dir, "*/*.{so,bundle,dll}"))
|
|
61
|
+
|
|
62
|
+
# Ruby 4.0+ places compiled extensions in extension/<platform>/<abi>/
|
|
63
|
+
# within extension_dir. Collect these too, normalizing their paths
|
|
64
|
+
# to root level so the cached gem is layout-agnostic.
|
|
65
|
+
Dir.glob(File.join(ext_dir, "extension/*/*/*.{so,bundle,dll}")).each do |binary|
|
|
66
|
+
relative = binary.delete_prefix("#{ext_dir}/")
|
|
67
|
+
normalized = relative.sub(%r{\Aextension/[^/]+/[^/]+/}, "")
|
|
68
|
+
# Skip if a root-level binary with the same name already exists
|
|
69
|
+
next if binaries.any? { |b| b.delete_prefix("#{ext_dir}/") == normalized }
|
|
70
|
+
|
|
71
|
+
binaries << binary
|
|
72
|
+
end
|
|
73
|
+
|
|
63
74
|
binaries.each do |binary|
|
|
64
75
|
next if File.symlink?(binary)
|
|
65
76
|
next if File.size(binary).zero?
|
|
66
77
|
relative = binary.delete_prefix("#{ext_dir}/")
|
|
78
|
+
# Normalize extension/<platform>/<abi>/ paths to root level
|
|
79
|
+
relative = relative.sub(%r{\Aextension/[^/]+/[^/]+/}, "")
|
|
67
80
|
dest = File.join(build_dir, relative)
|
|
68
81
|
FileUtils.mkdir_p(File.dirname(dest))
|
|
69
82
|
FileUtils.cp(binary, dest)
|