ffi-libarchive-binary 0.4.2 → 0.5.0

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: 4f9abf6ba2110443ad8bb4dfcb3f18ed17e2ea6f76ef5a35179527cb4c417c8b
4
- data.tar.gz: fd63afa8b8c66c725e971247fe9d6608eaf7fa5be3430485e468c6cb858f7350
3
+ metadata.gz: 9c441dbc20d5540eb35c94d0f176e4689b0502ee7f2790f4f710160da1e26665
4
+ data.tar.gz: 6729109bb4d88b27cdcd042244dff7c8d1a5b14582f74d338577cde13be7250d
5
5
  SHA512:
6
- metadata.gz: 164f11089192293ea1d0b32bc72081d55eaa490ed2a3761b901e54531cf7e0299e26a30957bf8bbbfff54f731d5dbae93b0c45224f63d91140ff507416af7466
7
- data.tar.gz: ccd6907d03c690fbfb15c648f01dd38880218147f42fb83c7926d8a436f87bc69f96518aa67f2cc56123534a8a8bc9b3176a1f85de01990b7e0da22cb5c71a80
6
+ metadata.gz: e7e4ea161e8ac8e2242a51a1f69652be6785745e7694b68a6ac942fbeba25c292aaf0fba5fd970e00d6c9407a7aa6881b46a4b1daefe26eabf55282eca299da4
7
+ data.tar.gz: ad587d155abaf29242dd3aa59edc8ff98dd34017dd60da4f271af7b2bf9567111530e94d79a56c752db391bd3067ffaee958db5bc15e085ffdb3755b3eb4986d
data/README.adoc CHANGED
@@ -59,6 +59,117 @@ All new code should follow these
59
59
  rules. If you make changes in a pre-existing file that violates these rules you
60
60
  should fix the violations as part of your contribution.
61
61
 
62
+ == Releasing
63
+
64
+ The gem uses an automated release workflow that handles version bumping and
65
+ publishing to RubyGems using the `gem-release` gem.
66
+
67
+ === Release workflow
68
+
69
+ The release process is managed through GitHub Actions workflow dispatch:
70
+
71
+ . Navigate to the Actions tab in the GitHub repository
72
+ . Select the "release" workflow
73
+ . Click "Run workflow"
74
+ . Choose the version bump type:
75
+ - `x.y.z` - Set a specific version (e.g., `1.2.3`)
76
+ - `major` - Bump major version (e.g., `0.4.2` → `1.0.0`)
77
+ - `minor` - Bump minor version (e.g., `0.4.2` → `0.5.0`)
78
+ - `patch` - Bump patch version (e.g., `0.4.2` → `0.4.3`)
79
+ - `skip` - Publish current version without bumping (useful for republishing)
80
+
81
+ The workflow will:
82
+
83
+ . Install the `gem-release` gem
84
+ . Bump the version in [`lib/ffi-libarchive-binary/version.rb`](lib/ffi-libarchive-binary/version.rb:4) (if not skip)
85
+ . Create a git commit with the version change
86
+ . Create a git tag (`vX.Y.Z`)
87
+ . Push changes to the repository
88
+ . Build platform-specific gems for all supported platforms
89
+ . Publish all gems to RubyGems
90
+
91
+ NOTE: The workflow uses the `gem-release` gem which provides a reliable and
92
+ well-tested version bumping mechanism used across many Ruby projects.
93
+
94
+ === Manual release
95
+
96
+ For manual releases, you can use the `gem-release` gem directly:
97
+
98
+ [source,shell]
99
+ ----
100
+ # Install gem-release if not already installed
101
+ gem install gem-release
102
+
103
+ # Bump patch version (0.4.2 -> 0.4.3) and create tag
104
+ gem bump --version patch --tag --push
105
+
106
+ # Bump minor version (0.4.2 -> 0.5.0) and create tag
107
+ gem bump --version minor --tag --push
108
+
109
+ # Bump major version (0.4.2 -> 1.0.0) and create tag
110
+ gem bump --version major --tag --push
111
+
112
+ # Set specific version and create tag
113
+ gem bump --version 1.2.3 --tag --push
114
+ ----
115
+
116
+ Once the tag is pushed, the release workflow will automatically trigger and build
117
+ the gems for all platforms.
118
+
119
+ == Platform configuration
120
+
121
+ The gem uses centralized platform configuration in [`.github/platforms.json`](.github/platforms.json:1)
122
+ as the single source of truth for all platform-specific settings.
123
+
124
+ === Platform metadata
125
+
126
+ Each platform entry includes:
127
+
128
+ * `platform` - Platform identifier for gem naming (e.g., `x86_64-linux`)
129
+ * `os` - GitHub Actions runner to use for building
130
+ * `ruby` - Ruby version to use
131
+ * `description` - Human-readable description
132
+ * `build` - Whether to build a gem for this platform
133
+ * `test` - Whether to test this platform
134
+ * `test_os` - Array of OS runners to test on (if applicable)
135
+ * `cross_compile` - Whether this requires cross-compilation
136
+ * `notes` - Additional information
137
+
138
+ === Listing platforms
139
+
140
+ Use the provided script to list all configured platforms:
141
+
142
+ [source,shell]
143
+ ----
144
+ # List all platforms
145
+ bin/list-platforms
146
+
147
+ # List only build platforms
148
+ bin/list-platforms --build
149
+
150
+ # List only test platforms
151
+ bin/list-platforms --test
152
+ ----
153
+
154
+ === Adding or removing platforms
155
+
156
+ To add or modify platform support:
157
+
158
+ . Edit [`.github/platforms.json`](.github/platforms.json:1)
159
+ . Update the platform entry with appropriate settings
160
+ . Set `"build": true` to enable building for that platform
161
+ . Set `"test": true` to enable testing for that platform
162
+ . Update the platform arrays (`build_platforms` and `test_platforms`) at the bottom of the file
163
+
164
+ NOTE: When adding a new platform, ensure the GitHub Actions runner is available
165
+ and the build toolchain is properly configured.
166
+
167
+ === Windows ARM64 support
168
+
169
+ Windows ARM64 (`arm64-mingw-ucrt`) builds pre-compiled gems for Windows on ARM64
170
+ devices (e.g., Surface Pro X, Windows 11 ARM). This platform uses the GitHub
171
+ Actions `windows-11-arm` runner.
172
+
62
173
  == Contributing
63
174
 
64
175
  First, thank you for contributing! We love pull requests from everyone. By
@@ -92,23 +203,23 @@ The following platforms are officially tested and supported:
92
203
  |===
93
204
  | Platform | Architecture | Ruby Versions | Status
94
205
 
95
- | Windows 2022 | x86_64 | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
96
- | Windows 2025 | x86_64 | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
97
- | macOS 15 | ARM64 (Apple Silicon) | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
98
- | macOS 15 Large | x86_64 (Intel) | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
99
- | macOS 26 | ARM64 (Apple Silicon) | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
100
- | Ubuntu 24.04 | x86_64 (glibc) | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
101
- | Ubuntu 22.04 | x86_64 (glibc) | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
102
- | Alpine Linux | x86_64 (musl) | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
103
- | Ubuntu 24.04 | ARM64 (glibc) | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
104
- | Ubuntu 22.04 | ARM64 (glibc) | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
105
- | Alpine Linux | ARM64 (musl) | 2.7, 3.0, 3.1, 3.2, 3.3, 3.4 | ✅ Supported
206
+ | Windows 2022 | x86_64 | 3.1+ | ✅ Supported
207
+ | Windows 2025 | x86_64 | 3.1+ | ✅ Supported
208
+ | Windows 11 ARM | ARM64 | 3.4+ | ✅ Supported
209
+ | macOS 15 | ARM64 (Apple Silicon) | 3.1+ | ✅ Supported
210
+ | macOS 15 Large | x86_64 (Intel) | 3.1+ | ✅ Supported
211
+ | macOS 26 | ARM64 (Apple Silicon) | 3.1+ | ✅ Supported
212
+ | Ubuntu 24.04 | x86_64 (glibc) | 3.1+ | ✅ Supported
213
+ | Ubuntu 22.04 | x86_64 (glibc) | 3.1+ | ✅ Supported
214
+ | Alpine Linux | x86_64 (musl) | 3.1+ | ✅ Supported
215
+ | Ubuntu 24.04 | ARM64 (glibc) | 3.1+ | ✅ Supported
216
+ | Ubuntu 22.04 | ARM64 (glibc) | 3.1+ | ✅ Supported
217
+ | Alpine Linux | ARM64 (musl) | 3.1+ | ✅ Supported
106
218
  |===
107
219
 
108
- NOTE: The gem provides pre-compiled binaries for 10 platforms. Separate binaries
220
+ NOTE: The gem provides pre-compiled binaries for 11 platforms. Separate binaries
109
221
  are provided for glibc-based (gnu) and musl-based Linux distributions to ensure
110
- compatibility. Windows ARM64 support is planned for future releases pending
111
- resolution of OpenSSL build system compatibility issues with MSYS2 CLANGARM64.
222
+ compatibility.
112
223
 
113
224
  === OpenSSL compiler target strategy
114
225
 
@@ -142,5 +253,3 @@ For building from source on Windows x64, you need:
142
253
  * Ruby 2.7 or higher with DevKit
143
254
  * MinGW-w64 x86_64 toolchain
144
255
  * MSYS2 (recommended) or equivalent Unix-like environment
145
-
146
- === macOS
data/Rakefile CHANGED
@@ -29,8 +29,7 @@ end
29
29
  platforms = [
30
30
  ["x64-mingw32", "x86_64-w64-mingw32"],
31
31
  ["x64-mingw-ucrt", "x86_64-w64-mingw32"],
32
- # Future: Windows ARM64 support (commented out due to OpenSSL build system incompatibility)
33
- # ["arm64-mingw-ucrt", "aarch64-w64-mingw32"],
32
+ ["arm64-mingw-ucrt", "aarch64-w64-mingw32"],
34
33
  ["x86_64-linux", "x86_64-linux-gnu"],
35
34
  ["x86_64-linux-gnu", "x86_64-linux-gnu"],
36
35
  ["x86_64-linux-musl", "x86_64-linux-musl"],
@@ -1,4 +1,9 @@
1
1
  libraries:
2
+ # Windows ARM64 support is enabled via platform-specific configurations below:
3
+ # - OpenSSL uses version 3.3.2 for Windows ARM64 (required for ARM64 compatibility)
4
+ # - OpenSSL uses version 1.1.1w for Windows x64 (more stable for x86_64)
5
+ # - xz uses version 5.2.4 for all Windows platforms (MinGW compatibility)
6
+ # - Other libraries use cross-platform versions under 'all'
2
7
  zlib:
3
8
  all:
4
9
  version: "1.3.1"
@@ -6,25 +11,24 @@ libraries:
6
11
  sha256: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23"
7
12
  libexpat:
8
13
  all:
9
- version: "2.7.3"
10
- url: "https://github.com/libexpat/libexpat/releases/download/R_2_7_3/expat-2.7.3.tar.gz"
11
- sha256: "821ac9710d2c073eaf13e1b1895a9c9aa66c1157a99635c639fbff65cdbdd732"
14
+ version: "2.7.4"
15
+ url: "https://github.com/libexpat/libexpat/releases/download/R_2_7_4/expat-2.7.4.tar.gz"
16
+ sha256: "461ecc8aa98ab1a68c2db788175665d1a4db640dc05bf0e289b6ea17122144ec"
12
17
  # openssl:
13
18
  # version 3.x.y requires pod2man, that is not easily available on Windows x64
14
- # Windows ARM64 requires OpenSSL 3.3.2 (1.1.1w is x86_64 only)
15
19
  openssl:
16
20
  windows-x64:
17
- version: "1.1.1w"
18
- url: "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz"
19
- sha256: "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8"
21
+ version: "3.6.1"
22
+ url: "https://github.com/openssl/openssl/releases/download/openssl-3.6.1/openssl-3.6.1.tar.gz"
23
+ sha256: "b1bfedcd5b289ff22aee87c9d600f515767ebf45f77168cb6d64f231f518a82e"
20
24
  windows-arm64:
21
- version: "3.3.2"
22
- url: "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz"
23
- sha256: "2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281"
25
+ version: "3.6.1"
26
+ url: "https://github.com/openssl/openssl/releases/download/openssl-3.6.1/openssl-3.6.1.tar.gz"
27
+ sha256: "b1bfedcd5b289ff22aee87c9d600f515767ebf45f77168cb6d64f231f518a82e"
24
28
  all:
25
- version: "3.3.2"
26
- url: "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz"
27
- sha256: "2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281"
29
+ version: "3.6.1"
30
+ url: "https://github.com/openssl/openssl/releases/download/openssl-3.6.1/openssl-3.6.1.tar.gz"
31
+ sha256: "b1bfedcd5b289ff22aee87c9d600f515767ebf45f77168cb6d64f231f518a82e"
28
32
  # xz:
29
33
  # versions > 5.2.4 get crazy on MinGW
30
34
  # versions <= 5.2.5 do not support arm64-apple-darwin target
@@ -40,6 +44,6 @@ libraries:
40
44
  sha256: "a2105abee17bcd2ebd15ced31b4f5eda6e17efd6b10f921a01cda4a44c91b3a0"
41
45
  libarchive:
42
46
  all:
43
- version: "3.8.4"
44
- url: "https://www.libarchive.org/downloads/libarchive-3.8.4.tar.gz"
45
- sha256: "b2c75b132a0ec43274d2867221befcb425034cd038e465afbfad09911abb1abb"
47
+ version: "3.8.5"
48
+ url: "https://github.com/libarchive/libarchive/releases/download/v3.8.5/libarchive-3.8.5.tar.gz"
49
+ sha256: "8a60f3a7bfd59c54ce82ae805a93dba65defd04148c3333b7eaa2102f03b7ffd"
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.description = "Contains pre-compiled and install-time-compiled binaries for ffi-libarchive" # rubocop:disable Layout/LineLength
14
14
  spec.homepage = "https://github.com/fontist/ffi-libarchive-binary"
15
15
  spec.license = "BSD-3-Clause"
16
- spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
16
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
17
17
 
18
18
  spec.metadata["homepage_uri"] = spec.homepage
19
19
  spec.metadata["source_code_uri"] = "https://github.com/fontist/ffi-libarchive-binary"
@@ -57,20 +57,37 @@ module LibarchiveBinary
57
57
 
58
58
  def cross_compiler_env(host)
59
59
  # For aarch64 cross-compilation, set the compiler
60
- return {} unless host&.start_with?("aarch64-linux")
60
+ return {} unless host&.start_with?("aarch64")
61
61
 
62
- # Note: We use aarch64-linux-gnu-gcc for both glibc and musl targets because:
63
- # 1. We build static libraries (.a files) which are libc-agnostic
64
- # 2. The compiler generates aarch64 machine code (architecture-specific)
65
- # 3. glibc vs musl only matters for dynamic linking at runtime
66
- # 4. Our static libs link into libarchive.so which links to the target libc
67
- {
68
- "CC" => "aarch64-linux-gnu-gcc",
69
- "CXX" => "aarch64-linux-gnu-g++",
70
- "AR" => "aarch64-linux-gnu-ar",
71
- "RANLIB" => "aarch64-linux-gnu-ranlib",
72
- "STRIP" => "aarch64-linux-gnu-strip",
73
- }
62
+ if host == "aarch64-linux-gnu" || host == "aarch64-linux-musl"
63
+ # Note: We use aarch64-linux-gnu-gcc for both glibc and musl targets because:
64
+ # 1. We build static libraries (.a files) which are libc-agnostic
65
+ # 2. The compiler generates aarch64 machine code (architecture-specific)
66
+ # 3. glibc vs musl only matters for dynamic linking at runtime
67
+ # 4. Our static libs link into libarchive.so which links to the target libc
68
+ {
69
+ "CC" => "aarch64-linux-gnu-gcc",
70
+ "CXX" => "aarch64-linux-gnu-g++",
71
+ "AR" => "aarch64-linux-gnu-ar",
72
+ "RANLIB" => "aarch64-linux-gnu-ranlib",
73
+ "STRIP" => "aarch64-linux-gnu-strip",
74
+ }
75
+ elsif host == "aarch64-w64-mingw32"
76
+ # For Windows ARM64 cross-compilation, use regular clang with explicit target
77
+ # Not clang-cl because configure scripts don't recognize it as a C99 compiler
78
+ {
79
+ "CC" => "clang -target aarch64-w64-mingw32",
80
+ "CXX" => "clang++ -target aarch64-w64-mingw32",
81
+ "AR" => "ar",
82
+ "RANLIB" => "ranlib",
83
+ "NM" => "nm",
84
+ # Put all windres flags in RC to prevent OpenSSL from appending --target=pe-x86-64
85
+ # OpenSSL's mingw64 target adds --target=pe-x86-64 which must be the LAST flag
86
+ "RC" => "windres",
87
+ }
88
+ else
89
+ {}
90
+ end
74
91
  end
75
92
 
76
93
  def message(text)
@@ -11,8 +11,9 @@ module LibarchiveBinary
11
11
  "x86_64-linux-gnu" => nil,
12
12
  "x86_64-linux-musl" => nil,
13
13
  "x86_64-w64-mingw32" => "mingw64",
14
- # Future: Windows ARM64 support (commented out due to OpenSSL build system incompatibility)
15
- # "aarch64-w64-mingw32" => "VC-CLANG-WIN64-CLANGASM-ARM",
14
+ # Use mingw64 target for Windows ARM64 with clang and explicit CFLAGS
15
+ # This prevents OpenSSL from adding -m64 flag which would create x86_64 objects
16
+ "aarch64-w64-mingw32" => "mingw64",
16
17
  }.freeze
17
18
 
18
19
  ENV_CMD = ["env", "CFLAGS=-fPIC", "LDFLAGS=-fPIC"].freeze
@@ -24,9 +25,24 @@ module LibarchiveBinary
24
25
 
25
26
  def configure
26
27
  os_compiler = OS_COMPILERS[@host]
27
- common_opts = ["--openssldir=#{ROOT}/ports/SSL", "--libdir=lib", "no-tests", "no-shared"] +
28
+ common_opts = ["--openssldir=#{ROOT}/ports/SSL", "--libdir=lib", "no-tests", "no-shared", "no-docs"] +
28
29
  computed_options.grep(/--prefix/)
29
30
 
31
+ # For Windows ARM64, set CFLAGS=-fPIC first to prevent OpenSSL from adding -m64
32
+ # The mingw64 target unconditionally adds -m64 which breaks ARM64 cross-compilation
33
+ common_opts.unshift("CFLAGS=-fPIC") if @host == "aarch64-w64-mingw32"
34
+
35
+ # Disable assembly for ARM64 as x86_64-specific instructions (AVX512, etc.) won't work
36
+ common_opts << "no-asm" if @host == "aarch64-w64-mingw32"
37
+
38
+ # Disable module loading for Windows ARM64 to avoid resource file compilation
39
+ # The resource compiler (llvm-rc) can't find Windows SDK headers like winver.h
40
+ common_opts << "no-module" if @host == "aarch64-w64-mingw32"
41
+
42
+ # Disable command-line apps for Windows ARM64 to avoid resource file compilation
43
+ # The apps/openssl.rc also requires Windows SDK headers which llvm-rc can't find
44
+ common_opts << "no-apps" if @host == "aarch64-w64-mingw32"
45
+
30
46
  # Set cross-compiler environment variables for aarch64
31
47
  env_vars = cross_compiler_env(@host)
32
48
  env_prefix = env_vars.empty? ? ENV_CMD : ENV_CMD + env_vars.map { |k, v| "#{k}=#{v}" }
@@ -38,6 +54,16 @@ module LibarchiveBinary
38
54
  env_prefix + ["./Configure"] + common_opts + [os_compiler]
39
55
  end
40
56
  execute("configure", cmd)
57
+
58
+ # For Windows ARM64, fix the Makefile to use pe-arm64 instead of pe-x86-64 for windres
59
+ # OpenSSL's mingw64 target hardcodes --target=pe-x86-64 which creates x86_64 resource files
60
+ if @host == "aarch64-w64-mingw32"
61
+ makefile = File.join(work_path, "Makefile")
62
+ content = File.read(makefile)
63
+ content.gsub!("pe-x86-64", "pe-arm64")
64
+ File.write(makefile, content)
65
+ message("OpensslRecipe: fixed Makefile to use pe-arm64 for windres\n")
66
+ end
41
67
  end
42
68
 
43
69
  def checkpoint
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LibarchiveBinary
4
- VERSION = "0.4.2"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-libarchive-binary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -150,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
- version: 2.7.0
153
+ version: 3.1.0
154
154
  required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - ">="