mingw-make 1.0.0-x64-mingw-ucrt → 1.2.0-x64-mingw-ucrt

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: 9706ca235794d928d5df706432b8fcc9f8ce1a5ff49607b39dd83c9c40e17795
4
- data.tar.gz: fa576989d96e43aa0fc88b1b1fe759b5d3430e870c2d46b107db4d7076df1fb1
3
+ metadata.gz: ee69bb2bcae4f8e3cf824914e88bacf4d4e3dcea1884b85792f7c1794641a516
4
+ data.tar.gz: 456ce51aee4a68614fa8802337d7078b40bf54a7f6a19a57a46ee37663d1b02a
5
5
  SHA512:
6
- metadata.gz: 55111f155992ecf15b6e65157cdc89a184010d06c6a117dc94ed13980ad9583c3bc40c33aa96466f06f38a4bf937fd94aeb0e4cd5d254c3f048a0c4595b1c5b4
7
- data.tar.gz: eb79299cd21d25ba0409a48af05ade2ba3fb8f087c458e75bd5064907406cf3c31aa3459f7f94a4e5e257a8d2e60686f0d9b6afb2a84e5ffb79724b963107464
6
+ metadata.gz: aa8b3f61669b40cb8c2e9c1ce99353e5c5466560bbc420727b1c7ec17fa2cfaf1ddb14a19708bb4a67487280f2eb100960e80207e3b640dcc32108ade60d0ece
7
+ data.tar.gz: 7fd22148216bd2ee246331db9a4416ec23c90ba03f3e2ec0f06c0a045c0948e419d7eeb71d46aba0ed2d3e7aacb3e63a04184fb0128c1e6b36f49ba6fbb1c1fa
data/README.md CHANGED
@@ -4,19 +4,57 @@ However, [__Minimum__ GNU for Windows (MinGW)](https://github.com/niXman/mingw-b
4
4
  a key component of MSYS2, is sufficient for half of the jobs all on its own.
5
5
 
6
6
  `mingw-make` is a set of tiny non-intrusive mods for [RubyInstaller2 for Windows](https://rubyinstaller.org)
7
- that solves the hurdles on the other half minimally.
7
+ that solves the hurdles on the other half minimally, namely by replacing `rbconfig` entries of compilation commands.
8
8
  With the aid of the secret [`ruby -run`](https://github.com/ruby/un) capability it has unleashed,
9
9
  all it took was a couple of quick hacks and we have ourselves a lightweight Devkit.
10
10
 
11
11
  Setups with MinGW and RubyInstaller’s prebuilds with these patches are ideal to keep footprints small,
12
- for experts strongly recommend WSL for a fully-fledged Ruby environment.
12
+ though experts strongly recommend WSL for a fully-fledged Ruby environment.
13
13
 
14
- This is a newly published experiment; I have only tested with a couple of projects, `bigdecimal-3.1.6` among them.
15
- In theory, it’s compatible with anything that doesn’t leave [`mkmf`](https://rubyapi.org/o/MakeMakefile)’s comfort zone,
14
+ ### Compatibility
15
+
16
+ I’m glad to announce that, except for Prism for which I have sent PRs,
17
+ **this experiment works with `gem update` versions of every [Default and Bundled C extension](https://stdgems.org) 📈**.
18
+
19
+ While I have only tested this experiment with the following projects,
20
+ In theory, it’s compatible with anything that doesn’t leave
21
+ [`rbconfig`](https://rubyapi.org/o/RbConfig)+[`mkmf`](https://rubyapi.org/o/MakeMakefile)’s comfort zone,
16
22
  which I expect to be the majority of C-based gems. (It *will indeed* “take a while” when “Building native extensions”.)
17
23
  Please do [let me know](https://github.com/ParadoxV5/ruby-mingw-make/issues)
18
24
  if it doesn’t meet the expectations on something not unusual.
19
25
 
26
+ #### builds
27
+
28
+ * __`railties 7.1.3`__
29
+ * `bigdecimal 3.1.6..3.1.8`
30
+ * `racc 1.7.3..1.8.0`
31
+ * `io-console 0.7.2`
32
+ * `json 2.7.2`
33
+ * `nkf 0.2.0`
34
+ * [`prism 9bb8710`](https://github.com/ruby/prism/pull/2711)
35
+ * `strscan 3.1.0`
36
+ * `debug 1.9.2`
37
+ * `rbs 3.4.4`
38
+
39
+ #### fails
40
+ * `prism ..0.29.0`:
41
+ > * It must be possible to build prism without needing ruby/rake/etc.
42
+ > Because once prism is the single parser in TruffleRuby, JRuby or CRuby there won't be another Ruby parser around to parse such Ruby code.
43
+ > \[…]
44
+ >
45
+ > The main solution for the second point seems a Makefile, otherwise many of the usages would have to duplicate the logic to build prism.
46
+ >
47
+ > ⸺ https://github.com/ruby/prism/blob/19c67fb/docs/build_system.md#requirements
48
+ * `ffi` (the platform-agnostic edition)
49
+ * RubyGems will instead prefer [the prebuilt gem](https://rubygems.org/gems/ffi/versions/1.17.0.rc2-x64-mingw-ucrt)
50
+ once it leaves RC. For now, you can join the preview manually with `gem install --prerelease ffi`.
51
+ * This transitive dependency is the last obstable before
52
+ [`steep`](https://github.com/soutaro/steep) becomes available!
53
+
54
+ ### not thoroughly tested
55
+ * `syslog 0.1.2`: [It’s UNIX-specific.](https://stackoverflow.com/a/9503254)
56
+ * `readline-ext 0.2.0`: ``extconf.rb:64:in `<main>': Neither readline nor libedit was found (RuntimeError)``
57
+
20
58
 
21
59
  ## Setup
22
60
 
@@ -33,9 +71,6 @@ if it doesn’t meet the expectations on something not unusual.
33
71
  gem install mingw-make
34
72
  ```
35
73
 
36
-
37
- ## Usage
38
-
39
74
  ### Use with `gem`
40
75
 
41
76
  Thanks to `gem`’s [plugins](https://guides.rubygems.org/plugins/) system, it’s online out of the box!
@@ -52,10 +87,15 @@ end
52
87
  ```
53
88
 
54
89
  ### Use manually
55
- Specify `mingw32-make` as the `MAKE` tool and prepend the `lib/mingw-make/mkmf.rb` script to the Ruby `$LOAD_PATH`.
90
+ *Prepend* (so it takes precedence) the [`lib/mingw-make/mkmf.rb`](lib/mingw-make/mkmf.rb)
91
+ script to the Ruby `$LOAD_PATH`. Because RubyGems `require 'rbconfig'`,
92
+ we must explicitly apply [the `rbconfig` replacements](lib/mingw-make/rbconfig-patch.rb).
93
+ ```bat
94
+ set RUBYOPT=-Ipath/to/gems/mingw-make/lib/mingw-make/ -rrbconfig-patch
95
+ ```
96
+ You may also need to specify a fallback for the `MAKE` tool, e.g.:
56
97
  ```bat
57
98
  set MAKE=mingw32-make
58
- set RUBYOPT=-Ipath/to/gems/mingw-make/lib/mingw-make/
59
99
  ```
60
100
 
61
101
 
data/bin/make ADDED
@@ -0,0 +1,2 @@
1
+ #!ruby
2
+ exec 'mingw32-make', *ARGV
@@ -1,22 +1,5 @@
1
1
  # frozen_string_literal: true
2
-
3
- require 'rbconfig'
4
-
5
- # Get `mkmf` to fall back to `ruby -run`
6
- %w[
7
- RM
8
- RMALL
9
- RMDIRS
10
- MAKEDIRS
11
- INSTALL
12
- INSTALL_PROG
13
- INSTALL_DATA
14
- CP
15
- ].each do|key|
16
- RbConfig::CONFIG.delete key
17
- RbConfig::MAKEFILE_CONFIG.delete key
18
- end
19
-
2
+ require_relative 'rbconfig-patch'
20
3
  require File.join RbConfig::CONFIG['rubylibdir'], 'mkmf'
21
4
 
22
5
  module MakeMakefile
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Normally, RubyGems `require`s `rbconfig` itself, so overloading `require 'rbconfig'` may be ineffective.
4
+ # Howëver, if RubyGems are disabled (`--disable-gems`), nameing this file `rbconfig.rb` would conflict with the design,
5
+ # which depends on the original {RbConfig} to bypass the modified `$LOAD_PATH` to fetch the original {MakeMakefile}.
6
+
7
+ require 'rbconfig'
8
+
9
+ # Use `ruby -run` fall-backs
10
+ install = 'ruby -run -e install -- -p'
11
+ fixed = {
12
+ 'RM' => 'ruby -run -e rm -- -f',
13
+ 'RMALL' => 'ruby -run -e rm -- -rf',
14
+ 'RMDIRS' => 'ruby -run -e rmdir -- -p',
15
+ 'MAKEDIRS' => 'ruby -run -e mkdir -- -p',
16
+ 'CP' => 'ruby -run -e cp --',
17
+ 'INSTALL' => install
18
+ }
19
+ install_args = {
20
+ 'INSTALL_PROG' => '-m 0755',
21
+ 'INSTALL_DATA' => '-m 0644'
22
+ }
23
+ RbConfig::MAKEFILE_CONFIG.merge! fixed, install_args.transform_values { "$(INSTALL) #{_1}" }
24
+ RbConfig::CONFIG.merge! fixed, install_args.transform_values { "#{install} #{_1}" }
data/lib/mingw-make.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Set up `RUBYOPT=-I/absolute/path/to/lib/mingw-make/` for subprocesses
4
- ENV['RUBYOPT'] = "#{ENV['RUBYOPT']} -I#{File.join __dir__, 'mingw-make'}"
5
- ENV['MAKE'] ||= 'mingw32-make'
3
+ # Set up `RUBYOPT=-I/absolute/path/to/lib/mingw-make/ -rrbconfig-patch` for subprocesses
4
+ ENV['RUBYOPT'] = "#{ENV['RUBYOPT']} -I#{File.join __dir__, 'mingw-make'} -rrbconfig-patch"
5
+ ENV['MAKE'] ||= 'make'
@@ -17,4 +17,4 @@ else
17
17
  end
18
18
  end
19
19
 
20
- Gem.pre_install { require_relative 'mingw-make' }
20
+ Gem.pre_install { require_relative 'mingw-make' or nil }
data/mingw-make.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do|spec|
4
4
  spec.name = 'mingw-make'
5
5
  spec.summary = 'Patches that enable Windows Ruby to install C extension gems with MinGW without MSYS2 (Devkit)'
6
- spec.version = '1.0.0'
6
+ spec.version = '1.2.0'
7
7
  spec.author = 'ParadoxV5'
8
8
  spec.license = 'WTFPL'
9
9
 
@@ -15,8 +15,9 @@ Gem::Specification.new do|spec|
15
15
  'bug_tracker_uri' => File.join(github, 'issues'),
16
16
  'funding_uri' => "https://github.com/sponsors/#{github_account}"
17
17
  }
18
-
19
- spec.files = Dir['**/*']
18
+
19
+ spec.files = Dir['**/*'].grep_v 'Gemfile'
20
+ spec.executable = 'make'
20
21
 
21
22
  spec.platform = 'x64-mingw-ucrt'
22
23
  spec.required_ruby_version = '~> 3.1'
metadata CHANGED
@@ -1,26 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mingw-make
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - ParadoxV5
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-10 00:00:00.000000000 Z
11
+ date: 2024-05-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
15
- executables: []
15
+ executables:
16
+ - make
16
17
  extensions: []
17
18
  extra_rdoc_files: []
18
19
  files:
19
- - Gemfile
20
20
  - LICENSE.txt
21
21
  - README.md
22
+ - bin/make
22
23
  - lib/mingw-make.rb
23
24
  - lib/mingw-make/mkmf.rb
25
+ - lib/mingw-make/rbconfig-patch.rb
24
26
  - lib/rubygems_plugin.rb
25
27
  - mingw-make.gemspec
26
28
  homepage: https://github.com/ParadoxV5/ruby-mingw-make
@@ -48,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
50
  requirements:
49
51
  - Ruby from RubyInstaller2 for Windows without DevKit (MSYS2)
50
52
  - UCRT MinGW
51
- rubygems_version: 3.5.3
53
+ rubygems_version: 3.5.9
52
54
  signing_key:
53
55
  specification_version: 4
54
56
  summary: Patches that enable Windows Ruby to install C extension gems with MinGW without
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
- source 'https://rubygems.org'
3
- gemspec