rb_sys 0.9.89 → 0.9.91

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: b63d2f66b32950cf95f91a0ae43183917d140d45468d01c23fbdf90e60c96c89
4
- data.tar.gz: c2fad00ab79f9828c4396d8b20240486823efc448905e3bd27933583021a197c
3
+ metadata.gz: c5f116217a0a284e2e0bcb56b6b582604f1152b065f3425eb294785d8cfc4c2e
4
+ data.tar.gz: e7f23fad1b06f140b11cd6f5e6d5f931ce420c2ecf03f95bdcf634d3f88ce446
5
5
  SHA512:
6
- metadata.gz: 7dc2d83125329bd25952494f1b552ee083cef1f5dacab99ca79df61baae0d7386505a5ad624824d07201f17c5406c735503e848c7f2eb5aa8b4a7c4710c52b58
7
- data.tar.gz: c6048e23429dada10c8ce6b40a55bf2d6a6795c60ba8bbf4a4728e402ecc8ca666e6c52588636e68f1d730fc16d1b3db165db45af90b47198bc1bb4708ba4ad1
6
+ metadata.gz: '09caae7450fd9ba3ffd00d3eb5250061fc75cdf0d0bbdd15028fc19a874308602ed86759defe64304200f7e7eed93ee997e0a2bc5dc70c1879967c196fb8bc6e'
7
+ data.tar.gz: f3ebb2d447253c49531df6f42a6264cc57d32dd195d4eff088166be8da9264c528b37e4b19e6bb4c378a7e626ba1af4726128eb5d1cc2b5a3e05e663aadb9897
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.
@@ -32,7 +29,7 @@ module RbSys
32
29
  # r.env = { 'FOO' => 'bar' }
33
30
  # r.profile = ENV.fetch('RB_SYS_CARGO_PROFILE', :dev).to_sym
34
31
  # r.features = %w[some_cargo_feature]
35
- # r.rustflags = %w[--cfg=foo]
32
+ # r.extra_rustflags = %w[--cfg=foo]
36
33
  # r.target_dir = "some/target/dir"
37
34
  # end
38
35
  def create_rust_makefile(target, &blk)
@@ -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
@@ -5,6 +5,6 @@
5
5
  module RbSys
6
6
  class ToolchainInfo
7
7
  # @private
8
- DATA = {"arm-linux" => {"rust-target" => "arm-unknown-linux-gnueabihf", "rake-compiler-dock" => {"cc" => "arm-linux-gnueabihf-gcc"}, "docker-platform" => "linux/arm/v7", "supported" => true}, "aarch64-linux" => {"rust-target" => "aarch64-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "aarch64-linux-gnu-gcc"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "arm64-darwin" => {"rust-target" => "aarch64-apple-darwin", "rake-compiler-dock" => {"cc" => "aarch64-apple-darwin-clang"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "x64-mingw-ucrt" => {"rust-target" => "x86_64-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "x86_64-windows-gnu-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x64-mingw32" => {"rust-target" => "x86_64-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "x86_64-windows-gnu-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86-linux" => {"rust-target" => "i686-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "i686-redhat-linux-gcc"}, "docker-platform" => "linux/i386", "supported" => false}, "x86-mingw32" => {"rust-target" => "i686-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "i686-w64-mingw32-gcc"}, "docker-platform" => "linux/i386", "supported" => false}, "x86_64-darwin" => {"rust-target" => "x86_64-apple-darwin", "rake-compiler-dock" => {"cc" => "x86_64-apple-darwin-clang"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86_64-linux" => {"rust-target" => "x86_64-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "x86_64-redhat-linux-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86_64-linux-musl" => {"rust-target" => "x86_64-unknown-linux-musl", "rake-compiler-dock" => {"cc" => "x86_64-unknown-linux-musl-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}}
8
+ DATA = {"arm-linux" => {"rust-target" => "arm-unknown-linux-gnueabihf", "rake-compiler-dock" => {"cc" => "arm-linux-gnueabihf-gcc"}, "docker-platform" => "linux/arm/v7", "supported" => true}, "aarch64-linux" => {"rust-target" => "aarch64-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "aarch64-linux-gnu-gcc"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "aarch64-linux-musl" => {"rust-target" => "aarch64-unknown-linux-musl", "rake-compiler-dock" => {"cc" => "aarch64-linux-musl-gcc"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "arm64-darwin" => {"rust-target" => "aarch64-apple-darwin", "rake-compiler-dock" => {"cc" => "aarch64-apple-darwin-clang"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "x64-mingw-ucrt" => {"rust-target" => "x86_64-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "x86_64-windows-gnu-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x64-mingw32" => {"rust-target" => "x86_64-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "x86_64-windows-gnu-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86-linux" => {"rust-target" => "i686-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "i686-redhat-linux-gcc"}, "docker-platform" => "linux/i386", "supported" => false}, "x86-mingw32" => {"rust-target" => "i686-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "i686-w64-mingw32-gcc"}, "docker-platform" => "linux/i386", "supported" => false}, "x86_64-darwin" => {"rust-target" => "x86_64-apple-darwin", "rake-compiler-dock" => {"cc" => "x86_64-apple-darwin-clang"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86_64-linux" => {"rust-target" => "x86_64-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "x86_64-redhat-linux-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86_64-linux-musl" => {"rust-target" => "x86_64-unknown-linux-musl", "rake-compiler-dock" => {"cc" => "x86_64-unknown-linux-musl-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}}
9
9
  end
10
10
  end
@@ -28,6 +28,13 @@ module RbSys
28
28
  @supported ||= all.select(&:supported?)
29
29
  end
30
30
 
31
+ # Get all supported toolchain names, as strings.
32
+ #
33
+ # @return [Array<String>]
34
+ def supported_ruby_platforms
35
+ supported.map(&:platform)
36
+ end
37
+
31
38
  # Get the toolchain for the current platform.
32
39
  #
33
40
  # @return [RbSys::ToolchainInfo]
@@ -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.91"
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.91
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-04-02 00:00:00.000000000 Z
34
34
  dependencies: []
35
35
  description:
36
36
  email:
metadata.gz.sig CHANGED
@@ -1 +1 @@
1
- ��G��43��1�z^��Jl�D7;~�&������GU���X��'M����Rxf�1&@�NX"�p��IYw9PH<ea��I:y%�f��ƈ-y���b���Y�|ޗ��+���0dp�ÿ{���jԫ��1~��}iZN����!��M۠�wt�>1��L���`vs4���>��A%�h�>U�'������ي&�*S9���NxK_fo �Qb��9c=Z��Zq!��0����:�.��
1
+ l�kp��`����Ҽ?������wU���O�l��7���J�"͙ [={Jϴ|Toѳ��4v"�e^�A�2��c �]O:_�{r��>�%�Պ��r|~w�z �e��GX�(N�A�<�oP>'~Zf;�Y�m- kEi���H��l|kU����N���&�(K&M���:��|~