ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "nagachika (Tomoyuki Chikanaga)" <noreply@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:105526] [Ruby master Bug#18173] The feature in `$LOADED_FEATURES` is loaded again
Date: Sun, 03 Oct 2021 07:33:26 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-93978.20211003073320.4@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-18173.20210916094724.4@ruby-lang.org

Issue #18173 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE

ruby_3_0 5341eca588e738cd5031ab7d8bb5c300471c00e9 merged revision(s) ddb32e66160ab50849419ef7c7ac584913b79c34.

----------------------------------------
Bug #18173: The feature in `$LOADED_FEATURES` is loaded again
https://bugs.ruby-lang.org/issues/18173#change-93978

* Author: nobu (Nobuyoshi Nakada)
* Status: Closed
* Priority: Normal
* Backport: 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE
----------------------------------------
In general, the feature name registered in `$LOADED_FEATURES` (e.g. "enumerator.so", "thread.rb", and so on) is expected not to be loaded again.

But, as @ko1 reported, when a feature name is added to the variable during another file is required, it will be loaded again.

```shell
$ echo 'raise __FILE__' > target.rb
$ echo '$" << "target.rb"' > provide.rb
$ ruby -r./provide.rb target.rb 
target.rb:1:in `<main>': target.rb (RuntimeError)
```




-- 
https://bugs.ruby-lang.org/

  reply	other threads:[~2021-10-03  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16  9:47 [ruby-core:105294] [Ruby master Bug#18173] The feature in `$LOADED_FEATURES` is loaded again nobu (Nobuyoshi Nakada)
2021-10-03  7:33 ` nagachika (Tomoyuki Chikanaga) [this message]
2021-11-24 10:35 ` [ruby-core:106260] " usa (Usaku NAKAMURA)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-93978.20211003073320.4@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).