Re: [gentoo-user] problems emerging some ruby packages

8 views
Skip to first unread message

Arve Barsnes

unread,
Oct 11, 2022, 4:10:04 PM10/11/22
to
On Tue, 11 Oct 2022 at 22:02, Jack <ostr...@users.sourceforge.net> wrote:
> Does anybody see what I'm missing?

Maybe you have something in package.use for this package?

You could try to get emerge to tell you more explicitly what problem it has

USE="ruby_targets_ruby31" emerge -av dev-ruby/thor

Regards,
Arve

Jack

unread,
Oct 11, 2022, 4:10:04 PM10/11/22
to
I'm helping support a web site hosted at Heroku and written in Ruby on
Rails. Following some tool upgrades there, I upgraded my local rails
to 3.1, uninstalling the previous version 2.7. I now have
RUBY_TARGETS="ruby31" in make.conf. and several specific dev-ruby
package versions in package.accept_keywords. Most of them upgraded
fine, or at least reinstalled (using a version supporting ruby31 after
unmerging the old version) but some are giving me grief.

For example, "emerge -1 dev-ruby/thor" gives me

!!! Problem resolving dependencies for dev-ruby/thor
... done!

!!! The ebuild selected to satisfy "dev-ruby/thor" has unmet
requirements.
- dev-ruby/thor-1.2.1::gentoo USE="-doc -test" ABI_X86="(64)"
RUBY_TARGETS="-ruby27 (-ruby30) (-ruby31)"

The following REQUIRED_USE flag constraints are unsatisfied:
any-of ( ruby_targets_ruby27 ruby_targets_ruby30
ruby_targets_ruby31 )

I would expect USE_RUBY="ruby31" to translate into ruby_targets_ruby31,
but even explicitly adding that to package.use has no effect. Is there
something I'm missing turning off ruby31, specifically for just a small
number of packages? (so far the only other one with this problem is
dev-ruby/mini_mime).

Portage has two versions of thor: 1.1.0 and 1.1.2, both marked stable
for amd64, and 1.2.1 has USE_RUBY="ruby26 ruby27 ruby30 ruby31" so I
don't see any reason it's not working.

I already have railties installed (using -O) with ruby31, and it
depends on thor via ruby_add_redepend, which I read as requiring thor
with ruby31. thor is not mentioned in any file under /etc/portage.

Does anybody see what I'm missing?

Jack

Jack

unread,
Oct 11, 2022, 5:30:04 PM10/11/22
to
Thanks for the response.

On 2022.10.11 16:07, Arve Barsnes wrote:
> On Tue, 11 Oct 2022 at 22:02, Jack <ostr...@users.sourceforge.net>
> wrote:
> > Does anybody see what I'm missing?
> Maybe you have something in package.use for this package?
"grep -ir thor ." in /etc/portage has no hits. In addition "grep -ir
ruby ." in /etc/portage shows only package.accept_keyword entries and
RUBY_TARGETS="ruby31" in make.conf.
>
> You could try to get emerge to tell you more explicitly what problem
> it has
> USE="ruby_targets_ruby31" emerge -av dev-ruby/thor
I don't see how this is any different from putting it in package.use,
but it has the same lack of effect.
>
> Regards,
> Arve
Can anyone explain (or point me the the fine manual page I missed) the
exact meaning of (-ruby31) in

!!! The ebuild selected to satisfy "dev-ruby/thor" has unmet
requirements.
- dev-ruby/thor-1.2.1::gentoo USE="-doc -test" ABI_X86="(64)"
RUBY_TARGETS="-ruby27 (-ruby30) (-ruby31)"

and why is ruby27 not in parens, but the other two are? Is that just
the assumption that ruby31 is off in any ebuild which does not
explicitly mention it, or does it reflect an explicit turning off of
that flag?

Jack

Neil Bothwick

unread,
Oct 11, 2022, 7:40:04 PM10/11/22
to
On Tue, 11 Oct 2022 16:02:52 -0400, Jack wrote:

> For example, "emerge -1 dev-ruby/thor" gives me
>
> !!! Problem resolving dependencies for dev-ruby/thor
> ... done!
>
> !!! The ebuild selected to satisfy "dev-ruby/thor" has unmet
> requirements.
> - dev-ruby/thor-1.2.1::gentoo USE="-doc -test" ABI_X86="(64)"
> RUBY_TARGETS="-ruby27 (-ruby30) (-ruby31)"

ruby30 and ruby31 are in parentheses, which means they are not available.
>
> The following REQUIRED_USE flag constraints are unsatisfied:
> any-of ( ruby_targets_ruby27 ruby_targets_ruby30
> ruby_targets_ruby31 )
>
> I would expect USE_RUBY="ruby31" to translate into ruby_targets_ruby31,
> but even explicitly adding that to package.use has no effect.

The ebuild contains USE_RUBY="ruby26 ruby27" ruby_add_bdepend "

Have you tried setting RUBY_TARGETS to ruby27 for this package?

I must say I find the whole RUBY_* thing even more troublesome than the
PYTHON_* stuff, and that's saying something!


--
Neil Bothwick

Ralph's Observation - It is a mistake to allow any mechanical object
to realize that you are in a hurry.

Michael

unread,
Oct 11, 2022, 7:50:05 PM10/11/22
to
On Tuesday, 11 October 2022 22:43:02 BST Neil Bothwick wrote:
> On Tue, 11 Oct 2022 16:02:52 -0400, Jack wrote:
> > For example, "emerge -1 dev-ruby/thor" gives me
> >
> > !!! Problem resolving dependencies for dev-ruby/thor
> > ... done!
> >
> > !!! The ebuild selected to satisfy "dev-ruby/thor" has unmet
> > requirements.
> > - dev-ruby/thor-1.2.1::gentoo USE="-doc -test" ABI_X86="(64)"
> > RUBY_TARGETS="-ruby27 (-ruby30) (-ruby31)"
>
> ruby30 and ruby31 are in parentheses, which means they are not available.
>
> > The following REQUIRED_USE flag constraints are unsatisfied:
> > any-of ( ruby_targets_ruby27 ruby_targets_ruby30
> >
> > ruby_targets_ruby31 )
> >
> > I would expect USE_RUBY="ruby31" to translate into ruby_targets_ruby31,
> > but even explicitly adding that to package.use has no effect.
>
> The ebuild contains USE_RUBY="ruby26 ruby27" ruby_add_bdepend "
>
> Have you tried setting RUBY_TARGETS to ruby27 for this package?
>
> I must say I find the whole RUBY_* thing even more troublesome than the
> PYTHON_* stuff, and that's saying something!

As per the emerge man page:

- prefix not enabled (either disabled or removed)
[snip...]

() circumfix forced, masked, or removed

On a stable system with default ruby targets, I get this:

[ebuild N ] dev-ruby/thor-1.2.1:1::gentoo USE="-doc -test"
RUBY_TARGETS="ruby27 (-ruby30) (-ruby31)" 95 KiB

and, dev-lang/ruby-2.7.6:2.7 is drawn in as a build dependency:

[ebuild N ] dev-lang/ruby-2.7.6:2.7::gentoo USE="gdbm ipv6 rdoc ssl -
berkdb -debug -doc -examples -jemalloc -jit -rubytests -socks5 -static-libs -
systemtap -tk -xemacs" 11,802 KiB

NOTE: ruby 3.0 and 3.1 are marked as testing.
signature.asc

Jack

unread,
Oct 11, 2022, 8:00:03 PM10/11/22
to
On 2022.10.11 17:43, Neil Bothwick wrote:
> On Tue, 11 Oct 2022 16:02:52 -0400, Jack wrote:
>
> > For example, "emerge -1 dev-ruby/thor" gives me
> >
>> !!! Problem resolving dependencies for dev-ruby/thor ... done!
> >
>> !!! The ebuild selected to satisfy "dev-ruby/thor" has unmet
>> requirements.
>> - dev-ruby/thor-1.2.1::gentoo USE="-doc -test" ABI_X86="(64)"
>> RUBY_TARGETS="-ruby27 (-ruby30) (-ruby31)"
>
> ruby30 and ruby31 are in parentheses, which means they are not
> available.
Given everything below - what other reasons might there be for this?
I've yet to find any pattern of the difference between the ebuilds for
the small number of dev-ruby packages that show this problem, and those
for the the thirty plus which have installed just fine.
> >
> > The following REQUIRED_USE flag constraints are unsatisfied:
> > any-of ( ruby_targets_ruby27 ruby_targets_ruby30
> ruby_targets_ruby31 )
> >
>> I would expect USE_RUBY="ruby31" to translate into
>> ruby_targets_ruby31, but even explicitly adding that to package.use
>> has no effect.
>
> The ebuild contains USE_RUBY="ruby26 ruby27" ruby_add_bdepend "
Hmm. It looks to me that line should probably be 'USE_RUBY="ruby26
ruby27 ruby30 ruby31" ruby_add_bdepend "' However, as it only affects
the required ruby version for two depedencies only if the test use flag
is set (it is not) I'm not sure why it would matter.

I suppose it is likely just a typo in the ebuild. They removed ruby25
from 1.1.0 but didn't add the newer ruby versions. Actually even 1.1.0
may be broken as it includes ruby30 in USE_RUBY but not on the
ruby_add_bdepend line. However, I just made an -r1 in my local
overlay, adding the new ruby versions to that line, and I still get the
same error. So I'm actually still stuck figuring out why this ebuild
won't take ruby31.
>
> Have you tried setting RUBY_TARGETS to ruby27 for this package?
Why would I do that if I don't have ruby-2.7 installed, nor do I want
to?
>
> I must say I find the whole RUBY_* thing even more troublesome than
> the PYTHON_* stuff, and that's saying something!
That I agree with. If I knew then what I know now, I would have argued
much more vigorously against using Ruby on Rails for this web site.
But that's fodder another entire thread.
>
>
> --
> Neil Bothwick
Jack

Jack

unread,
Oct 11, 2022, 8:20:04 PM10/11/22
to
I explicitly have ruby-3.1 unmasked with "=dev-lang/ruby-3.1.2-r1
~amd64" in package.accept_keyword, and USE_RUBY="ruby31" in make.conf.
I do not see any reference to ruby in the profile. Is there somewhere
else I need to unmask something? emerge --info also says
'RUBY_TARGETS="ruby31"' as its only reference to a specific ruby
version.

As I said in my reply to Neil, why would this happen in just a handful
of packages, but not in over thirty others? mini_mime is the other
problem package, and it does not use ruby_add_bdepend so there is only
one line with USE_RUBY: 'USE_RUBY="ruby26 ruby27 ruby30 ruby31"'.

So - why is ruby31 disabled for (so far) only these two packages?
(The other packages which are failing depend on one of these two.)

Jack

Arve Barsnes

unread,
Oct 12, 2022, 1:20:04 AM10/12/22
to
On Wed, 12 Oct 2022 at 02:12, Jack <ostr...@users.sourceforge.net> wrote:
> As I said in my reply to Neil, why would this happen in just a handful
> of packages, but not in over thirty others? mini_mime is the other
> problem package, and it does not use ruby_add_bdepend so there is only
> one line with USE_RUBY: 'USE_RUBY="ruby26 ruby27 ruby30 ruby31"'.
>
> So - why is ruby31 disabled for (so far) only these two packages?
> (The other packages which are failing depend on one of these two.)

Maybe these two are just written more strict? I'm unable to read the
eclass to determine how it masks these flags on a stable system on
these packages, it will happily install it with ruby31 on my unstable
system, but you can try to unmask the flag in
/etc/portage/package.use.mask

dev-ruby/thor -ruby_targets_ruby31

Not the minus sign.

Regards,
Arve

Michael

unread,
Oct 12, 2022, 3:50:05 AM10/12/22
to
On Wednesday, 12 October 2022 01:12:00 BST Jack wrote:
> On 2022.10.11 19:41, Michael wrote:

> > NOTE: ruby 3.0 and 3.1 are marked as testing.
>
> I explicitly have ruby-3.1 unmasked with "=dev-lang/ruby-3.1.2-r1
> ~amd64" in package.accept_keyword, and USE_RUBY="ruby31" in make.conf.

Try setting in your /etc/make.conf this expression instead:

RUBY_TARGETS="ruby31"

as per https://wiki.gentoo.org/wiki/Ruby

and if you have not yet switched to using it, run:

eselect ruby set ruby31


> I do not see any reference to ruby in the profile. Is there somewhere
> else I need to unmask something? emerge --info also says
> 'RUBY_TARGETS="ruby31"' as its only reference to a specific ruby
> version.

That's what you'd add in your make.conf, for this ruby slot to be used
globally.


> As I said in my reply to Neil, why would this happen in just a handful
> of packages, but not in over thirty others? mini_mime is the other
> problem package, and it does not use ruby_add_bdepend so there is only
> one line with USE_RUBY: 'USE_RUBY="ruby26 ruby27 ruby30 ruby31"'.

I think it is relevant to how these USE variables are parsed and their syntax.
If you specify the ruby version via a USE flag, then this should be:

USE="ruby31" emerge -pv blah-blah


You need to specify it as above and since you want to use ruby31 wholesale on
your system, set it in make.conf as the wiki page explains.
signature.asc

Neil Bothwick

unread,
Oct 12, 2022, 3:50:13 AM10/12/22
to
On Tue, 11 Oct 2022 19:52:44 -0400, Jack wrote:

> > Have you tried setting RUBY_TARGETS to ruby27 for this package?
> Why would I do that if I don't have ruby-2.7 installed, nor do I want
> to?

We don't always get what we want. If thor currently needs 2.7 then you
have to have it if you want thor.

Try it with an emerge -p. Whether it works or not, you will have further
clues as to the source of the issue.


--
Neil Bothwick

Anything worth fighting for is worth fighting dirty for.

Jack

unread,
Oct 12, 2022, 3:00:03 PM10/12/22
to
Well, this almost did the trick. That file has to be in
/etc/portage/profile. Just having it in /etc/portage did not work. It
turns out the masking of ruby_targets_ruby30 and ruby_targets_ruby31 is
in /usr/portage/profiles/base/use.stable.mask. I still have no idea
why ruby31 was masked for these two packages (thor and mini_mime) but
not for over thirty other dev-ruby packages I have installed.

My next issue is that I installed several packages with -O (skip
dependencies) so now I have to work my way through finding all the
uninstalled dependencies I skipped, many of which will need to be
unmasked as they are testing.

Thanks for all the suggestions and support, and I'll report back either
when it's all done or if I find another blockage.

Jack
Reply all
Reply to author
Forward
0 new messages