rb_sys 0.9.51 → 0.9.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/exe/rb-sys-dock +40 -10
- data/lib/rb_sys/cargo_builder/link_flag_converter.rb +1 -3
- data/lib/rb_sys/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28dd4004edc786adedca1a62a05510881875c6ec30b8a0513c109a619e5034db
|
4
|
+
data.tar.gz: 84f5e07b271ff931636ba8e5ea9a5a438604898e27695039ed9f36ea8018cd48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50bbc9b84dbf72f86f380fbff63a88e10b7d9214c12d54d536ceb53740d1449ec398c53d3b4fc94c441853c3d142b490f46c2fa1ccb53dcd43661eb7492f2269
|
7
|
+
data.tar.gz: 49e918700f006a122cd7bcc1010d460416b265c4debc38e14f0d005a2404e7d8b7be197e9907c2c6952d209b5c41414c94dad567d4fa5a4bd5234ec148e03922
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/exe/rb-sys-dock
CHANGED
@@ -38,6 +38,42 @@ def log(level, message, emoji: true, io: $stderr)
|
|
38
38
|
io.puts "#{shellcode}#{emoji_opt}#{escaped}\e[0m"
|
39
39
|
end
|
40
40
|
|
41
|
+
def default_docker_command
|
42
|
+
return @default_docker_command if defined?(@default_docker_command)
|
43
|
+
|
44
|
+
@default_docker_command = ENV.fetch("DOCKER", "docker")
|
45
|
+
end
|
46
|
+
|
47
|
+
def run_command!(cmd)
|
48
|
+
log(:trace, "Running command: $ #{cmd}")
|
49
|
+
stdout, stderr, status = Open3.capture3(cmd)
|
50
|
+
|
51
|
+
if status.success?
|
52
|
+
stdout
|
53
|
+
else
|
54
|
+
log(:error, "Error running command: $ #{cmd}")
|
55
|
+
warn(stderr)
|
56
|
+
exit(status.exitstatus)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def docker(cmd)
|
61
|
+
require "open3"
|
62
|
+
|
63
|
+
run_command!("#{default_docker_command} #{cmd}")
|
64
|
+
rescue Errno::ENOENT
|
65
|
+
log(:trace, "Could not find docker command, trying podman")
|
66
|
+
|
67
|
+
begin
|
68
|
+
stdout = run_command!("podman #{cmd}")
|
69
|
+
@default_docker_command = "podman"
|
70
|
+
stdout
|
71
|
+
rescue Errno::ENOENT
|
72
|
+
log(:error, "Could not find docker or podman command, please install one of them")
|
73
|
+
exit(1)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
41
77
|
OptionParser.new do |opts|
|
42
78
|
opts.banner = "Usage: rb-sys-dock --platform PLATFORM [COMMAND]"
|
43
79
|
|
@@ -156,7 +192,7 @@ def rcd(input_args, options)
|
|
156
192
|
run_command = input_args.empty? ? "bash" : input_args.join(" ")
|
157
193
|
|
158
194
|
cmd = <<~SH
|
159
|
-
#{
|
195
|
+
#{default_docker_command} run \
|
160
196
|
-v #{Dir.pwd}:#{Dir.pwd} \
|
161
197
|
#{mount_target_dir(options, extra_env)} \
|
162
198
|
#{mount_cargo_registry} \
|
@@ -183,24 +219,18 @@ def rcd(input_args, options)
|
|
183
219
|
#{run_command}
|
184
220
|
SH
|
185
221
|
|
186
|
-
log(:trace, "Running command:
|
222
|
+
log(:trace, "Running command: $ #{cmd}")
|
187
223
|
|
188
224
|
exec(cmd)
|
189
225
|
end
|
190
226
|
|
191
|
-
def docker_command
|
192
|
-
return @docker_command if defined?(@docker_command)
|
193
|
-
|
194
|
-
@docker_command = ENV.fetch("DOCKER", "docker")
|
195
|
-
end
|
196
|
-
|
197
227
|
def download_image(_options)
|
198
228
|
image = ENV.fetch("RCD_IMAGE")
|
199
229
|
|
200
|
-
if
|
230
|
+
if docker("images -q #{image}").strip.empty?
|
201
231
|
# Nicely formatted message that we are downloading the image which might take awhile
|
202
232
|
log(:notice, "Downloading container #{image.inspect}, this might take awhile...")
|
203
|
-
|
233
|
+
docker("pull #{image} --quiet > /dev/null")
|
204
234
|
end
|
205
235
|
end
|
206
236
|
|
@@ -22,14 +22,12 @@ module RbSys
|
|
22
22
|
["-L", "native=#{$1}"]
|
23
23
|
when /^--library=(\w+\S+)$/, /^-l\s*(\w+\S+)$/
|
24
24
|
["-l", $1]
|
25
|
-
when /^-l\s*:lib(\S+).a$/
|
26
|
-
["-l", "static=#{$1}"]
|
27
25
|
when /^-l\s*:lib(\S+).(so|dylib|dll)$/
|
28
26
|
["-l", "dylib=#{$1}"]
|
29
27
|
when /^-F\s*(.*)$/
|
30
28
|
["-l", "framework=#{$1}"]
|
31
29
|
else
|
32
|
-
["-C", "
|
30
|
+
["-C", "link-arg=#{arg}"]
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
data/lib/rb_sys/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rb_sys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.52
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
Rl+ASkq2/1i07TkBpCf+2hq66+h/hx+/Y/KrUzXfe0jtvil0WESkJT2kqRqHWNhD
|
31
31
|
9GKBxaQlXokNDtWCm1/gl6cD8WRZ0N5S4ZGJT1FLLsA=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2022-12-
|
33
|
+
date: 2022-12-17 00:00:00.000000000 Z
|
34
34
|
dependencies: []
|
35
35
|
description:
|
36
36
|
email:
|
metadata.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
��ZU�R'��XAW��m�6����H���V�1\3�r�8�Ѽ�ױ������12p�8v:ݴ�h#o���)��S�E���i?}�:(E�3�{�"�
|
2
|
+
C�"yԆ~���h����{A���W�5'�6��֪�jXO�\y��-�� �]�?���B�������2�S��~���H�d���1�$�o٧��0ȥ(�.��ѕ��qU�=�Cq&�'���F�~�=�� �|r�1���Pw�6�53�zasŹ%ك��
|