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.1 required=3.0 tests=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 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 F3DD71F462 for ; Wed, 5 Jun 2019 22:52:02 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 113B51208D7; Thu, 6 Jun 2019 07:51:57 +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 505F9120A08 for ; Thu, 6 Jun 2019 07:51:55 +0900 (JST) Received: by filter0032p3iad2.sendgrid.net with SMTP id filter0032p3iad2-16577-5CF8478C-A 2019-06-05 22:51:56.203803491 +0000 UTC m=+107886.971297398 Received: from herokuapp.com (unknown [34.204.44.93]) by ismtpd0044p1mdw1.sendgrid.net (SG) with ESMTP id 3LNIZnwdQfqzjp3aNaAJbg for ; Wed, 05 Jun 2019 22:51:56.075 +0000 (UTC) Date: Wed, 05 Jun 2019 22:51:56 +0000 (UTC) From: jean.boussier@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68466 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15903 X-Redmine-Issue-Author: Eregon X-Redmine-Issue-Assignee: Eregon X-Redmine-Sender: byroot 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?AchqQMoUBMcQgz7gop0XiYUiatGIY7E61JGsTL4Fvjfw983DwoWZUNUVYlZX=2Fz?= =?us-ascii?Q?smHmUj53d8zaadqr+7boL843EfswE8Rp09RQsHY?= =?us-ascii?Q?uvZJmHmxxjFJV8qLZo72jkQOA=2F7e+1bzgmbbgVU?= =?us-ascii?Q?iUGKhw+P0sezOCTnCTvwoozlANkwodr34Q=2FI9WR?= =?us-ascii?Q?mNR4FNHXFufl9q5uKjX056ASUPGy5cVrL5w=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92989 Subject: [ruby-core:92989] [Ruby trunk Feature#15903] Move RubyVM.resolve_feature_path to Kernel.resolve_feature_path 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 #15903 has been updated by byroot (Jean Boussier). This is kinda tengential, so sorry if it's shifting the discussion. But if `resolve_feature_path` is to be made a first class public API, I wonder if it could be the occasion to make `Kernel#require` invoke `Kernel#resolve_feature_path` under the hood. The reasoning is similar to [#11140] which made `Kernel#autoload` invoke `Kernel#require` and allowed tools like bootscale / bootsnap. If the feature resolution logic was swappable it could make these tools much simpler, and open the door to avoiding $LOAD_PATH entirely. ---------------------------------------- Feature #15903: Move RubyVM.resolve_feature_path to Kernel.resolve_feature_path https://bugs.ruby-lang.org/issues/15903#change-78367 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * Assignee: Eregon (Benoit Daloze) * Target version: 2.7 ---------------------------------------- RubyVM contains mostly MRI-specific features but `resolve_feature_path` is clearly not MRI-specific. So I propose to move it as a class method of `Kernel`. I think this makes sense given the related `load` and `require` are defined in `Kernel` too. Moreover, moving this method outside `RubyVM` is *necessary* for other Ruby implementations to implement it, and keep the clean separation that `RubyVM` is only defined on MRI (see #15752). So, can I move `RubyVM.resolve_feature_path` to `Kernel.resolve_feature_path`? Do we need to keep the method on RubyVM (and deprecate it), or can we just remove it since anyway API under RubyVM is not stable? cc @mame -- https://bugs.ruby-lang.org/