rb_sys 0.9.20 → 0.9.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8268ca6121f3fc20fd5f5247b8bbfbe1ce93de3b57f025d11087b77da0e49aa3
4
- data.tar.gz: f5ad91cce6a8543d13ae8fd9d269bc6f3bab43d41afb02af20b0edc1152a7cd7
3
+ metadata.gz: 690a0a0013da370bdbe206fa6067d7f40ef4368fd7031aa24fc27d45c2f5ddbf
4
+ data.tar.gz: d0bea23bc70fa5109ef69cc12504e2d5ba00ca408033702803aef5c0d6a89737
5
5
  SHA512:
6
- metadata.gz: 5334cc57dea7b85b73bd3807d521823992ef5d96fd52e25a7afe56df447912c17311d707be731ea6540db71c0284bbdb3ba943c2fe2fbadb5141fb698b0a5731
7
- data.tar.gz: 8bfd5734a29819031e1523f4f6c63c0840471932757d97f31c41d0606145c997a4812a92c331625781259eeb34a0821620f8963477ee851d61cfbecf377f3043
6
+ metadata.gz: 5554e164a6bb504282013e31f56a34f44381f81785dd1f4660b8d126555fd049ca2f6c71b51c91b959740e3b721bf674fe75756eb6fbd8d4754c36df54108d69
7
+ data.tar.gz: ab49ec7247e0dd08203bf4dc4db749969d440deafd30c0bb00784f0883b5d02cf87d6f01de0163f2c94792653263827c5236fd02d3b9958f9ca7434c88bf1f6c
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1 @@
1
- D�Kv3u8WQ�eAn((�U�/y4���
2
- ��O��#�8Y6�HQ�Q}\�p�� �����V}aP����֪U�$�.�Q*ȼ-����Eǖ���i�I�1�:�
1
+ =���T^�q��W"8<'t�u��Rs��+b�RLU�_Sk�}v om<��ӇF`�[]�A�#����9�%-�P���gY�M�17#̋ح+��DQ�/:�+�ޖ[ե�
@@ -4,11 +4,12 @@ module RbSys
4
4
  module Mkmf
5
5
  # Config that delegates to CargoBuilder if needded
6
6
  class Config
7
- attr_accessor :force_install_rust_toolchain
7
+ attr_accessor :force_install_rust_toolchain, :clean_after_install
8
8
 
9
9
  def initialize(builder)
10
10
  @builder = builder
11
11
  @force_install_rust_toolchain = false
12
+ @clean_after_install = rubygems_invoked?
12
13
  end
13
14
 
14
15
  def method_missing(name, *args, &blk)
@@ -18,6 +19,15 @@ module RbSys
18
19
  def respond_to_missing?(name, include_private = false)
19
20
  @builder.respond_to?(name) || super
20
21
  end
22
+
23
+ private
24
+
25
+ # Seems to be the only way to reliably know if we were invoked by Rubygems.
26
+ # We want to know this so we can cleanup the target directory after an
27
+ # install, to remove bloat.
28
+ def rubygems_invoked?
29
+ ENV.key?("SOURCE_DATE_EPOCH")
30
+ end
21
31
  end
22
32
  end
23
33
  end
data/lib/rb_sys/mkmf.rb CHANGED
@@ -88,15 +88,16 @@ module RbSys
88
88
  target_prefix = #{target_prefix}
89
89
  TARGET_NAME = #{target[/\A\w+/]}
90
90
  TARGET_ENTRY = #{RbConfig::CONFIG["EXPORT_PREFIX"]}Init_$(TARGET_NAME)
91
- CLEANLIBS = $(RUSTLIB) $(DLLIB) $(DEFFILE)
92
91
  RUBYARCHDIR = $(sitearchdir)$(target_prefix)
93
92
  TARGET = #{target}
94
93
  DLLIB = $(TARGET).#{RbConfig::CONFIG["DLEXT"]}
95
94
  TARGET_DIR = #{Dir.pwd}/$(RB_SYS_CARGO_BUILD_TARGET_DIR)/$(RB_SYS_CARGO_PROFILE_DIR)
96
95
  RUSTLIB = $(TARGET_DIR)/$(SOEXT_PREFIX)$(TARGET_NAME).$(SOEXT)
97
96
 
98
- DISTCLEANDIRS = $(TARGET_DIR) $(RB_SYS_BUILD_DIR)
97
+ CLEANOBJS = $(TARGET_DIR)/.fingerprint $(TARGET_DIR)/incremental $(TARGET_DIR)/examples $(TARGET_DIR)/deps $(TARGET_DIR)/build $(TARGET_DIR)/.cargo-lock $(TARGET_DIR)/*.d $(TARGET_DIR)/*.rlib $(RB_SYS_BUILD_DIR)
99
98
  DEFFILE = $(TARGET_DIR)/$(TARGET)-$(arch).def
99
+ CLEANLIBS = $(DLLIB) $(RUSTLIB) $(DEFFILE)
100
+
100
101
  #{base_makefile(srcdir)}
101
102
 
102
103
  ifneq ($(RB_SYS_VERBOSE),)
@@ -104,7 +105,7 @@ module RbSys
104
105
  endif
105
106
 
106
107
  #{env_vars(builder)}
107
- $(DLLIB): export RUSTFLAGS := $(RUSTFLAGS) $(RB_SYS_EXTRA_RUSTFLAGS)
108
+ $(RUSTLIB): export RUSTFLAGS := $(RUSTFLAGS) $(RB_SYS_EXTRA_RUSTFLAGS)
108
109
 
109
110
  FORCE: ;
110
111
 
@@ -118,15 +119,19 @@ module RbSys
118
119
 
119
120
  #{optional_rust_toolchain(builder)}
120
121
 
121
- $(DLLIB): $(DEFFILE) FORCE
122
+ $(RUSTLIB): $(DEFFILE) FORCE
122
123
  \t$(ECHO) generating $(@) \\("$(RB_SYS_CARGO_PROFILE)"\\)
123
124
  \t$(Q) #{full_cargo_command}
125
+
126
+ $(DLLIB): $(RUSTLIB)
124
127
  \t$(Q) $(COPY) "$(RUSTLIB)" $@
125
128
 
126
- install: $(DLLIB) Makefile
127
- \t$(ECHO) installing $(DLLIB)
129
+ install-so: $(DLLIB)
130
+ \t$(ECHO) installing $(DLLIB) to $(RUBYARCHDIR)
128
131
  \t$(Q) $(MAKEDIRS) $(RUBYARCHDIR)
129
- \t$(Q) $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
132
+ \t$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
133
+
134
+ install: #{builder.clean_after_install ? "install-so realclean" : "install-so"}
130
135
 
131
136
  all: #{$extout ? "install" : "$(DLLIB)"}
132
137
  MAKE
@@ -141,8 +146,7 @@ module RbSys
141
146
 
142
147
  def base_makefile(cargo_dir)
143
148
  base_makefile = dummy_makefile(__dir__).join("\n")
144
- base_makefile.gsub!("all install static install-so install-rb", "all static install-so install-rb")
145
- base_makefile.gsub!("clean-so::", "clean-so:\n\t-$(Q)$(RM) $(DLLIB)\n")
149
+ base_makefile.gsub!("all install static install-so install-rb", "all static install-rb")
146
150
  base_makefile.gsub!(/^srcdir = .*$/, "srcdir = #{cargo_dir}")
147
151
  base_makefile
148
152
  end
@@ -159,13 +163,14 @@ module RbSys
159
163
  def env_vars(builder)
160
164
  lines = builder.build_env.map { |k, v| env_line(k, v) }
161
165
  lines << env_line("CC", env_or_makefile_config("CC"))
166
+ lines << env_line("CXX", env_or_makefile_config("CXX"))
162
167
  lines << env_line("AR", env_or_makefile_config("AR")) unless env_or_makefile_config("AR") == "libtool -static"
163
168
  lines.compact.join("\n")
164
169
  end
165
170
 
166
171
  def env_line(k, v)
167
172
  return unless v
168
- %($(DLLIB): export #{k} = #{v.gsub("\n", '\n')})
173
+ %($(RUSTLIB): export #{k} = #{v.gsub("\n", '\n')})
169
174
  end
170
175
 
171
176
  def env_or_makefile_config(key)
@@ -211,11 +216,11 @@ module RbSys
211
216
 
212
217
  $(CARGO):
213
218
  \t$(Q) $(MAKEDIRS) $(CARGO_HOME) $(RUSTUP_HOME)
214
- \tcurl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
219
+ \tcurl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --no-modify-path --profile minimal --default-toolchain none -y
215
220
  \trustup toolchain install $(RB_SYS_DEFAULT_TOOLCHAIN) --profile $(RB_SYS_RUSTUP_PROFILE)
216
221
  \trustup default $(RB_SYS_DEFAULT_TOOLCHAIN)
217
222
 
218
- $(DLLIB): $(CARGO)
223
+ $(RUSTLIB): $(CARGO)
219
224
  endif
220
225
  MAKE
221
226
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbSys
4
- VERSION = "0.9.20"
4
+ VERSION = "0.9.23"
5
5
  end
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.20
4
+ version: 0.9.23
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-07-16 00:00:00.000000000 Z
33
+ date: 2022-07-20 00:00:00.000000000 Z
34
34
  dependencies: []
35
35
  description:
36
36
  email:
metadata.gz.sig CHANGED
Binary file