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-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.7 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no 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 979E11F8C6 for ; Fri, 25 Jun 2021 11:12:11 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 390BC120A66; Fri, 25 Jun 2021 20:10:55 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id A6D411209D0 for ; Fri, 25 Jun 2021 20:10:52 +0900 (JST) Received: by filterdrecv-c8c5888c4-g5bqv with SMTP id filterdrecv-c8c5888c4-g5bqv-1-60D5B9FF-6A 2021-06-25 11:12:00.073022674 +0000 UTC m=+547447.578176013 Received: from herokuapp.com (unknown) by geopod-ismtpd-2-1 (SG) with ESMTP id xn28miEARhilfTjIIRTiXQ for ; Fri, 25 Jun 2021 11:11:59.909 +0000 (UTC) Date: Fri, 25 Jun 2021 11:12:00 +0000 (UTC) From: larskanis@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17845 X-Redmine-Issue-Author: MSP-Greg X-Redmine-Sender: larskanis 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-Redmine-MailingListIntegration-Message-Ids: 80520 X-SG-EID: =?us-ascii?Q?+E+TGAYxgAqNvT2Hc3jgthCyK1YJRpYNPBZWWqZMzpX709PvZz+qEITQKSCaq4?= =?us-ascii?Q?BAk6ckyHASfXlvo7IYBQw0SJKIeTMmh5luwqAmo?= =?us-ascii?Q?WKgb49yvT0Ip2wfGPzjhvNvCS8ZitDz=2FLIkXGR0?= =?us-ascii?Q?PO1m2xCfLffYjKg5kDHGI=2F+CBhXuk5bQyIc5M0o?= =?us-ascii?Q?Fo+6ivtACqZG4zt34oD9lPWah6NbaTAKvuA=3D=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 104403 Subject: [ruby-core:104403] [Ruby master Feature#17845] Windows Ruby - ucrt build? 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 #17845 has been updated by larskanis (Lars Kanis). Thinking a bit more about the ABI incompatibilities convinced me more about the need to differentiate the ruby platforms on Windows. So I added another patch to https://github.com/ruby/ruby/pull/4599 which sets `CONFIG['arch']` and `RUBY_PLATFORM` to "x64-mingw-ucrt". This allows easy differentiation between ABI incompatible platforms like MSWIN64 and MSVCRT-based MINGW32 and it also implicates a distinct rubygem platform which is also "x64-mingw-ucrt". See also the [table in the pull request](https://github.com/ruby/ruby/pull/4599). Although the term "mingw32" is the OS-part even for 64 bit systems, the "32" is misleading and confusing for many users. Therefore the new platform string drops the "32" from the OS part to just "mingw". This conforms to the common practice of windows platform testing per RUBY_PLATFORM=~/mswin|mingw/ . Binaries are available here: https://github.com/oneclick/rubyinstaller2/releases/tag/rubyinstaller-head I did some testing with several rails apps on rubyinstaller-head (x64-mingw-ucrt) and it did not show any regressions. There is only one issue with bundler: x64-mingw-ucrt is treated as platform "ruby" and "mri" in the Gemfile. This is probably conform to the understanding of most users, but it is against the specification of [bundlers platform argument](https://github.com/rubygems/rubygems/blob/96e5cff3df491c4d943186804c6d03b57fcb459b/bundler/lib/bundler/man/gemfile.5.ronn#platforms) which classifies "mri" as NOT Windows. ---------------------------------------- Feature #17845: Windows Ruby - ucrt build? https://bugs.ruby-lang.org/issues/17845#change-92646 * Author: MSP-Greg (Greg L) * Status: Open * Priority: Normal * Target version: 3.1 ---------------------------------------- Currently, Windows Ruby is normally compiled two ways. The first, mswin, is compiled using Microsoft's current Visual C compiler, and links to the universal runtime (ucrt). The second, mingw, is compiled using MinGW gcc. This links to msvcrt, an older version of Microsoft's Visual C runtime. Previously, all the MSYS2 MinGW packages linked to msvcrt. The MSYS2 project is now releasing build tools and packages linking to ucrt. MSYS2 has provided ruby packages, and GitHub user @Biswa96 contributed https://github.com/msys2/MINGW-packages/pull/8518, allowing Ruby to compile with ucrt. I tried the patch with ruby-loco, and it builds. There are some test issues, haven't had a chance to look at them yet. Normally, using exe/dll/so files together that use different versions of the runtime is not a good idea. Building extension gems with ucrt may provide gems that can be used with mswin, but can't be compiled due to issues with Visual C (vs gcc). Also, packages from the vcpkg project may be compatible with Ruby ucrt. The reason for this post is that Windows Ruby built with ucrt is essentially another platform, but the build 'looks like' a mingw build. This is really a third platform choice. What should it be called? Things like `CONFIG['RUBY_SO_NAME']`, `RUBY_PLATFORM`, etc? ---Files-------------------------------- ruby-mingw32-ucrt.patch (622 Bytes) ruby-configure-mingw32-ucrt.patch (687 Bytes) ruby-configure-coroutine-mingw32.patch (351 Bytes) ruby-i386-mingw32-ucrt-undef.patch (398 Bytes) ruby-date-mingw32-ucrt-timezone.patch (333 Bytes) -- https://bugs.ruby-lang.org/