ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: duerst@it.aoyama.ac.jp
To: ruby-core@ruby-lang.org
Subject: [ruby-core:104870] [Ruby master Bug#18066] Load did_you_mean/error_highlight even with --disable-gems
Date: Tue, 10 Aug 2021 23:49:10 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-93227.20210810234909.703@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-18066.20210807203045.703@ruby-lang.org

Issue #18066 has been updated by duerst (Martin Dürst).


I'm not sure how strongly this is related (and I'll create a new issue if necessary), but when I use a very simple script such as `ruby -e 'puts 3+4'`, I get the following output:

```
`RubyGems' were not loaded.
`error_highlight' was not loaded.
`did_you_mean' was not loaded.
7
```

I think this is total overkill. Don't get me wrong: I'm fine (in this specific case) with RubyGems not being loaded (because no Gems are needed). I'm also fine with error_highlight and did_you_mean not being loaded (because they are not needed as long as my script has no errors). But it's total overkill that I'm told about this with 3 lines when all I want is to run a tiny script.

If this is a transitory state, then please ignore this complaint.

(ruby -v: ruby 3.1.0dev (2021-08-10T10:08:38Z master 28d03ee776) [x86_64-linux] on WSL2 on Win10)

----------------------------------------
Bug #18066: Load did_you_mean/error_highlight even with --disable-gems
https://bugs.ruby-lang.org/issues/18066#change-93227

* Author: vo.x (Vit Ondruch)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I guess that did_you_mean was not possible to load without RubyGems, when it used to be bundled gem. Since it is default gem, therefore part of StdLib and always available on load path, it should not be related to --disable-gems anymore.

IOW ruby.c contains this code:

~~~ruby
    if (opt->features.set & FEATURE_BIT(gems)) {
        rb_define_module("Gem");
        if (opt->features.set & FEATURE_BIT(error_highlight)) {
            rb_define_module("ErrorHighlight");
        }
        if (opt->features.set & FEATURE_BIT(did_you_mean)) {
            rb_define_module("DidYouMean");
        }
    }
~~~

while it should look like:

~~~
    if (opt->features.set & FEATURE_BIT(gems)) {
        rb_define_module("Gem");
    }

    if (opt->features.set & FEATURE_BIT(error_highlight)) {
        rb_define_module("ErrorHighlight");
    }

    if (opt->features.set & FEATURE_BIT(did_you_mean)) {
        rb_define_module("DidYouMean");
    }
~~~

(I have not checked error_highlight, but I assume it behaves similarly to did_you_mean)



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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

  parent reply	other threads:[~2021-08-10 23:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07 20:30 [ruby-core:104831] [Ruby master Bug#18066] Load did_you_mean eve/error_highlight even with --disable-gems v.ondruch
2021-08-07 20:35 ` [ruby-core:104832] " v.ondruch
2021-08-10 19:22 ` [ruby-core:104869] [Ruby master Bug#18066] Load did_you_mean/error_highlight " merch-redmine
2021-08-10 23:49 ` duerst [this message]
2021-08-11  9:54 ` [ruby-core:104878] " jaruga
2021-08-11 10:53 ` [ruby-core:104879] " v.ondruch
2021-08-11 16:01 ` [ruby-core:104884] " jaruga
2021-08-11 17:26 ` [ruby-core:104887] " v.ondruch
2021-08-11 18:46 ` [ruby-core:104891] " xtkoba+ruby
2021-10-25  9:05 ` [ruby-core:105779] " mame (Yusuke Endoh)

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-93227.20210810234909.703@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).