omnizip 0.4.0 → 0.4.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: 7a04b0c83ee4e9c6b57823c8db709178ed2b88e073f658fb6573d9f69fa7459f
4
- data.tar.gz: 1c5d9b7e86c1d1322cfd8a8193fcec2c8b7a4d28a21b6ee4b6fca3a359bc01e3
3
+ metadata.gz: 06cbc9a2cd22e74a84d82211efa5e000d857da117bae9a995b76520839211362
4
+ data.tar.gz: e8ab9ec5638953dda59f4b43aa299cfa55262f77d3c9e9f795bbe8800d443592
5
5
  SHA512:
6
- metadata.gz: c22355d1136d66e0c6632ce6b4ad57a1b27c8cf826b0f5593318bffd20e85de77ed8072e280a88aa01433ef658fb1adc9139ff1ff8aa6d31735efb6aea1fc9f5
7
- data.tar.gz: b06259b9ca3ede7ed15bdfa33537a9d9a17099a59ac5b0d5dc95a4f29a46ead222641abf4e8a17f17a283b1272f99d589c3541d799da0f932fc58a1401aa0d2c
6
+ metadata.gz: ecd9426b7a3f0a75c68821ec6c2c4c0f0f4f6f5e5ae7a252dc6e1e4fb9f5eb94a01b84f937c797581b44584e8cc4ba244d35e37c2338b1401c46de42299a1627
7
+ data.tar.gz: 268f70fb015d2e21b8079cae5ea4e09a83e036e967cf83bed03cc37de45b61f1875547b1443b419eec502a3bcc264e323d19bb8c503f72437cfb47bbd9d31853
data/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+ - `rake rust:build` — one command to build and vendor the Rust
12
+ backend's cdylib (clones omnizip-rs or reuses a checkout via
13
+ REPO=); the loader gains the `vendor/` resolution tier behind
14
+ `OMNIZIP_FFI_DYLIB`. No toolchain, no failure: the gem stays
15
+ pure Ruby. docs/rust-backend.md documents the tier policy,
16
+ resolution order, and CI pinning.
17
+
18
+
10
19
  ### Added
11
20
  - Rust-accelerated backend tier: `Omnizip::Backends` is the single
12
21
  tier switch between the pure-Ruby cores and the `omnizip-ffi`
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Omnizip
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ # One command to build the Rust-accelerated backend's cdylib into
4
+ # the gem's vendor dir (TODO.ref-parity/62 — the distribution
5
+ # story). Requires git + a Rust toolchain; the gem stays fully
6
+ # functional (pure Ruby) without ever running this.
7
+ #
8
+ # bundle exec rake rust:build
9
+ # bundle exec rake rust:build REPO=/path/to/omnizip-rs
10
+ desc "Build the omnizip-ffi cdylib into vendor/ for the Rust tier"
11
+ task "rust:build" do
12
+ repo = ENV.fetch("REPO", nil)
13
+ gem_root = File.expand_path("../..", __dir__)
14
+ build = File.join(gem_root, "build", "rust")
15
+
16
+ require "fileutils"
17
+ FileUtils.mkdir_p(build)
18
+ src = if repo
19
+ File.expand_path(repo)
20
+ else
21
+ target = File.join(build, "omnizip-rs")
22
+ if File.directory?(File.join(target, ".git"))
23
+ system("git", "-C", target, "fetch", "--quiet", "origin") or abort "git fetch failed in #{target}"
24
+ system("git", "-C", target, "reset", "--quiet", "--hard", "origin/main") or abort "git reset failed"
25
+ else
26
+ system("git", "clone", "--quiet", "--depth", "1",
27
+ "https://github.com/omnizip/omnizip-rs.git", target) or abort "clone failed"
28
+ end
29
+ target
30
+ end
31
+
32
+ abort "#{src} has no omnizip-ffi crate" unless File.directory?(File.join(src, "omnizip-ffi"))
33
+
34
+ system("cargo", "build", "--release", "-p", "omnizip-ffi", chdir: src) or abort "cargo build failed"
35
+
36
+ vendor = File.join(gem_root, "vendor")
37
+ FileUtils.mkdir_p(vendor)
38
+ %w[dylib so dll].each do |ext|
39
+ candidate = File.join(src, "target", "release", "libomnizip_ffi.#{ext}")
40
+ next unless File.file?(candidate)
41
+
42
+ FileUtils.cp(candidate, vendor)
43
+ puts "vendored: #{File.join(vendor, "libomnizip_ffi.#{ext}")}"
44
+ puts "tier: OMNIZIP_BACKEND=auto now uses the Rust decoders"
45
+ exit 0
46
+ end
47
+ abort "cdylib not found under #{src}/target/release"
48
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnizip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -211,6 +211,7 @@ files:
211
211
  - docs/reference/index.adoc
212
212
  - docs/resources/faq.adoc
213
213
  - docs/resources/quick-reference.adoc
214
+ - docs/rust-backend.md
214
215
  - docs/troubleshooting/index.adoc
215
216
  - docs/xar_format.md
216
217
  - examples/api_comparison.rb
@@ -722,6 +723,7 @@ files:
722
723
  - lib/omnizip/zip/input_stream.rb
723
724
  - lib/omnizip/zip/output_stream.rb
724
725
  - lib/tasks/msi_test_files.rake
726
+ - lib/tasks/rust_backend.rake
725
727
  - readme-docs/advanced-features.adoc
726
728
  - readme-docs/api-usage.adoc
727
729
  - readme-docs/architecture.adoc