rb_sys 0.9.16 → 0.9.19

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: 1c40e7db0cd8e93b7b3b4b0419ae4055b3ada46565d85d7dfa14f07289a9acc9
4
- data.tar.gz: ca32433b3b2e38247500350a12430c9e43cdb496f2848ffcc610d43741a4640a
3
+ metadata.gz: 48b3782a3c2bd7804f9f0a1c42f4bbb1181173525c63011e77fa9a122b93bfe3
4
+ data.tar.gz: 04acd400f1997b1d1a981a148a7f9e7027d3b7af4c23fb924b97a5b3831f4115
5
5
  SHA512:
6
- metadata.gz: b0a2eabcd78e7190c0ecaad5e2517e80979d24f69d4e14c933480a7b8d2fb39de4b99ffe7204da026a4edc272f87a2d5e4cf889101af13be447e72cdf9b6e09e
7
- data.tar.gz: ec76e3a0d5b5559da6c8f9685ef7d80b5e503b8504385234d72bd930edcdcf42f56ebd27e6d52a24f8c245b0adce12e4eff9dd5e8d4af8f9e9f03d9fea428af9
6
+ metadata.gz: 706f56f3d6ee988b4216481d0bdbe90ba5a57e25304a07b7e790f9bc3c50adf91a76b2b12097747c4be4148b5e2a8bb1374f8c5d9dc9dd6e4318ab8bbee2ae25
7
+ data.tar.gz: 247aa3d5cf43aa9dd83775617ca2a2c60a68f15083a3502e05c9ad76aa8beaa0f2d725d846983e84f1b4af1b0503714d26fde921b14c3ea2e972f8fe19c2f1d3
checksums.yaml.gz.sig CHANGED
Binary file
@@ -11,7 +11,7 @@ module RbSys
11
11
  @profile = ENV.fetch("RB_SYS_CARGO_BUILD_PROFILE", :release).to_sym
12
12
  @env = {}
13
13
  @features = []
14
- @target = ENV["CARGO_BUILD_TARGET"]
14
+ @target = ENV["CARGO_BUILD_TARGET"] || ENV["RUST_TARGET"]
15
15
  @extra_rustc_args = []
16
16
  @dry_run = true
17
17
  @ext_dir = nil
@@ -70,6 +70,22 @@ module RbSys
70
70
  File.join(*path_parts)
71
71
  end
72
72
 
73
+ # We have to basically reimplement RbConfig::CONFIG['SOEXT'] here to support
74
+ # Ruby < 2.5
75
+ #
76
+ # @see https://github.com/ruby/ruby/blob/c87c027f18c005460746a74c07cd80ee355b16e4/configure.ac#L3185
77
+ def so_ext
78
+ return RbConfig::CONFIG["SOEXT"] if RbConfig::CONFIG.key?("SOEXT")
79
+
80
+ if win_target?
81
+ "dll"
82
+ elsif darwin_target?
83
+ "dylib"
84
+ else
85
+ "so"
86
+ end
87
+ end
88
+
73
89
  private
74
90
 
75
91
  def rb_config_env
@@ -227,22 +243,6 @@ module RbSys
227
243
  deffile_path
228
244
  end
229
245
 
230
- # We have to basically reimplement RbConfig::CONFIG['SOEXT'] here to support
231
- # Ruby < 2.5
232
- #
233
- # @see https://github.com/ruby/ruby/blob/c87c027f18c005460746a74c07cd80ee355b16e4/configure.ac#L3185
234
- def so_ext
235
- return RbConfig::CONFIG["SOEXT"] if RbConfig::CONFIG.key?("SOEXT")
236
-
237
- if win_target?
238
- "dll"
239
- elsif darwin_target?
240
- "dylib"
241
- else
242
- "so"
243
- end
244
- end
245
-
246
246
  # Corresponds to $(LIBPATH) in mkmf
247
247
  def mkmf_libpath
248
248
  ["-L", "native=#{makefile_config("libdir")}"]
data/lib/rb_sys/mkmf.rb CHANGED
@@ -48,34 +48,57 @@ module RbSys
48
48
 
49
49
  # rubocop:disable Style/GlobalVars
50
50
  make_install = +<<~MAKE
51
+ CARGO ?= cargo
52
+ CARGO_BUILD_TARGET ?= #{builder.target}
53
+ SOEXT ?= #{builder.so_ext}
54
+
55
+ # Determine the prefix Cargo uses for the lib.
56
+ ifneq ($(SOEXT),dll)
57
+ SOEXT_PREFIX ?= lib
58
+ endif
59
+
51
60
  RB_SYS_CARGO_PROFILE ?= #{builder.profile}
52
61
  RB_SYS_CARGO_FEATURES ?= #{builder.features.join(",")}
53
- CARGO ?= cargo
54
62
 
63
+ # Set dirname for the profile, since the profiles do not directly map to target dir (i.e. dev -> debug)
55
64
  ifeq ($(RB_SYS_CARGO_PROFILE),dev)
56
- RB_SYS_TARGET_DIR ?= debug
65
+ RB_SYS_CARGO_PROFILE_DIR ?= debug
57
66
  else
58
- RB_SYS_TARGET_DIR ?= $(RB_SYS_CARGO_PROFILE)
67
+ RB_SYS_CARGO_PROFILE_DIR ?= $(RB_SYS_CARGO_PROFILE)
59
68
  endif
60
69
 
70
+ # Set the build profile (dev, release, etc.) Compat with Rust 1.51.
61
71
  ifeq ($(RB_SYS_CARGO_PROFILE),release)
62
72
  RB_SYS_CARGO_PROFILE_FLAG = --release
63
73
  else
64
74
  RB_SYS_CARGO_PROFILE_FLAG = --profile $(RB_SYS_CARGO_PROFILE)
65
75
  endif
66
76
 
77
+ # Account for sub-directories when using `--target` argument with Cargo
78
+ ifneq ($(CARGO_BUILD_TARGET),)
79
+ RB_SYS_CARGO_BUILD_TARGET_DIR ?= target/$(CARGO_BUILD_TARGET)
80
+ else
81
+ RB_SYS_CARGO_BUILD_TARGET_DIR ?= target
82
+ endif
83
+
67
84
  target_prefix = #{target_prefix}
68
85
  TARGET_NAME = #{target[/\A\w+/]}
69
86
  TARGET_ENTRY = #{RbConfig::CONFIG["EXPORT_PREFIX"]}Init_$(TARGET_NAME)
70
87
  CLEANLIBS = $(RUSTLIB) $(DLLIB) $(DEFFILE)
71
- DISTCLEANDIRS = target/
72
88
  RUBYARCHDIR = $(sitearchdir)$(target_prefix)
73
- RUSTLIB = #{dllib_path(builder)}
74
89
  TARGET = #{target}
75
90
  DLLIB = $(TARGET).#{RbConfig::CONFIG["DLEXT"]}
76
- TARGET_DIR = #{Dir.pwd}/target/$(RB_SYS_TARGET_DIR)
91
+ TARGET_DIR = #{Dir.pwd}/$(RB_SYS_CARGO_BUILD_TARGET_DIR)/$(RB_SYS_CARGO_PROFILE_DIR)
92
+ RUSTLIB = $(TARGET_DIR)/$(SOEXT_PREFIX)$(TARGET_NAME).$(SOEXT)
93
+
94
+ DISTCLEANDIRS = $(TARGET_DIR)
77
95
  DEFFILE = $(TARGET_DIR)/$(TARGET)-$(arch).def
78
96
  #{base_makefile(srcdir)}
97
+
98
+ ifneq ($(RB_SYS_VERBOSE),)
99
+ Q = $(0=@)
100
+ endif
101
+
79
102
  #{env_vars(builder)}
80
103
 
81
104
  FORCE: ;
@@ -123,7 +146,7 @@ module RbSys
123
146
  args = ARGV.dup
124
147
  args.shift if args.first == "--"
125
148
  cargo_cmd = builder.cargo_command(dest_path, args)
126
- Shellwords.join(cargo_cmd).gsub("\\=", "=").gsub(/\Acargo/, "$(CARGO)")
149
+ Shellwords.join(cargo_cmd).gsub("\\=", "=").gsub(/\Acargo/, "$(CARGO)").gsub(/-v=\d/, "")
127
150
  end
128
151
 
129
152
  def env_vars(builder)
@@ -142,14 +165,12 @@ module RbSys
142
165
  ENV[key] || RbConfig::MAKEFILE_CONFIG[key]
143
166
  end
144
167
 
145
- def dllib_path(builder)
146
- builder.cargo_dylib_path(File.join(Dir.pwd, "target"))
147
- end
148
-
149
168
  def gsub_cargo_command!(cargo_command, builder:)
150
169
  cargo_command.gsub!(/--profile \w+/, "$(RB_SYS_CARGO_PROFILE_FLAG)")
151
170
  cargo_command.gsub!(%r{--features \S+}, "--features $(RB_SYS_CARGO_FEATURES)")
152
- cargo_command.gsub!(%r{/target/\w+/}, "/target/$(RB_SYS_TARGET_DIR)/")
171
+ cargo_command.gsub!(%r{--target \S+}, "--target $(CARGO_BUILD_TARGET)")
172
+ target_dir = "target/#{builder.target}".chomp("/")
173
+ cargo_command.gsub!(%r{/#{target_dir}/[^/]+}, "/$(RB_SYS_CARGO_BUILD_TARGET_DIR)/$(RB_SYS_CARGO_PROFILE_DIR)")
153
174
  cargo_command
154
175
  end
155
176
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbSys
4
- VERSION = "0.9.16"
4
+ VERSION = "0.9.19"
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.16
4
+ version: 0.9.19
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-06-29 00:00:00.000000000 Z
33
+ date: 2022-07-05 00:00:00.000000000 Z
34
34
  dependencies: []
35
35
  description:
36
36
  email:
@@ -62,7 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
62
62
  requirements:
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- version: 2.4.0
65
+ version: 2.3.0
66
66
  required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - ">="
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- k �|�u�ſ����v[A��|�ݐJ�%!���=��3t�8s] ���J�A����;]��L~: �� yK��������W~��/�H���C��ִ�=!c�|A��7bU2�˚% !�� Bbf#,@hS��u�m�X��Q�
2
- ���-��^?m�<$Xy(�7[����&�HU���^m
1
+ m�J���*SL P��W��n��Y������%Ft$!��[�� QZgh�+��r��X]�}(��������������e>*Kp�G��gR�2�Ji���ӓ<��(0�p��
2
+ �5��|M�� w�C���6K��|�R��K��"�N֤�QN\�ݖ@�i�'u^��~x�Y���&�j&a�gz�N�>{�\G5�VG-y]�s��?.��(VJv]��$�6���3,9�ɫ�!ߋu�\�(L���~