ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64
@ 2020-02-24  6:55 cfis
  2020-09-04  8:25 ` [ruby-core:99919] " cfis
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: cfis @ 2020-02-24  6:55 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been reported by cfis (Charlie Savage).

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64
https://bugs.ruby-lang.org/issues/16651

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:99919] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
@ 2020-09-04  8:25 ` cfis
  2020-10-29  6:34 ` [ruby-core:100639] " cfis
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cfis @ 2020-09-04  8:25 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by cfis (Charlie Savage).


Ping?

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64
https://bugs.ruby-lang.org/issues/16651#change-87449

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:100639] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
  2020-09-04  8:25 ` [ruby-core:99919] " cfis
@ 2020-10-29  6:34 ` cfis
  2020-10-29  9:48 ` [ruby-core:100640] " nobu
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cfis @ 2020-10-29  6:34 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by cfis (Charlie Savage).


This is still and issue with Ruby 2.7.2.

The offending line of code is now at line 1908 in mkmf.rb.



----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64
https://bugs.ruby-lang.org/issues/16651#change-88275

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:100640] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
  2020-09-04  8:25 ` [ruby-core:99919] " cfis
  2020-10-29  6:34 ` [ruby-core:100639] " cfis
@ 2020-10-29  9:48 ` nobu
  2021-02-06  8:27 ` [ruby-core:102408] " cfis
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: nobu @ 2020-10-29  9:48 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by nobu (Nobuyoshi Nakada).


It would replace "C:/MSYS64/..." as "/C/MSYS64/...".
Where did a slash go?

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64
https://bugs.ruby-lang.org/issues/16651#change-88276

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:102408] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (2 preceding siblings ...)
  2020-10-29  9:48 ` [ruby-core:100640] " nobu
@ 2021-02-06  8:27 ` cfis
  2021-02-15 21:07 ` [ruby-core:102509] " cfis
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cfis @ 2021-02-06  8:27 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by cfis (Charlie Savage).


Sorry, missed your comment. This is still wrong in Ruby 3.0.0 and causes building extensions to fail.

Note the comment in this method:

```ruby
 def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        #path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1')
        path
      end
```

The problem is /C/ does not work. When you try to compile an extension with mingw64/msys, you get this error message:

```bash
* No rule to make target '/C/msys64/usr/local/ruby-3.0.0/include/ruby-3.0.0/ruby.h', needed by 'breakpoint.o'.  Stop.
```

If you comment out this line:

```ruby
#path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1')
```

Then the paths becomes:

C:/msys64/usr/local/ruby-3.0.0/include/ruby-3.0.0/ruby.h

And the problem is fixed.

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64
https://bugs.ruby-lang.org/issues/16651#change-90281

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:102509] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (3 preceding siblings ...)
  2021-02-06  8:27 ` [ruby-core:102408] " cfis
@ 2021-02-15 21:07 ` cfis
  2021-04-02  8:45 ` [ruby-core:103174] " cfis
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cfis @ 2021-02-15 21:07 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by cfis (Charlie Savage).


Any thoughts?

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64
https://bugs.ruby-lang.org/issues/16651#change-90403

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103174] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (4 preceding siblings ...)
  2021-02-15 21:07 ` [ruby-core:102509] " cfis
@ 2021-04-02  8:45 ` cfis
  2021-04-02 10:55 ` [ruby-core:103177] " xtkoba+ruby
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cfis @ 2021-04-02  8:45 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by cfis (Charlie Savage).


When running msys2 (ie, in an open console) the /c/ notation does work.

But it does not work in makefiles processed by mingw64. If you look at the makefiles that extconf.rb generates, they use paths like c:/abc/def *except* for this one case. And this one case breaks building extensions if you are using mingw make. Thus this should be changed (note that msys supports the c:/ format also). 

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64
https://bugs.ruby-lang.org/issues/16651#change-91249

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103177] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (5 preceding siblings ...)
  2021-04-02  8:45 ` [ruby-core:103174] " cfis
@ 2021-04-02 10:55 ` xtkoba+ruby
  2021-04-08  6:28 ` [ruby-core:103294] " cfis
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: xtkoba+ruby @ 2021-04-02 10:55 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by xtkoba (Tee KOBAYASHI).


This issue is related to commit commit:389157d8cfab7b6e84cdcdb2863421bd2c93bd7f, which merged the patch posted as [[ruby-core:21448]](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/21448). The description of the patch reads that the character `:` in the path confuses `make` from MSYS because it is interpreted as a path separator. If this is still true, then we cannot simply leave `:` unremoved with a drive letter.

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64
https://bugs.ruby-lang.org/issues/16651#change-91252

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103294] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (6 preceding siblings ...)
  2021-04-02 10:55 ` [ruby-core:103177] " xtkoba+ruby
@ 2021-04-08  6:28 ` cfis
  2021-04-08 20:31 ` [ruby-core:103316] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw64-make xtkoba+ruby
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cfis @ 2021-04-08  6:28 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by cfis (Charlie Savage).


Thanks for the background, that was very helpful. The difference is that I am using mingw64 make, not msys make. So:

* msys make supports /C/msys64/usr/local/ruby-2.7.2/include/ruby-2.7.0 and C:/msys64/usr/local/ruby-2.7.2/include/ruby-2.7.0

* mingw make only supports c:/msys64/usr/local/ruby-2.7.2/include/ruby-2.7.0

If you look at the generated makefiles (this is from gem install --platform ruby pg):

```
topdir = /C/msys64/usr/local/ruby-2.7.2/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/msys64/usr/local/ruby-2.7.2/include/ruby-2.7.0/x64-mingw32
```

Notice all paths are in the form of c:/ already *except* for the topdir path. 

Bottom line - the patch from 12 years ago no longer is useful. It is not needed for msys make and it breaks mingw-make. So can it be removed?

Thanks - Charlie

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64
https://bugs.ruby-lang.org/issues/16651#change-91379

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103316] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw64-make
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (7 preceding siblings ...)
  2021-04-08  6:28 ` [ruby-core:103294] " cfis
@ 2021-04-08 20:31 ` xtkoba+ruby
  2021-04-09  7:35 ` [ruby-core:103335] " cfis
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: xtkoba+ruby @ 2021-04-08 20:31 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by xtkoba (Tee KOBAYASHI).


I suppose `arch_hdrdir` also should have been canonicalized by `mkintpath`, because otherwise it would cause trouble with `VPATH` in `Makefile` which is defined as:

```make
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
```

And I believe that the notation of `VPATH` as above does not work well with `mingw32-make`, because [it allows only one path](http://mingw.5.n7.nabble.com/mingw32-make-VPATH-doesn-t-work-td6550.html).

It seems clear that `mingw32-make` is not supported in the current build system of Ruby. I doubt if the maintainers have tried to support it ever.

One way of supporting both `make` from MSYS and `mingw32-make` would be to stop using `VPATH`, although I have no idea whether this is possible. FYI, `VPATH` seems to cause another trouble (Bug #12179), and it would be desirable if we could throw it away.

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64 with mingw64-make
https://bugs.ruby-lang.org/issues/16651#change-91405

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103335] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw64-make
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (8 preceding siblings ...)
  2021-04-08 20:31 ` [ruby-core:103316] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw64-make xtkoba+ruby
@ 2021-04-09  7:35 ` cfis
  2021-04-09 10:05 ` [ruby-core:103340] " nobu
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cfis @ 2021-04-09  7:35 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by cfis (Charlie Savage).


VPATH works fine with arch_hdrdir in the form `c:/msys64/etc` - Ruby has been doing that on Windows for many years.

With my proposed fix both msys make and mingw64 make work correctly.



----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64 with mingw64-make
https://bugs.ruby-lang.org/issues/16651#change-91427

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103340] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw64-make
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (9 preceding siblings ...)
  2021-04-09  7:35 ` [ruby-core:103335] " cfis
@ 2021-04-09 10:05 ` nobu
  2021-04-09 22:18 ` [ruby-core:103359] " xtkoba+ruby
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: nobu @ 2021-04-09 10:05 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by nobu (Nobuyoshi Nakada).


cfis (Charlie Savage) wrote in #note-12:
> VPATH works fine with arch_hdrdir in the form `c:/msys64/etc` - Ruby has been doing that on Windows for many years.

Does it work with different drives too?

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64 with mingw64-make
https://bugs.ruby-lang.org/issues/16651#change-91431

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.

The fix is simple, just delete that line. The makefile should look like this:

srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103359] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw64-make
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (10 preceding siblings ...)
  2021-04-09 10:05 ` [ruby-core:103340] " nobu
@ 2021-04-09 22:18 ` xtkoba+ruby
  2021-04-10  6:18 ` [ruby-core:103365] " nobu
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: xtkoba+ruby @ 2021-04-09 22:18 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by xtkoba (Tee KOBAYASHI).


I suppose it is by luck that `arch_hdrdir` of the form `C:/foo/bar` is not causing problems with `make` from MSYS. In fact, in my environment (not Windows) `gem install rails && rails new foo` succeeds when `VPATH` is modified such that it does not contain `$(arch_hdrdir)/ruby`, or not even `$(hdrdir)/ruby`. I wonder if any extension in the world requires these paths contained in `VPATH`.

The proposed modification might be OK for `make` from MSYS if the definition of `VPATH` can be modified so that it never contains any drive letters. Note that some extensions (e.g. [sassc](https://github.com/sass/sassc-ruby)) add additional paths to `VPATH`. And assuming that the modification is applied, I doubt if `mingw32-make` will successfully build an extension which really depends on `VPATH` containing multiple paths.

user:cfis Could you please try to `gem install sassc` with `mingw32-make`? If it really does not work with multiple paths in `VPATH`, then it should fail to build that extension. Unfortunately I do not have access to Windows machines connected to the Internet.

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64 with mingw64-make
https://bugs.ruby-lang.org/issues/16651#change-91450

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

```makefile
srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

```ruby
      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end
```

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

```
make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.
```

The fix is simple, just delete that line. The makefile should look like this:

```makefile
srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103365] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw64-make
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (11 preceding siblings ...)
  2021-04-09 22:18 ` [ruby-core:103359] " xtkoba+ruby
@ 2021-04-10  6:18 ` nobu
  2021-04-11 13:02 ` [ruby-core:103385] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw32-make nobu
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: nobu @ 2021-04-10  6:18 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by nobu (Nobuyoshi Nakada).


Building io-console with 2.7.2 from RubyInstaller:
```
$ ruby -v ../src/ext/io/console/extconf.rb
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x64-mingw32]
checking for HAVE_RUBY_FIBER_SCHEDULER_H... no
checking for rb_scheduler_timeout()... no
creating Makefile

$ grep -e ^topdir -e ^arch_hdrdir Makefile
topdir = /C/Ruby27-x64/include/ruby-2.7.0
arch_hdrdir = C:/Ruby27-x64/include/ruby-2.7.0/x64-mingw32

$ make
compiling ../src/ext/io/console/console.c
linking shared-object io/console.so
```
It succeeds with no problem.

`/C/` is not wrong in msys make, I'm not sure why the first description had the wrong path without the leading slash.

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64 with mingw64-make
https://bugs.ruby-lang.org/issues/16651#change-91456

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

```makefile
srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

```ruby
      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end
```

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

```
make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.
```

The fix is simple, just delete that line. The makefile should look like this:

```makefile
srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103385] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw32-make
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (12 preceding siblings ...)
  2021-04-10  6:18 ` [ruby-core:103365] " nobu
@ 2021-04-11 13:02 ` nobu
  2021-04-23  4:23 ` [ruby-core:103570] " cfis
  2021-05-22  7:28 ` [ruby-core:103969] " nagachika00
  15 siblings, 0 replies; 17+ messages in thread
From: nobu @ 2021-04-11 13:02 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by nobu (Nobuyoshi Nakada).

Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED
Subject changed from Extensions Do Not Compile on Mingw64 with mingw64-make to Extensions Do Not Compile on Mingw64 with mingw32-make

MinGW on MSys build is cross compilation.
No reason to use mingw32-make.

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64 with mingw32-make
https://bugs.ruby-lang.org/issues/16651#change-91480

* Author: cfis (Charlie Savage)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

```makefile
srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

```ruby
      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end
```

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

```
make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.
```

The fix is simple, just delete that line. The makefile should look like this:

```makefile
srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103570] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw32-make
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (13 preceding siblings ...)
  2021-04-11 13:02 ` [ruby-core:103385] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw32-make nobu
@ 2021-04-23  4:23 ` cfis
  2021-05-22  7:28 ` [ruby-core:103969] " nagachika00
  15 siblings, 0 replies; 17+ messages in thread
From: cfis @ 2021-04-23  4:23 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by cfis (Charlie Savage).


To answer the questions above:

* gem install sassc works fine
* using different drives, d:/ works fine

I don't understand the reason for this change - it just makes building on mingw64 with mingw-64 on windows more broken. If the format c:/ didn't work, then every native gem would have failed to compile because arch_hdrdir  used that style. So clearly it does work.

Thus arch_hdrdir should not be changed, and instead topdir should have changed.


----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64 with mingw32-make
https://bugs.ruby-lang.org/issues/16651#change-91670

* Author: cfis (Charlie Savage)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

```makefile
srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

```ruby
      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end
```

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

```
make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.
```

The fix is simple, just delete that line. The makefile should look like this:

```makefile
srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ruby-core:103969] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw32-make
  2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
                   ` (14 preceding siblings ...)
  2021-04-23  4:23 ` [ruby-core:103570] " cfis
@ 2021-05-22  7:28 ` nagachika00
  15 siblings, 0 replies; 17+ messages in thread
From: nagachika00 @ 2021-05-22  7:28 UTC (permalink / raw)
  To: ruby-core

Issue #16651 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE

ruby_3_0 5e21726cda22e3cb34127751aec7e9babb4308b3 merged revision(s) 799ea1d1540aca03542ee31647052343507a4b41.

----------------------------------------
Bug #16651: Extensions Do Not Compile on Mingw64 with mingw32-make
https://bugs.ruby-lang.org/issues/16651#change-92102

* Author: cfis (Charlie Savage)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
* Backport: 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE
----------------------------------------
When mkmf.rb creates a Makefile for an extension, it will generate something that looks like this:

```makefile
srcdir = .
topdir = C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Notice the topdir path is c/ without the ":" Its only the topdir that does this, all other paths in the makefile use the "c:/" style.

mkmf.rb intentionally does that, see line 1098:

```ruby
      def mkintpath(path)
        # mingw uses make from msys and it needs special care
        # converts from C:\some\path to /C/some/path
        path = path.dup
        path.tr!('\\', '/')
        path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1') <-------- This line
        path
      end
```

But this is wrong, and causes errors like this (this is compiling the debase gem but it doesn't matter what c extension you use):

```
make: *** No rule to make target 'C/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/ruby.h', needed by 'breakpoint.o'.  Stop.
```

The fix is simple, just delete that line. The makefile should look like this:

```makefile
srcdir = .
topdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0
hdrdir = $(topdir)
arch_hdrdir = C:/MSYS64/USR/LOCAL/ruby-2.7.0/include/ruby-2.7.0/x64-mingw32
```

Note I'm not the first person to see this, but I've just been manually fixing it over the years. Would be good to really fix it.

https://github.com/oneclick/rubyinstaller2/issues/105
https://github.com/oneclick/rubyinstaller2/issues/47
https://github.com/tmm1/http_parser.rb/issues/55

Note some of those tickets put the blame on using mingw-make versus msys make. But on my system, neither work with the "c/" style path but both work with the "c:/" style path.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-05-22  7:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24  6:55 [ruby-core:97248] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 cfis
2020-09-04  8:25 ` [ruby-core:99919] " cfis
2020-10-29  6:34 ` [ruby-core:100639] " cfis
2020-10-29  9:48 ` [ruby-core:100640] " nobu
2021-02-06  8:27 ` [ruby-core:102408] " cfis
2021-02-15 21:07 ` [ruby-core:102509] " cfis
2021-04-02  8:45 ` [ruby-core:103174] " cfis
2021-04-02 10:55 ` [ruby-core:103177] " xtkoba+ruby
2021-04-08  6:28 ` [ruby-core:103294] " cfis
2021-04-08 20:31 ` [ruby-core:103316] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw64-make xtkoba+ruby
2021-04-09  7:35 ` [ruby-core:103335] " cfis
2021-04-09 10:05 ` [ruby-core:103340] " nobu
2021-04-09 22:18 ` [ruby-core:103359] " xtkoba+ruby
2021-04-10  6:18 ` [ruby-core:103365] " nobu
2021-04-11 13:02 ` [ruby-core:103385] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 with mingw32-make nobu
2021-04-23  4:23 ` [ruby-core:103570] " cfis
2021-05-22  7:28 ` [ruby-core:103969] " nagachika00

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).