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=-2.6 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 216091F66F for ; Thu, 19 Nov 2020 18:51:33 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 098D5120B0E; Fri, 20 Nov 2020 03:50:45 +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 1A5CB120AEB for ; Fri, 20 Nov 2020 03:50:42 +0900 (JST) Received: by filterdrecv-p3mdw1-5f8d7bb6d9-w9d74 with SMTP id filterdrecv-p3mdw1-5f8d7bb6d9-w9d74-19-5FB6BEA6-29 2020-11-19 18:51:18.412379982 +0000 UTC m=+253226.591023368 Received: from herokuapp.com (unknown) by ismtpd0030p1iad2.sendgrid.net (SG) with ESMTP id wku9_to5S7aDDspNyixgcQ for ; Thu, 19 Nov 2020 18:51:18.362 +0000 (UTC) Date: Thu, 19 Nov 2020 18:51:18 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 76821 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17021 X-Redmine-Issue-Author: watson1978 X-Redmine-Sender: Eregon 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?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr3uC=2FqOgd28AiTeM0ijSt?= =?us-ascii?Q?nu89dSK=2FJu8TC2i6wyPbFp5+Z3pDpeAuBgkxiS1?= =?us-ascii?Q?vZtjm6AQSHYdQBN+zrAAYwfme4FqAjCCTrZx=2FRE?= =?us-ascii?Q?Py48OOQJ4Pa3KQvytp27QAMwpekfhOS=2FErlxzxH?= =?us-ascii?Q?K5m9QW41pttzwMNG8ikayEyzkt7fwcu3jViBZmX?= =?us-ascii?Q?HDIGKHSzkS+kPOkfQ=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 100947 Subject: [ruby-core:100947] [Ruby master Bug#17021] "arm64" and "arm" are mixed in RbConfig on Apple silicon 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 #17021 has been updated by Eregon (Benoit Daloze). nobu (Nobuyoshi Nakada) wrote in #note-5: > First of all, `$host_cpu` and others are used only for cross-compilers and nonsense in the other cases. > Why do they matter? I think RbConfig `host_*` values should be correct no matter whether cross-compiling or not. Notably, `RbConfig::CONFIG["host_os"]` is well known as the portable way to get the OS. So it follows that `RbConfig::CONFIG["host_cpu"]` would be the portable way to get the processor architecture. Both are used here: https://github.com/ffi/ffi/blob/fbe2cf851f426cc55b3b76eca7b10e37aa220b47/lib/ffi/platform.rb Should another RbConfig::CONFIG key be used? Which one? ---------------------------------------- Bug #17021: "arm64" and "arm" are mixed in RbConfig on Apple silicon https://bugs.ruby-lang.org/issues/17021#change-88602 * Author: watson1978 (Shizuo Fujita) * Status: Open * Priority: Normal * ruby -v: ruby 2.8.0dev (2020-07-09T09:14:53Z master addbb7d16e) [arm64-darwin20] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- When I checked the value of `RbConfig::CONFIG` on the Apple silicon macOS,e I found "arm64" and "arm" are mixed as following. ``` $ ruby -v ruby 2.8.0dev (2020-07-09T09:14:53Z master addbb7d16e) [arm64-darwin20] $ ruby -e 'require "rbconfig"; pp RbConfig::CONFIG' | grep "arm" "/Users/watson/.rbenv/versions/2.8.0/include/ruby-2.8.0/vendor_ruby/arm64-darwin20", "/Users/watson/.rbenv/versions/2.8.0/include/ruby-2.8.0/site_ruby/arm64-darwin20", "/Users/watson/.rbenv/versions/2.8.0/include/ruby-2.8.0/arm64-darwin20", "/Users/watson/.rbenv/versions/2.8.0/lib/ruby/vendor_ruby/2.8.0/arm64-darwin20", "/Users/watson/.rbenv/versions/2.8.0/lib/ruby/site_ruby/2.8.0/arm64-darwin20", "/Users/watson/.rbenv/versions/2.8.0/lib/ruby/2.8.0/arm64-darwin20", "sitearch"=>"arm64-darwin20", "arch"=>"arm64-darwin20", "/Users/watson/.rbenv/versions/2.8.0/include/arm64-darwin20", "/Users/watson/.rbenv/versions/2.8.0/include/arm64-darwin20", "sitearchlibdir"=>"/Users/watson/.rbenv/versions/2.8.0/lib/arm64-darwin20", "archlibdir"=>"/Users/watson/.rbenv/versions/2.8.0/lib/arm64-darwin20", "/Users/watson/.rbenv/versions/2.8.0/lib/ruby/arm64-darwin20", "/Users/watson/.rbenv/versions/2.8.0/lib/ruby/arm64-darwin20", "Target: arm64-apple-darwin20.0.0\n" + "target_cpu"=>"arm64", "target"=>"arm64-apple-darwin20", "host_cpu"=>"arm", "host"=>"arm-apple-darwin20.0.0", "build_cpu"=>"arm", "build"=>"arm-apple-darwin20.0.0", "/Users/watson/.rbenv/versions/2.8.0/lib/ruby/2.8.0/arm64-darwin20", "topdir"=>"/Users/watson/.rbenv/versions/2.8.0/lib/ruby/2.8.0/arm64-darwin20"} ``` "target_cpu" indicates "arm64", however, "host_cpu" has "arm"... I'd like to know whether this behavior is the right thing. -- https://bugs.ruby-lang.org/