archive_r_ruby 0.1.3 → 0.1.4
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/{LICENSE → LICENSE.txt} +77 -77
- data/README.md +103 -103
- data/ext/archive_r/Makefile +48 -45
- data/ext/archive_r/archive_r-x64-mingw-ucrt.def +2 -0
- data/ext/archive_r/archive_r_ext.cc +1106 -1106
- data/ext/archive_r/archive_r_ext.o +0 -0
- data/ext/archive_r/extconf.rb +120 -120
- data/ext/archive_r/mkmf.log +23 -18
- data/ext/archive_r/vendor/archive_r/LICENSE.txt +77 -77
- data/ext/archive_r/vendor/archive_r/include/archive_r/data_stream.h +52 -52
- data/ext/archive_r/vendor/archive_r/include/archive_r/entry.h +166 -166
- data/ext/archive_r/vendor/archive_r/include/archive_r/entry_fault.h +34 -34
- data/ext/archive_r/vendor/archive_r/include/archive_r/entry_metadata.h +56 -56
- data/ext/archive_r/vendor/archive_r/include/archive_r/multi_volume_stream_base.h +46 -46
- data/ext/archive_r/vendor/archive_r/include/archive_r/path_hierarchy.h +109 -109
- data/ext/archive_r/vendor/archive_r/include/archive_r/path_hierarchy_utils.h +37 -37
- data/ext/archive_r/vendor/archive_r/include/archive_r/platform_compat.h +19 -19
- data/ext/archive_r/vendor/archive_r/include/archive_r/traverser.h +122 -122
- data/ext/archive_r/vendor/archive_r/src/archive_stack_cursor.cc +330 -330
- data/ext/archive_r/vendor/archive_r/src/archive_stack_cursor.h +97 -97
- data/ext/archive_r/vendor/archive_r/src/archive_stack_orchestrator.cc +162 -162
- data/ext/archive_r/vendor/archive_r/src/archive_stack_orchestrator.h +54 -54
- data/ext/archive_r/vendor/archive_r/src/archive_type.cc +552 -552
- data/ext/archive_r/vendor/archive_r/src/archive_type.h +77 -77
- data/ext/archive_r/vendor/archive_r/src/data_stream.cc +35 -35
- data/ext/archive_r/vendor/archive_r/src/entry.cc +253 -253
- data/ext/archive_r/vendor/archive_r/src/entry_fault.cc +26 -26
- data/ext/archive_r/vendor/archive_r/src/entry_fault_error.cc +54 -54
- data/ext/archive_r/vendor/archive_r/src/entry_fault_error.h +32 -32
- data/ext/archive_r/vendor/archive_r/src/entry_impl.h +57 -57
- data/ext/archive_r/vendor/archive_r/src/multi_volume_manager.cc +81 -81
- data/ext/archive_r/vendor/archive_r/src/multi_volume_manager.h +41 -41
- data/ext/archive_r/vendor/archive_r/src/multi_volume_stream_base.cc +199 -199
- data/ext/archive_r/vendor/archive_r/src/path_hierarchy.cc +151 -151
- data/ext/archive_r/vendor/archive_r/src/path_hierarchy_utils.cc +304 -304
- data/ext/archive_r/vendor/archive_r/src/simple_profiler.h +120 -120
- data/ext/archive_r/vendor/archive_r/src/system_file_stream.cc +295 -295
- data/ext/archive_r/vendor/archive_r/src/system_file_stream.h +46 -46
- data/ext/archive_r/vendor/archive_r/src/traverser.cc +314 -314
- data/lib/archive_r.rb +105 -105
- metadata +11 -8
- data/ext/archive_r/archive_r.bundle +0 -0
|
Binary file
|
data/ext/archive_r/extconf.rb
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
# SPDX-License-Identifier: MIT
|
|
2
|
-
# Copyright (c) 2025 archive_r Team
|
|
3
|
-
|
|
4
|
-
require 'mkmf'
|
|
5
|
-
|
|
6
|
-
def archive_r_core_root
|
|
7
|
-
candidates = []
|
|
8
|
-
|
|
9
|
-
env_root = ENV['ARCHIVE_R_CORE_ROOT']
|
|
10
|
-
candidates << File.expand_path(env_root) if env_root && !env_root.empty?
|
|
11
|
-
|
|
12
|
-
repo_root = File.expand_path('../../../..', __dir__)
|
|
13
|
-
candidates << repo_root
|
|
14
|
-
|
|
15
|
-
vendor_root = File.expand_path('vendor/archive_r', __dir__)
|
|
16
|
-
candidates << vendor_root
|
|
17
|
-
|
|
18
|
-
candidates.each do |root|
|
|
19
|
-
next unless root
|
|
20
|
-
include_dir = File.join(root, 'include')
|
|
21
|
-
src_dir = File.join(root, 'src')
|
|
22
|
-
return root if Dir.exist?(include_dir) && Dir.exist?(src_dir)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
nil
|
|
26
|
-
end
|
|
27
|
-
archive_r_root = archive_r_core_root
|
|
28
|
-
|
|
29
|
-
unless archive_r_root
|
|
30
|
-
abort <<~MSG
|
|
31
|
-
archive_r core library not found.
|
|
32
|
-
Please set ARCHIVE_R_CORE_ROOT to a repository checkout or use the vendored gem package.
|
|
33
|
-
MSG
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
vendor_root = File.expand_path('vendor/archive_r', __dir__)
|
|
37
|
-
|
|
38
|
-
if archive_r_root == vendor_root
|
|
39
|
-
puts 'Using vendored archive_r core sources'
|
|
40
|
-
elsif ENV['ARCHIVE_R_CORE_ROOT'] && File.expand_path(ENV['ARCHIVE_R_CORE_ROOT']) == archive_r_root
|
|
41
|
-
puts "Using archive_r core from #{archive_r_root} (ARCHIVE_R_CORE_ROOT)"
|
|
42
|
-
else
|
|
43
|
-
puts "Using archive_r core from #{archive_r_root}"
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
archive_r_include = File.join(archive_r_root, 'include')
|
|
47
|
-
archive_r_src = File.join(archive_r_root, 'src')
|
|
48
|
-
archive_r_lib_dir = File.join(archive_r_root, 'build')
|
|
49
|
-
glue_source = File.join(__dir__, 'archive_r_ext.cc')
|
|
50
|
-
|
|
51
|
-
# Ensure make can locate vendored sources via VPATH
|
|
52
|
-
$VPATH ||= ''
|
|
53
|
-
unless $VPATH.empty?
|
|
54
|
-
$VPATH << File::PATH_SEPARATOR
|
|
55
|
-
end
|
|
56
|
-
$VPATH << archive_r_src
|
|
57
|
-
|
|
58
|
-
# Add include paths
|
|
59
|
-
$INCFLAGS << " -I#{archive_r_include}"
|
|
60
|
-
$INCFLAGS << " -I#{archive_r_src}"
|
|
61
|
-
|
|
62
|
-
# C++17 standard
|
|
63
|
-
$CXXFLAGS << " -std=c++17"
|
|
64
|
-
|
|
65
|
-
# Configure libarchive paths from environment variables
|
|
66
|
-
if ENV['LIBARCHIVE_ROOT']
|
|
67
|
-
root = File.expand_path(ENV['LIBARCHIVE_ROOT'])
|
|
68
|
-
$INCFLAGS << " -I#{File.join(root, 'include')}"
|
|
69
|
-
$LIBPATH.unshift(File.join(root, 'lib'))
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
if ENV['LIBARCHIVE_INCLUDE_DIRS']
|
|
73
|
-
ENV['LIBARCHIVE_INCLUDE_DIRS'].split(File::PATH_SEPARATOR).each do |dir|
|
|
74
|
-
$INCFLAGS << " -I#{dir}"
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
if ENV['LIBARCHIVE_LIBRARY_DIRS']
|
|
79
|
-
ENV['LIBARCHIVE_LIBRARY_DIRS'].split(File::PATH_SEPARATOR).each do |dir|
|
|
80
|
-
$LIBPATH.unshift(dir)
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
# Check for libarchive
|
|
85
|
-
unless have_library('archive')
|
|
86
|
-
# Try alternative names for Windows/Static builds
|
|
87
|
-
unless have_library('archive_static') || have_library('libarchive')
|
|
88
|
-
abort "libarchive is required but not found"
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
# Try to link with pre-built static library first
|
|
93
|
-
prebuilt_lib = File.join(archive_r_lib_dir, 'libarchive_r_core.a')
|
|
94
|
-
prebuilt_lib_win = File.join(archive_r_lib_dir, 'archive_r_core.lib')
|
|
95
|
-
prebuilt_lib_win_release = File.join(archive_r_lib_dir, 'Release', 'archive_r_core.lib')
|
|
96
|
-
|
|
97
|
-
if File.exist?(prebuilt_lib)
|
|
98
|
-
$LOCAL_LIBS << " #{prebuilt_lib}"
|
|
99
|
-
puts "Using pre-built archive_r core library (Unix style)"
|
|
100
|
-
elsif File.exist?(prebuilt_lib_win)
|
|
101
|
-
$LOCAL_LIBS << " \"#{prebuilt_lib_win}\""
|
|
102
|
-
puts "Using pre-built archive_r core library (Windows style)"
|
|
103
|
-
elsif File.exist?(prebuilt_lib_win_release)
|
|
104
|
-
$LOCAL_LIBS << " \"#{prebuilt_lib_win_release}\""
|
|
105
|
-
puts "Using pre-built archive_r core library (Windows Release style)"
|
|
106
|
-
else
|
|
107
|
-
# Build from source as fallback (ensure the Ruby glue source is compiled too)
|
|
108
|
-
puts "Pre-built library not found, will build from source"
|
|
109
|
-
|
|
110
|
-
srcs = [glue_source] + Dir.glob(File.join(archive_r_src, '*.cc'))
|
|
111
|
-
$srcs = srcs
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
# Guarantee the Ruby glue source is part of the compilation list when $srcs is set
|
|
115
|
-
if defined?($srcs) && $srcs
|
|
116
|
-
$srcs.unshift(glue_source) unless $srcs.include?(glue_source)
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
# Create Makefile
|
|
120
|
-
create_makefile('archive_r/archive_r')
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (c) 2025 archive_r Team
|
|
3
|
+
|
|
4
|
+
require 'mkmf'
|
|
5
|
+
|
|
6
|
+
def archive_r_core_root
|
|
7
|
+
candidates = []
|
|
8
|
+
|
|
9
|
+
env_root = ENV['ARCHIVE_R_CORE_ROOT']
|
|
10
|
+
candidates << File.expand_path(env_root) if env_root && !env_root.empty?
|
|
11
|
+
|
|
12
|
+
repo_root = File.expand_path('../../../..', __dir__)
|
|
13
|
+
candidates << repo_root
|
|
14
|
+
|
|
15
|
+
vendor_root = File.expand_path('vendor/archive_r', __dir__)
|
|
16
|
+
candidates << vendor_root
|
|
17
|
+
|
|
18
|
+
candidates.each do |root|
|
|
19
|
+
next unless root
|
|
20
|
+
include_dir = File.join(root, 'include')
|
|
21
|
+
src_dir = File.join(root, 'src')
|
|
22
|
+
return root if Dir.exist?(include_dir) && Dir.exist?(src_dir)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
nil
|
|
26
|
+
end
|
|
27
|
+
archive_r_root = archive_r_core_root
|
|
28
|
+
|
|
29
|
+
unless archive_r_root
|
|
30
|
+
abort <<~MSG
|
|
31
|
+
archive_r core library not found.
|
|
32
|
+
Please set ARCHIVE_R_CORE_ROOT to a repository checkout or use the vendored gem package.
|
|
33
|
+
MSG
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
vendor_root = File.expand_path('vendor/archive_r', __dir__)
|
|
37
|
+
|
|
38
|
+
if archive_r_root == vendor_root
|
|
39
|
+
puts 'Using vendored archive_r core sources'
|
|
40
|
+
elsif ENV['ARCHIVE_R_CORE_ROOT'] && File.expand_path(ENV['ARCHIVE_R_CORE_ROOT']) == archive_r_root
|
|
41
|
+
puts "Using archive_r core from #{archive_r_root} (ARCHIVE_R_CORE_ROOT)"
|
|
42
|
+
else
|
|
43
|
+
puts "Using archive_r core from #{archive_r_root}"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
archive_r_include = File.join(archive_r_root, 'include')
|
|
47
|
+
archive_r_src = File.join(archive_r_root, 'src')
|
|
48
|
+
archive_r_lib_dir = File.join(archive_r_root, 'build')
|
|
49
|
+
glue_source = File.join(__dir__, 'archive_r_ext.cc')
|
|
50
|
+
|
|
51
|
+
# Ensure make can locate vendored sources via VPATH
|
|
52
|
+
$VPATH ||= ''
|
|
53
|
+
unless $VPATH.empty?
|
|
54
|
+
$VPATH << File::PATH_SEPARATOR
|
|
55
|
+
end
|
|
56
|
+
$VPATH << archive_r_src
|
|
57
|
+
|
|
58
|
+
# Add include paths
|
|
59
|
+
$INCFLAGS << " -I#{archive_r_include}"
|
|
60
|
+
$INCFLAGS << " -I#{archive_r_src}"
|
|
61
|
+
|
|
62
|
+
# C++17 standard
|
|
63
|
+
$CXXFLAGS << " -std=c++17"
|
|
64
|
+
|
|
65
|
+
# Configure libarchive paths from environment variables
|
|
66
|
+
if ENV['LIBARCHIVE_ROOT']
|
|
67
|
+
root = File.expand_path(ENV['LIBARCHIVE_ROOT'])
|
|
68
|
+
$INCFLAGS << " -I#{File.join(root, 'include')}"
|
|
69
|
+
$LIBPATH.unshift(File.join(root, 'lib'))
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if ENV['LIBARCHIVE_INCLUDE_DIRS']
|
|
73
|
+
ENV['LIBARCHIVE_INCLUDE_DIRS'].split(File::PATH_SEPARATOR).each do |dir|
|
|
74
|
+
$INCFLAGS << " -I#{dir}"
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if ENV['LIBARCHIVE_LIBRARY_DIRS']
|
|
79
|
+
ENV['LIBARCHIVE_LIBRARY_DIRS'].split(File::PATH_SEPARATOR).each do |dir|
|
|
80
|
+
$LIBPATH.unshift(dir)
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Check for libarchive
|
|
85
|
+
unless have_library('archive')
|
|
86
|
+
# Try alternative names for Windows/Static builds
|
|
87
|
+
unless have_library('archive_static') || have_library('libarchive')
|
|
88
|
+
abort "libarchive is required but not found"
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Try to link with pre-built static library first
|
|
93
|
+
prebuilt_lib = File.join(archive_r_lib_dir, 'libarchive_r_core.a')
|
|
94
|
+
prebuilt_lib_win = File.join(archive_r_lib_dir, 'archive_r_core.lib')
|
|
95
|
+
prebuilt_lib_win_release = File.join(archive_r_lib_dir, 'Release', 'archive_r_core.lib')
|
|
96
|
+
|
|
97
|
+
if File.exist?(prebuilt_lib)
|
|
98
|
+
$LOCAL_LIBS << " #{prebuilt_lib}"
|
|
99
|
+
puts "Using pre-built archive_r core library (Unix style)"
|
|
100
|
+
elsif File.exist?(prebuilt_lib_win)
|
|
101
|
+
$LOCAL_LIBS << " \"#{prebuilt_lib_win}\""
|
|
102
|
+
puts "Using pre-built archive_r core library (Windows style)"
|
|
103
|
+
elsif File.exist?(prebuilt_lib_win_release)
|
|
104
|
+
$LOCAL_LIBS << " \"#{prebuilt_lib_win_release}\""
|
|
105
|
+
puts "Using pre-built archive_r core library (Windows Release style)"
|
|
106
|
+
else
|
|
107
|
+
# Build from source as fallback (ensure the Ruby glue source is compiled too)
|
|
108
|
+
puts "Pre-built library not found, will build from source"
|
|
109
|
+
|
|
110
|
+
srcs = [glue_source] + Dir.glob(File.join(archive_r_src, '*.cc'))
|
|
111
|
+
$srcs = srcs
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Guarantee the Ruby glue source is part of the compilation list when $srcs is set
|
|
115
|
+
if defined?($srcs) && $srcs
|
|
116
|
+
$srcs.unshift(glue_source) unless $srcs.include?(glue_source)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Create Makefile
|
|
120
|
+
create_makefile('archive_r/archive_r')
|
data/ext/archive_r/mkmf.log
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
1
1
|
have_library: checking for -larchive... -------------------- yes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
PATH=".;C:/hostedtoolcache/windows/Ruby/3.2.9/x64/lib;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\bin;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\msys64\ucrt64\bin;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\msys64\usr\bin;C:\Users\runneradmin\AppData\Roaming\Python\Python311\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64;C:\vcpkg\installed\x64-windows\bin;C:\Program Files\PowerShell\7;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\bin;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\msys64\ucrt64\bin;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\msys64\usr\bin;C:\Users\runneradmin\AppData\Roaming\Python\Python311\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64;C:\Users\runneradmin\AppData\Roaming\Python\Python311\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64;C:\Program Files\MongoDB\Server\7.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.7.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.5.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.24.10\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.472-8\x64\bin;C:\Program Files\ImageMagick-7.1.2-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Program Files\Microsoft SQL Server\170\DTS\Binn;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.11\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\mongosh;C:\Program Files\LLVM\bin;C:\Program Files (x86)\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps" "gcc -o conftest.exe -IC:/hostedtoolcache/windows/Ruby/3.2.9/x64/include/ruby-3.2.0/x64-mingw-ucrt -IC:/hostedtoolcache/windows/Ruby/3.2.9/x64/include/ruby-3.2.0/ruby/backward -IC:/hostedtoolcache/windows/Ruby/3.2.9/x64/include/ruby-3.2.0 -I. -ID:/a/archive_r/archive_r/include -ID:/a/archive_r/archive_r/src -IC:/vcpkg/installed/x64-windows/include -IC:\vcpkg\installed\x64-windows/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/hostedtoolcache/windows/Ruby/3.2.9/x64/lib -LC:\vcpkg\installed\x64-windows/lib -LC:/vcpkg/installed/x64-windows/lib -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed -m64 -lx64-ucrt-ruby320 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt "
|
|
4
4
|
checked program was:
|
|
5
5
|
/* begin */
|
|
6
6
|
1: #include "ruby.h"
|
|
7
7
|
2:
|
|
8
|
-
3:
|
|
9
|
-
4:
|
|
10
|
-
5:
|
|
11
|
-
6:
|
|
8
|
+
3: #include <winsock2.h>
|
|
9
|
+
4: #include <windows.h>
|
|
10
|
+
5: int main(int argc, char **argv)
|
|
11
|
+
6: {
|
|
12
|
+
7: return !!argv[argc];
|
|
13
|
+
8: }
|
|
12
14
|
/* end */
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
PATH=".;C:/hostedtoolcache/windows/Ruby/3.2.9/x64/lib;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\bin;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\msys64\ucrt64\bin;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\msys64\usr\bin;C:\Users\runneradmin\AppData\Roaming\Python\Python311\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64;C:\vcpkg\installed\x64-windows\bin;C:\Program Files\PowerShell\7;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\bin;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\msys64\ucrt64\bin;C:\hostedtoolcache\windows\Ruby\3.2.9\x64\msys64\usr\bin;C:\Users\runneradmin\AppData\Roaming\Python\Python311\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64;C:\Users\runneradmin\AppData\Roaming\Python\Python311\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.11.9\x64;C:\Program Files\MongoDB\Server\7.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.7.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.5.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.24.10\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.472-8\x64\bin;C:\Program Files\ImageMagick-7.1.2-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Program Files\Microsoft SQL Server\170\DTS\Binn;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.11\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\mongosh;C:\Program Files\LLVM\bin;C:\Program Files (x86)\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps" "gcc -o conftest.exe -IC:/hostedtoolcache/windows/Ruby/3.2.9/x64/include/ruby-3.2.0/x64-mingw-ucrt -IC:/hostedtoolcache/windows/Ruby/3.2.9/x64/include/ruby-3.2.0/ruby/backward -IC:/hostedtoolcache/windows/Ruby/3.2.9/x64/include/ruby-3.2.0 -I. -ID:/a/archive_r/archive_r/include -ID:/a/archive_r/archive_r/src -IC:/vcpkg/installed/x64-windows/include -IC:\vcpkg\installed\x64-windows/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/hostedtoolcache/windows/Ruby/3.2.9/x64/lib -LC:\vcpkg\installed\x64-windows/lib -LC:/vcpkg/installed/x64-windows/lib -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed -m64 -lx64-ucrt-ruby320 -larchive -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt "
|
|
15
17
|
checked program was:
|
|
16
18
|
/* begin */
|
|
17
19
|
1: #include "ruby.h"
|
|
18
20
|
2:
|
|
19
|
-
3:
|
|
20
|
-
4:
|
|
21
|
-
5:
|
|
22
|
-
6:
|
|
23
|
-
7:
|
|
24
|
-
8:
|
|
25
|
-
9:
|
|
26
|
-
10:
|
|
27
|
-
11:
|
|
28
|
-
12:
|
|
29
|
-
13:
|
|
21
|
+
3: #include <winsock2.h>
|
|
22
|
+
4: #include <windows.h>
|
|
23
|
+
5:
|
|
24
|
+
6: /*top*/
|
|
25
|
+
7: extern int t(void);
|
|
26
|
+
8: int main(int argc, char **argv)
|
|
27
|
+
9: {
|
|
28
|
+
10: if (argc > 1000000) {
|
|
29
|
+
11: int (* volatile tp)(void)=(int (*)(void))&t;
|
|
30
|
+
12: printf("%d", (*tp)());
|
|
31
|
+
13: }
|
|
30
32
|
14:
|
|
31
|
-
15:
|
|
33
|
+
15: return !!argv[argc];
|
|
34
|
+
16: }
|
|
35
|
+
17:
|
|
36
|
+
18: int t(void) { ; return 0; }
|
|
32
37
|
/* end */
|
|
33
38
|
|
|
34
39
|
--------------------
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
archive_r License
|
|
2
|
-
Version: 0.1.3 (2025-12-02)
|
|
3
|
-
|
|
4
|
-
----------------------------------------
|
|
5
|
-
Primary License
|
|
6
|
-
----------------------------------------
|
|
7
|
-
|
|
8
|
-
MIT License
|
|
9
|
-
|
|
10
|
-
Copyright (c) 2025 archive_r Team
|
|
11
|
-
|
|
12
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
-
in the Software without restriction, including without limitation the rights
|
|
15
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
-
furnished to do so, subject to the following conditions:
|
|
18
|
-
|
|
19
|
-
The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
copies or substantial portions of the Software.
|
|
21
|
-
|
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
-
SOFTWARE.
|
|
29
|
-
|
|
30
|
-
----------------------------------------
|
|
31
|
-
Third-Party Notices
|
|
32
|
-
----------------------------------------
|
|
33
|
-
|
|
34
|
-
This distribution bundles or links against the following third-party
|
|
35
|
-
components. Their respective license terms apply in addition to the MIT
|
|
36
|
-
License shown above.
|
|
37
|
-
|
|
38
|
-
1. libarchive
|
|
39
|
-
- Purpose: core archive reading and writing functionality for the C++
|
|
40
|
-
library and language bindings.
|
|
41
|
-
- License: New BSD License (https://www.libarchive.org/)
|
|
42
|
-
|
|
43
|
-
2. pybind11
|
|
44
|
-
- Purpose: header-only binding generator for the Python extension module.
|
|
45
|
-
- License: BSD-style License (https://github.com/pybind/pybind11)
|
|
46
|
-
|
|
47
|
-
The following components are redistributed only because libarchive (bundled with archive_r) depends on them at runtime:
|
|
48
|
-
|
|
49
|
-
3. zlib
|
|
50
|
-
- Purpose: libarchive dependency providing DEFLATE compression; bundled inside archive_r binaries and wheels because libarchive requires it.
|
|
51
|
-
- License: zlib License (https://zlib.net/zlib_license.html)
|
|
52
|
-
|
|
53
|
-
4. bzip2
|
|
54
|
-
- Purpose: libarchive dependency providing bzip2 compression support; distributed with archive_r artifacts.
|
|
55
|
-
- License: BSD-style license (https://sourceware.org/bzip2/)
|
|
56
|
-
|
|
57
|
-
5. liblzma (XZ Utils)
|
|
58
|
-
- Purpose: libarchive dependency providing LZMA/XZ compression; included with archive_r packages.
|
|
59
|
-
- License: Public Domain + GNU LGPLv2.1+ (https://tukaani.org/xz/)
|
|
60
|
-
|
|
61
|
-
6. libxml2
|
|
62
|
-
- Purpose: libarchive dependency used for archive formats such as xar; distributed alongside archive_r.
|
|
63
|
-
- License: MIT-style License (http://xmlsoft.org/)
|
|
64
|
-
|
|
65
|
-
7. zstd
|
|
66
|
-
- Purpose: libarchive dependency providing Zstandard compression; shipped within archive_r binaries.
|
|
67
|
-
- License: BSD License (https://github.com/facebook/zstd)
|
|
68
|
-
|
|
69
|
-
8. OpenSSL 3
|
|
70
|
-
- Purpose: libarchive dependency providing cryptographic support for encrypted archives; included with archive_r packages.
|
|
71
|
-
- License: Apache License 2.0 with OpenSSL exception (https://www.openssl.org/source/license.html)
|
|
72
|
-
|
|
73
|
-
9. libiconv / libcharset
|
|
74
|
-
- Purpose: libxml2/libarchive dependency for character set conversion; redistributed with archive_r artifacts.
|
|
75
|
-
- License: GNU LGPLv2.1+ (https://www.gnu.org/software/libiconv/)
|
|
76
|
-
Users of archive_r should review the linked third-party licenses to ensure
|
|
77
|
-
compliance with their terms when redistributing this software.
|
|
1
|
+
archive_r License
|
|
2
|
+
Version: 0.1.3 (2025-12-02)
|
|
3
|
+
|
|
4
|
+
----------------------------------------
|
|
5
|
+
Primary License
|
|
6
|
+
----------------------------------------
|
|
7
|
+
|
|
8
|
+
MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2025 archive_r Team
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
|
|
30
|
+
----------------------------------------
|
|
31
|
+
Third-Party Notices
|
|
32
|
+
----------------------------------------
|
|
33
|
+
|
|
34
|
+
This distribution bundles or links against the following third-party
|
|
35
|
+
components. Their respective license terms apply in addition to the MIT
|
|
36
|
+
License shown above.
|
|
37
|
+
|
|
38
|
+
1. libarchive
|
|
39
|
+
- Purpose: core archive reading and writing functionality for the C++
|
|
40
|
+
library and language bindings.
|
|
41
|
+
- License: New BSD License (https://www.libarchive.org/)
|
|
42
|
+
|
|
43
|
+
2. pybind11
|
|
44
|
+
- Purpose: header-only binding generator for the Python extension module.
|
|
45
|
+
- License: BSD-style License (https://github.com/pybind/pybind11)
|
|
46
|
+
|
|
47
|
+
The following components are redistributed only because libarchive (bundled with archive_r) depends on them at runtime:
|
|
48
|
+
|
|
49
|
+
3. zlib
|
|
50
|
+
- Purpose: libarchive dependency providing DEFLATE compression; bundled inside archive_r binaries and wheels because libarchive requires it.
|
|
51
|
+
- License: zlib License (https://zlib.net/zlib_license.html)
|
|
52
|
+
|
|
53
|
+
4. bzip2
|
|
54
|
+
- Purpose: libarchive dependency providing bzip2 compression support; distributed with archive_r artifacts.
|
|
55
|
+
- License: BSD-style license (https://sourceware.org/bzip2/)
|
|
56
|
+
|
|
57
|
+
5. liblzma (XZ Utils)
|
|
58
|
+
- Purpose: libarchive dependency providing LZMA/XZ compression; included with archive_r packages.
|
|
59
|
+
- License: Public Domain + GNU LGPLv2.1+ (https://tukaani.org/xz/)
|
|
60
|
+
|
|
61
|
+
6. libxml2
|
|
62
|
+
- Purpose: libarchive dependency used for archive formats such as xar; distributed alongside archive_r.
|
|
63
|
+
- License: MIT-style License (http://xmlsoft.org/)
|
|
64
|
+
|
|
65
|
+
7. zstd
|
|
66
|
+
- Purpose: libarchive dependency providing Zstandard compression; shipped within archive_r binaries.
|
|
67
|
+
- License: BSD License (https://github.com/facebook/zstd)
|
|
68
|
+
|
|
69
|
+
8. OpenSSL 3
|
|
70
|
+
- Purpose: libarchive dependency providing cryptographic support for encrypted archives; included with archive_r packages.
|
|
71
|
+
- License: Apache License 2.0 with OpenSSL exception (https://www.openssl.org/source/license.html)
|
|
72
|
+
|
|
73
|
+
9. libiconv / libcharset
|
|
74
|
+
- Purpose: libxml2/libarchive dependency for character set conversion; redistributed with archive_r artifacts.
|
|
75
|
+
- License: GNU LGPLv2.1+ (https://www.gnu.org/software/libiconv/)
|
|
76
|
+
Users of archive_r should review the linked third-party licenses to ensure
|
|
77
|
+
compliance with their terms when redistributing this software.
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
// Copyright (c) 2025 archive_r Team
|
|
3
|
-
|
|
4
|
-
#pragma once
|
|
5
|
-
|
|
6
|
-
#include "archive_r/path_hierarchy.h"
|
|
7
|
-
|
|
8
|
-
#include <functional>
|
|
9
|
-
#include <memory>
|
|
10
|
-
#include <sys/types.h>
|
|
11
|
-
#include <cstdint>
|
|
12
|
-
|
|
13
|
-
#ifdef _WIN32
|
|
14
|
-
#include <basetsd.h>
|
|
15
|
-
using ssize_t = SSIZE_T;
|
|
16
|
-
#endif
|
|
17
|
-
|
|
18
|
-
// Avoid conflict with potential 'read' macro on Windows
|
|
19
|
-
#ifdef read
|
|
20
|
-
#undef read
|
|
21
|
-
#endif
|
|
22
|
-
|
|
23
|
-
namespace archive_r {
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @brief Abstract stream interface used by the archive traversal stack
|
|
27
|
-
*/
|
|
28
|
-
class IDataStream {
|
|
29
|
-
public:
|
|
30
|
-
virtual ~IDataStream() = default;
|
|
31
|
-
virtual ssize_t read(void *buffer, size_t size) = 0;
|
|
32
|
-
virtual void rewind() = 0;
|
|
33
|
-
virtual bool at_end() const = 0;
|
|
34
|
-
virtual int64_t seek(int64_t offset, int whence) { return -1; }
|
|
35
|
-
virtual int64_t tell() const { return -1; }
|
|
36
|
-
virtual bool can_seek() const { return false; }
|
|
37
|
-
virtual PathHierarchy source_hierarchy() const = 0;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
using RootStreamFactory = std::function<std::shared_ptr<IDataStream>(const PathHierarchy &)>;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @brief Register the default factory used for root PathHierarchy streams
|
|
44
|
-
*/
|
|
45
|
-
void set_root_stream_factory(RootStreamFactory factory);
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @brief Retrieve the currently registered root stream factory
|
|
49
|
-
*/
|
|
50
|
-
RootStreamFactory get_root_stream_factory();
|
|
51
|
-
|
|
52
|
-
} // namespace archive_r
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright (c) 2025 archive_r Team
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
#include "archive_r/path_hierarchy.h"
|
|
7
|
+
|
|
8
|
+
#include <functional>
|
|
9
|
+
#include <memory>
|
|
10
|
+
#include <sys/types.h>
|
|
11
|
+
#include <cstdint>
|
|
12
|
+
|
|
13
|
+
#ifdef _WIN32
|
|
14
|
+
#include <basetsd.h>
|
|
15
|
+
using ssize_t = SSIZE_T;
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// Avoid conflict with potential 'read' macro on Windows
|
|
19
|
+
#ifdef read
|
|
20
|
+
#undef read
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
namespace archive_r {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @brief Abstract stream interface used by the archive traversal stack
|
|
27
|
+
*/
|
|
28
|
+
class IDataStream {
|
|
29
|
+
public:
|
|
30
|
+
virtual ~IDataStream() = default;
|
|
31
|
+
virtual ssize_t read(void *buffer, size_t size) = 0;
|
|
32
|
+
virtual void rewind() = 0;
|
|
33
|
+
virtual bool at_end() const = 0;
|
|
34
|
+
virtual int64_t seek(int64_t offset, int whence) { return -1; }
|
|
35
|
+
virtual int64_t tell() const { return -1; }
|
|
36
|
+
virtual bool can_seek() const { return false; }
|
|
37
|
+
virtual PathHierarchy source_hierarchy() const = 0;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
using RootStreamFactory = std::function<std::shared_ptr<IDataStream>(const PathHierarchy &)>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @brief Register the default factory used for root PathHierarchy streams
|
|
44
|
+
*/
|
|
45
|
+
void set_root_stream_factory(RootStreamFactory factory);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @brief Retrieve the currently registered root stream factory
|
|
49
|
+
*/
|
|
50
|
+
RootStreamFactory get_root_stream_factory();
|
|
51
|
+
|
|
52
|
+
} // namespace archive_r
|