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=-3.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 12B621F463 for ; Sat, 4 Jan 2020 18:07:35 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 17F1E1209C4; Sun, 5 Jan 2020 03:07:18 +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 A369012099B for ; Sun, 5 Jan 2020 03:07:15 +0900 (JST) Received: by filterdrecv-p3las1-5bf99c48d-tqhzr with SMTP id filterdrecv-p3las1-5bf99c48d-tqhzr-19-5E10D45A-1B 2020-01-04 18:07:22.259821652 +0000 UTC m=+1617698.775025934 Received: from herokuapp.com (unknown [3.84.47.179]) by ismtpd0067p1mdw1.sendgrid.net (SG) with ESMTP id J6BqVgxzT6K_MppM8k2gBw for ; Sat, 04 Jan 2020 18:07:22.138 +0000 (UTC) Date: Sat, 04 Jan 2020 18:07:22 +0000 (UTC) From: ruby@jasonroelofs.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72318 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 16480 X-Redmine-Issue-Author: jasonroelofs X-Redmine-Sender: jasonroelofs 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?GCd+oAKon4p1YfaRUy2eFdfLc9GvpM5SFYja3ftVbXkHXQm29Ftf+QgewdQEVc?= =?us-ascii?Q?IbkC8eaMF+LL9lyGt6vYrmBXw8stIMxsOrn+XQG?= =?us-ascii?Q?aZk=2FAhL83B1VGy8t=2FWRVR4mQn=2FiAigg8BiQeJxF?= =?us-ascii?Q?jUQliBtaOKQaKtm0YJ8Oo3qjNS8UNu7cvrZQi4v?= =?us-ascii?Q?gII8I2fI0o0PxvSEq1KFmjk7P1RjpVSqT27wIZY?= =?us-ascii?Q?GHgHVl22H5WYW3V4Q=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96656 Subject: [ruby-core:96656] [Ruby master Bug#16480] Ruby 2.7, C++, and rb_define_method compilation error 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 #16480 has been reported by jasonroelofs (Jason Roelofs). ---------------------------------------- Bug #16480: Ruby 2.7, C++, and rb_define_method compilation error https://bugs.ruby-lang.org/issues/16480 * Author: jasonroelofs (Jason Roelofs) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin18] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- I maintain the Rice library which provides constructs for exposing C++ libraries into Ruby. With Ruby 2.7.0 I've got a hard compilation failure that I'm not sure how to fix.[1] Diving into this, I've found that rb_define_method, when compiled under C++, is now a macro that uses templates to choose the correct overload by the given arity. However, this seems to require a constexpr-compatible use of rb_define_method, making the API unavailable for more dynamic uses[1]. The PR that made these changes is here[3]. I've looked for ways to get around this macro change but have been unable to make anything work. Is there a way I've missed to directly call the underlying C API function or is this now simply not possible with Ruby 2.7.0? [1] https://github.com/jasonroelofs/rice/issues/119 [2] https://github.com/jasonroelofs/rice/blob/master/rice/detail/method_data.cpp#L78 [3] https://github.com/ruby/ruby/pull/2461 -- https://bugs.ruby-lang.org/