rb_sys 0.9.21 → 0.9.24

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: 1ef1de2cec5dcbbaaa9d8cc147b9bf727ce66c3beeb03ac6966549677a58a666
4
- data.tar.gz: 5a693be7f33111e218293d7f6ff1e1ed8b4b3f1e238384a7c5f2d29ee654e713
3
+ metadata.gz: a91daf66ecb1b70b6f5b3d0cabdaa6481039b89e72ad5b156d4fe286da3408f5
4
+ data.tar.gz: 43f967183cfa5e7d3bc34f2cb5d8865d9aa4c5819cff326baeb2a6f98c4c6ea7
5
5
  SHA512:
6
- metadata.gz: c3b0b95982617b6df58a1e78359858fce84510559386f537de606781bbb4d1e9431c349830ac1655140b373ec57f29b48b26705d715056d1a50b30233b362775
7
- data.tar.gz: 2fc14bb752c42481d37de6b6f5e12fbcd43f55b580ddd9dc7ef158ee836fce241a990fc1b96dfa8b5babb055df5cdf828824f1983bf76a0cebddaec99442565c
6
+ metadata.gz: 98a191943178aa23145aaff7b61e5d0a52f459bdf0e40fd5321c0ab4c5543c559e278649be35da5c9cbb05f3dec85e00ee819690200983a60b2b37f00304adf7
7
+ data.tar.gz: fb16a9dc4cdbd4488fd42db1b6caccf71badeb2b23ebbe57f5dd99b0b27ef6fde6168fda8dbc2315f6ca005d12a2e31867bb7e5d2ee514c901b38cd9ab737d88
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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
@@ -166,7 +170,7 @@ module RbSys
166
170
 
167
171
  def env_line(k, v)
168
172
  return unless v
169
- %($(DLLIB): export #{k} = #{v.gsub("\n", '\n')})
173
+ %($(RUSTLIB): export #{k} = #{v.gsub("\n", '\n')})
170
174
  end
171
175
 
172
176
  def env_or_makefile_config(key)
@@ -212,11 +216,11 @@ module RbSys
212
216
 
213
217
  $(CARGO):
214
218
  \t$(Q) $(MAKEDIRS) $(CARGO_HOME) $(RUSTUP_HOME)
215
- \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 $(RB_SYS_RUSTUP_PROFILE) --default-toolchain none -y
216
220
  \trustup toolchain install $(RB_SYS_DEFAULT_TOOLCHAIN) --profile $(RB_SYS_RUSTUP_PROFILE)
217
221
  \trustup default $(RB_SYS_DEFAULT_TOOLCHAIN)
218
222
 
219
- $(DLLIB): $(CARGO)
223
+ $(RUSTLIB): $(CARGO)
220
224
  endif
221
225
  MAKE
222
226
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbSys
4
- VERSION = "0.9.21"
4
+ VERSION = "0.9.24"
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.21
4
+ version: 0.9.24
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-19 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