rb_sys 0.9.89 → 0.9.90

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: b63d2f66b32950cf95f91a0ae43183917d140d45468d01c23fbdf90e60c96c89
4
- data.tar.gz: c2fad00ab79f9828c4396d8b20240486823efc448905e3bd27933583021a197c
3
+ metadata.gz: a0e42cff7eb770ac1e6b766aed23ee13e855a24997a1e27dafc2bee51d72bddc
4
+ data.tar.gz: 838a06f80a5304b65fdc590d5a6623b5b3fd64bc230983cecdc6f98035c7ed4f
5
5
  SHA512:
6
- metadata.gz: 7dc2d83125329bd25952494f1b552ee083cef1f5dacab99ca79df61baae0d7386505a5ad624824d07201f17c5406c735503e848c7f2eb5aa8b4a7c4710c52b58
7
- data.tar.gz: c6048e23429dada10c8ce6b40a55bf2d6a6795c60ba8bbf4a4728e402ecc8ca666e6c52588636e68f1d730fc16d1b3db165db45af90b47198bc1bb4708ba4ad1
6
+ metadata.gz: eeda0d5cc55d4b17469bbd46ec3ff24b3871e9a085abccdaaa3b4c92f06ea8220356e88513c170ca3603ef276fa7721076d33c629d7e843d4e5e171763a0ce4f
7
+ data.tar.gz: c6fe283eb1a6f43e5e1e60c32c6a3e9a0098b46b0f96dba64477656237d7dd59d182ab32f4c2ee6a599f7cb4f914e314cb14ee3d9071369bde998485b999bc06
checksums.yaml.gz.sig CHANGED
Binary file
@@ -9,7 +9,7 @@ module RbSys
9
9
  WELL_KNOWN_WRAPPERS = %w[sccache cachepot].freeze
10
10
 
11
11
  attr_accessor :spec, :runner, :env, :features, :target, :extra_rustc_args, :dry_run, :ext_dir, :extra_rustflags,
12
- :extra_cargo_args
12
+ :extra_cargo_args, :config
13
13
  attr_writer :profile
14
14
 
15
15
  def initialize(spec)
@@ -66,7 +66,11 @@ module RbSys
66
66
 
67
67
  def cargo_command(dest_path, args = [])
68
68
  cmd = []
69
- cmd += ["cargo", "rustc"]
69
+ cmd += if config.use_cargo_build
70
+ ["cargo", "build"]
71
+ else
72
+ ["cargo", "rustc"]
73
+ end
70
74
  cmd += ["--target", target] if target
71
75
  cmd += ["--target-dir", dest_path]
72
76
  cmd += ["--features", features.join(",")] unless features.empty?
@@ -74,9 +78,11 @@ module RbSys
74
78
  cmd += ["--profile", profile.to_s]
75
79
  cmd += Gem::Command.build_args
76
80
  cmd += args
77
- cmd += ["--"]
78
- cmd += [*rustc_args(dest_path)]
79
- cmd += extra_rustc_args
81
+ if !config.use_cargo_build
82
+ cmd += ["--"]
83
+ cmd += [*rustc_args(dest_path)]
84
+ cmd += extra_rustc_args
85
+ end
80
86
  cmd
81
87
  end
82
88
 
@@ -25,8 +25,13 @@ module RbSys
25
25
  # Use compiled C code fallback for stable API for ruby-head (default: false)
26
26
  attr_accessor :use_stable_api_compiled_fallback
27
27
 
28
+ # Instead of the default `cargo rustc` behaviour, just call `cargo build`.
29
+ # Requires manually setting relevant rb-sys environment (default: false)
30
+ attr_accessor :use_cargo_build
31
+
28
32
  def initialize(builder)
29
33
  @builder = builder
34
+ @builder.config = self
30
35
  @force_install_rust_toolchain = false
31
36
  @auto_install_rust_toolchain = true
32
37
  @use_stable_api_compiled_fallback = false
data/lib/rb_sys/mkmf.rb CHANGED
@@ -10,9 +10,6 @@ require_relative "mkmf/config"
10
10
  module RbSys
11
11
  # Helper class for creating Rust Makefiles
12
12
  module Mkmf
13
- # @api private
14
- GLOBAL_RUSTFLAGS = ["--cfg=rb_sys_gem"]
15
-
16
13
  # Helper for building Rust extensions by creating a Ruby compatible makefile
17
14
  # for Rust. By using this class, your rust extension will be 100% compatible
18
15
  # with the rake-compiler gem, which allows for easy cross compilation.
@@ -53,7 +50,9 @@ module RbSys
53
50
  RbConfig.expand(srcdir = srcprefix.dup)
54
51
 
55
52
  full_cargo_command = cargo_command(srcdir, builder)
56
- global_rustflags = GLOBAL_RUSTFLAGS.dup
53
+
54
+ global_rustflags = []
55
+ global_rustflags << "--cfg=rb_sys_gem" unless builder.use_cargo_build
57
56
  global_rustflags << "--cfg=rb_sys_use_stable_api_compiled_fallback" if builder.use_stable_api_compiled_fallback?
58
57
 
59
58
  make_install = +<<~MAKE
@@ -169,7 +168,11 @@ module RbSys
169
168
  cargo_cmd = builder.cargo_command(dest_path, args)
170
169
  cmd = Shellwords.join(cargo_cmd)
171
170
  cmd.gsub!("\\=", "=")
172
- cmd.gsub!(/\Acargo rustc/, "$(CARGO) rustc $(RB_SYS_EXTRA_CARGO_ARGS) --manifest-path $(RB_SYS_CARGO_MANIFEST_DIR)/Cargo.toml")
171
+ if builder.use_cargo_build
172
+ cmd.gsub!(/\Acargo rustc/, "$(CARGO) build $(RB_SYS_EXTRA_CARGO_ARGS) --manifest-path $(RB_SYS_CARGO_MANIFEST_DIR)/Cargo.toml")
173
+ else
174
+ cmd.gsub!(/\Acargo rustc/, "$(CARGO) rustc $(RB_SYS_EXTRA_CARGO_ARGS) --manifest-path $(RB_SYS_CARGO_MANIFEST_DIR)/Cargo.toml")
175
+ end
173
176
  cmd.gsub!(/-v=\d/, "")
174
177
  cmd
175
178
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbSys
4
- VERSION = "0.9.89"
4
+ VERSION = "0.9.90"
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.89
4
+ version: 0.9.90
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
@@ -30,7 +30,7 @@ cert_chain:
30
30
  DIZ6NVmpBvohJVCCCDxQQxFKLXZp1ivoxjN+m7eJSW7yzIz062pH4u8pPNQsiVSb
31
31
  I5rgRPbDr2rAFGXKoQ0+u6CLkRxqrVsITl/OPfZhBQI=
32
32
  -----END CERTIFICATE-----
33
- date: 2024-02-24 00:00:00.000000000 Z
33
+ date: 2024-03-01 00:00:00.000000000 Z
34
34
  dependencies: []
35
35
  description:
36
36
  email:
metadata.gz.sig CHANGED
Binary file