rb_sys 0.9.116 → 0.9.118

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: c10ec40aea0259f407e51f708633296c4594cc105bed6b072473af1c19d2e74e
4
- data.tar.gz: b9555c70c5fde2b91c93c44bb8b0cc05d3797883b1ed6630a23ff7aa83373673
3
+ metadata.gz: a7769c6390c96fd8779a22b6397e5dbf747b1f4c00c2ff1bdd522c7bcdcde736
4
+ data.tar.gz: 9ec86176519b61b5babbb4506ea0bb9d0484de6c57f5a45b7fd95645ff7043d9
5
5
  SHA512:
6
- metadata.gz: '09ad40c08c1fe156c51dc8788c705474917741af95afa6cc3f76011f5a407d6ad4934779878cbe70abb7ab2571167f609ef711ea388f229ea756faba4e539493'
7
- data.tar.gz: 2510debc3f63a22c98c6d769af4906b194923b47c02f08e4febecfe0a91c5b5370107814b4f4cfbbe886320f3e7ab7aaa5cf41fb4cc943c790f3f4766de8f95e
6
+ metadata.gz: 370581d111056bffbb17a8d51ec4a5c6d5d779106cc3935de24e69dbe9a74132fbd52a21e768e872f453ae6d2ce9e6cf0e615aa9a26afb1b2b7f913cab69654f
7
+ data.tar.gz: f246f16238c74858ca6290dfe81e76312f8294698bce68e362e8be29e4f5cc55e15dd206c12eabcbd0e7eaa14266a55be631ee142ab2aa0faa7523a15dd8c05f
checksums.yaml.gz.sig CHANGED
Binary file
data/exe/rb-sys-dock CHANGED
@@ -14,7 +14,7 @@ require "tmpdir"
14
14
 
15
15
  OPTIONS = {
16
16
  docker_platform: "linux/amd64",
17
- version: RbSys::VERSION,
17
+ version: ENV["RCD_IMAGE_VERSION"] || RbSys::VERSION,
18
18
  directory: Dir.pwd
19
19
  }
20
20
 
@@ -99,28 +99,30 @@ OptionParser.new do |opts|
99
99
  OPTIONS[:toolchain_info] = toolchain_info
100
100
  end
101
101
 
102
- opts.on("-r", "--ruby-versions LIST", "List all supported Ruby versions") do |arg|
103
- vers = arg.split(/[^0-9.]+/).map do |v|
104
- override = RakeCompilerDock.cross_rubies[v]
102
+ opts.on("-r", "--ruby-versions LIST", "Comma- or colon-separated Ruby requirements (e.g., '3.4,~> 3.1')") do |arg|
103
+ requirements = arg.tr(":", ",").split(",").map(&:strip).reject(&:empty?)
105
104
 
106
- next override if override
107
-
108
- parts = v.split(".")
109
- parts[2] = "0" if parts[2].nil?
110
- parts.join(".")
105
+ begin
106
+ resolved = RakeCompilerDock.ruby_cc_version(*requirements)
107
+ rescue => error
108
+ logger.error("Could not resolve requested Ruby versions: #{error.message}")
109
+ exit(1)
111
110
  end
112
111
 
113
- OPTIONS[:ruby_versions] = vers
112
+ resolved_versions = resolved.split(":")
113
+ OPTIONS[:ruby_version_requirements] = requirements
114
+ OPTIONS[:ruby_versions] = resolved_versions
114
115
 
115
- logger.info("Building for Ruby requested versions: #{vers}")
116
+ logger.info("Building for Ruby requested versions: #{resolved_versions.join(":")}")
116
117
 
117
- ENV["RUBY_CC_VERSION"] = vers.join(":")
118
+ RakeCompilerDock.set_ruby_cc_version(*requirements)
118
119
  end
119
120
 
120
121
  opts.on("--tag TAG", "Use a specific version of the Docker image") do |tag|
121
122
  logger.info("Using version #{tag} of the Docker image")
122
123
  OPTIONS[:version] = tag
123
124
  OPTIONS[:no_cache] = tag == "latest"
125
+ ENV["RCD_IMAGE_VERSION"] = tag
124
126
  end
125
127
 
126
128
  opts.on("--list-platforms", "--list", "List all supported platforms") do
@@ -445,7 +447,9 @@ def log_some_useful_info
445
447
  end
446
448
 
447
449
  def set_env
448
- ENV["RCD_IMAGE"] ||= "rbsys/#{ruby_platform}:#{OPTIONS[:version]}"
450
+ ENV["RCD_IMAGE_VERSION"] ||= OPTIONS[:version]
451
+ version = ENV.fetch("RCD_IMAGE_VERSION")
452
+ ENV["RCD_IMAGE"] ||= "rbsys/#{ruby_platform}:#{version}"
449
453
  end
450
454
 
451
455
  def lint_rb_sys
@@ -110,6 +110,10 @@ module RbSys
110
110
  end
111
111
  end
112
112
 
113
+ def rubygems_invoked?
114
+ ENV.key?("SOURCE_DATE_EPOCH") && ENV["RB_SYS_TEST"] != "1" && !ENV.key?("NIX_STORE")
115
+ end
116
+
113
117
  private
114
118
 
115
119
  def rb_config_env
@@ -342,10 +346,6 @@ module RbSys
342
346
  end
343
347
  end
344
348
 
345
- def rubygems_invoked?
346
- ENV.key?("SOURCE_DATE_EPOCH") && ENV["RB_SYS_TEST"] != "1"
347
- end
348
-
349
349
  def musl?
350
350
  RbConfig::CONFIG["target_os"] == "linux-musl" || RbConfig::CONFIG["CC"]&.include?("musl-gcc")
351
351
  end
data/lib/rb_sys/error.rb CHANGED
@@ -8,8 +8,8 @@ module RbSys
8
8
  class PackageNotFoundError < Error
9
9
  def initialize(name)
10
10
  msg = <<~MSG.chomp.tr("\n", " ")
11
- Could not find Cargo package metadata for #{@name.inspect}. Please
12
- check that #{@name.inspect} matches the crate name in your
11
+ Could not find Cargo package metadata for #{name.inspect}. Please
12
+ check that #{name.inspect} matches the crate name in your
13
13
  Cargo.toml."
14
14
  MSG
15
15
 
@@ -55,12 +55,16 @@ module RbSys
55
55
  @builder.respond_to?(name) || super
56
56
  end
57
57
 
58
- # Seems to be the only way to reliably know if we were invoked by Rubygems.
59
- # We want to know this so we can cleanup the target directory after an
60
- # install, to remove bloat.
61
- # @api private
58
+ # Unfortunate, but this seems to be the only way to reliably know if we
59
+ # were invoked by Rubygems. We want to know this so we can cleanup the
60
+ # target directory after an install, to remove bloat.
61
+ #
62
+ # Note: we avoid nix environments so we do not force recompilation in
63
+ # development, and accept that the "clean" task will not automatically
64
+ # run.
65
+ #
62
66
  def rubygems_invoked?
63
- ENV.key?("SOURCE_DATE_EPOCH") && ENV["RB_SYS_TEST"] != "1"
67
+ ENV.key?("SOURCE_DATE_EPOCH") && ENV["RB_SYS_TEST"] != "1" && !ENV.key?("NIX_STORE")
64
68
  end
65
69
 
66
70
  def use_stable_api_compiled_fallback?
data/lib/rb_sys/mkmf.rb CHANGED
@@ -286,9 +286,18 @@ module RbSys
286
286
  end
287
287
 
288
288
  def fixup_libnames
289
- return unless find_executable("install_name_tool")
289
+ # Try to find install_name_tool, checking multiple possible names:
290
+ # 1. Native macOS install_name_tool
291
+ # 2. Target-prefixed version from osxcross (e.g., aarch64-apple-darwin-install_name_tool)
292
+ tool = if find_executable("install_name_tool")
293
+ "install_name_tool"
294
+ elsif find_executable("$(CARGO_BUILD_TARGET)-install_name_tool")
295
+ "$(CARGO_BUILD_TARGET)-install_name_tool"
296
+ else
297
+ return
298
+ end
290
299
 
291
- '$(Q) install_name_tool -id "" $(DLLIB)'
300
+ %($(Q) #{tool} -id "" $(DLLIB))
292
301
  end
293
302
 
294
303
  def if_eq_stmt(a, b)
@@ -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" => {"aliases" => ["aarch64-linux-gnu", "aarch64-unknown-linux-gnu"], "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" => {"aliases" => ["x86_64-linux-gnu", "x86_64-unknown-linux-gnu"], "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" => {"aliases" => ["aarch64-linux-gnu", "aarch64-unknown-linux-gnu"], "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}, "aarch64-mingw-ucrt" => {"rust-target" => "aarch64-pc-windows-gnullvm", "rake-compiler-dock" => {"cc" => "aarch64-w64-mingw32-clang"}, "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" => {"aliases" => ["x86_64-linux-gnu", "x86_64-unknown-linux-gnu"], "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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbSys
4
- VERSION = "0.9.116"
4
+ VERSION = "0.9.118"
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.116
4
+ version: 0.9.118
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
@@ -29,7 +29,7 @@ cert_chain:
29
29
  C/k2s4tlFwg7XEtz7wjSnVeiNP9EOK50WgVr4muWx1rhvOFhpxypONCCANJUILGk
30
30
  1JUZhXwcbcst
31
31
  -----END CERTIFICATE-----
32
- date: 2025-06-02 00:00:00.000000000 Z
32
+ date: 1980-01-01 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake-compiler-dock
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.9.1
40
+ version: 1.10.0
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.9.1
47
+ version: 1.10.0
48
48
  email:
49
49
  - i.kerseymer@gmail.com
50
50
  executables:
@@ -86,14 +86,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 2.5.0
89
+ version: 2.7.0
90
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubygems_version: 3.6.2
96
+ rubygems_version: 3.6.9
97
97
  specification_version: 4
98
98
  summary: Helpers for compiling Rust extensions for ruby
99
99
  test_files: []
metadata.gz.sig CHANGED
Binary file