From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 3E4121F66E for ; Fri, 4 Sep 2020 08:25:35 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 06C84120C17; Fri, 4 Sep 2020 17:24:56 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 9EA6F120C09 for ; Fri, 4 Sep 2020 17:24:53 +0900 (JST) Received: by filterdrecv-p3iad2-865cf6bb5-q5knt with SMTP id filterdrecv-p3iad2-865cf6bb5-q5knt-20-5F51F9F3-2A 2020-09-04 08:25:23.462278036 +0000 UTC m=+221017.994535719 Received: from herokuapp.com (unknown) by ismtpd0051p1iad1.sendgrid.net (SG) with ESMTP id BvdqnKpdS_yCl8DmVePbjQ for ; Fri, 04 Sep 2020 08:25:23.303 +0000 (UTC) Date: Fri, 04 Sep 2020 08:25:23 +0000 (UTC) From: cfis@savagexi.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 75754 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 16651 X-Redmine-Issue-Author: cfis X-Redmine-Sender: cfis X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?DI8k0T5AJunnf8HaICOhHpeiceGcYEWFq4zZVwvjN3IRGpkhluarpqwDaJE0aK?= =?us-ascii?Q?xnku5woLyqnWpI3Yv19P6GBIGLh0Z3aOoJwJH1J?= =?us-ascii?Q?Z4PW9gSNtxHczUsXe5bhnw7f7ksAv7hBjL4NjGS?= =?us-ascii?Q?qNkObj9FwQxPgueNruNoTycA0FgB=2FD0rwTp=2FjB0?= =?us-ascii?Q?LmxoKVGOOc0RKvEP0K9v4z0XOhE=2F7GOq4RmotmV?= =?us-ascii?Q?ReWzsvgQ3Zxz3KQ8k=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 99919 Subject: [ruby-core:99919] [Ruby master Bug#16651] Extensions Do Not Compile on Mingw64 X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "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/