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 980111F880 for ; Thu, 9 Jan 2020 23:35:27 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7F9A81209F9; Fri, 10 Jan 2020 08:35:09 +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 37FF91209ED for ; Fri, 10 Jan 2020 08:35:07 +0900 (JST) Received: by filterdrecv-p3iad2-57f487d66-xms6p with SMTP id filterdrecv-p3iad2-57f487d66-xms6p-21-5E17B8B1-7 2020-01-09 23:35:13.124256552 +0000 UTC m=+2069314.430144591 Received: from herokuapp.com (unknown [18.207.202.92]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id lWjPTSduQL2GYbtWXfIo9Q for ; Thu, 09 Jan 2020 23:35:12.951 +0000 (UTC) Date: Thu, 09 Jan 2020 23:35:13 +0000 (UTC) From: ruby@jasonroelofs.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72407 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 16480 X-Redmine-Issue-Author: jasonroelofs X-Redmine-Issue-Assignee: nobu 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+oAKon4p1YfaRUy2eFdfLc9GvpM5SFYja3ftVbXlcAvrKF7jXajQlWILW51?= =?us-ascii?Q?K=2FJ433FtAtDD9huLpm1SXhZKX0TgjGzDkvgvjAP?= =?us-ascii?Q?pCDwDSqD4KpuO+L2fsub+1CAgZKW=2F1M6hdSxeyo?= =?us-ascii?Q?inuHrhvdu8fDDfztHQdHaXjyolIVS8x9NdnLe1s?= =?us-ascii?Q?pVo4qZ82FowLngW5la3j9x97It+aRPFIEaf0=2FoH?= =?us-ascii?Q?OGI5ESCHdzAS2Co88=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96744 Subject: [ruby-core:96744] [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 updated by jasonroelofs (Jason Roelofs). nobu (Nobuyoshi Nakada) wrote: > Doesn't `#undef rb_define_method` in that file work? Ah yes it looks like it does and thanks for putting together the PR. ---------------------------------------- Bug #16480: Ruby 2.7, C++, and rb_define_method compilation error https://bugs.ruby-lang.org/issues/16480#change-83731 * Author: jasonroelofs (Jason Roelofs) * Status: Assigned * Priority: Normal * Assignee: nobu (Nobuyoshi Nakada) * 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/