summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-04-04 00:52:48 +0100
committerSam James <sam@gentoo.org>2023-04-08 22:42:29 +0100
commit9782fba13720c841ffedb919c6c62d153392b23a (patch)
tree4fb73fbed9b7490a5c7d7b2adea6b128e30ff982 /eclass
parentdev-ruby/ffi: backport fix for >=ruby30 & non-pre-generated types.conf (diff)
downloadgentoo-9782fba13720c841ffedb919c6c62d153392b23a.tar.gz
gentoo-9782fba13720c841ffedb919c6c62d153392b23a.tar.bz2
gentoo-9782fba13720c841ffedb919c6c62d153392b23a.zip
ruby-single.eclass: depend on virtual/rubygems[ruby_targets_rubyNN(-)] for each impl
Noticed when looking at bug 771744 which seems hard to trigger deliberately - the webkit-gtk ebuild already tries to check the chosen Ruby has rubygems available. Anyway, when looking at that, I noticed it's possible for Portage to queue the following, even if it's not what's happening in this case: - dev-lang/ruby:2.7 is already installed - virtual/rubygems[ruby_targets_ruby27] is already installed (PDEPEND of ruby) and then, in a fresh emerge: - dev-lang/ruby:3.0 is installed - app-misc/foo (with only USE_RUBY="ruby30") using ruby-single.eclass is queued and fails because the installed Ruby isn't fully usable yet, because the eclass only guarantees dev-lang/ruby:3.0 and virtual/rubygems is installed, not necessarily rubygems for that interpreter. - virtual/rubygems[ruby_targets_ruby30] is built (PDEPEND of ruby) This isn't a substitute for a ruby-any.eclass and/or a pkg_setup which helps enforcement, but that's another thing to handle. Followup to d078ec2a151d16b7ed045f1889bb5b97c4b9e6af ("Add virtual/rubygems to dependencies[...]"). Bug: https://bugs.gentoo.org/771744 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ruby-single.eclass9
1 files changed, 6 insertions, 3 deletions
diff --git a/eclass/ruby-single.eclass b/eclass/ruby-single.eclass
index 035675c4810a..5f6cf9e46dce 100644
--- a/eclass/ruby-single.eclass
+++ b/eclass/ruby-single.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ruby-single.eclass
@@ -72,10 +72,13 @@ _ruby_single_implementations_depend() {
local depend
for _ruby_implementation in ${RUBY_TARGETS_PREFERENCE}; do
if [[ ${USE_RUBY} =~ ${_ruby_implementation} ]]; then
- depend="${depend} $(_ruby_implementation_depend $_ruby_implementation)"
+ depend+=" ("
+ depend+=" $(_ruby_implementation_depend $_ruby_implementation)"
+ depend+=" virtual/rubygems[ruby_targets_${_ruby_implementation}(-)]"
+ depend+=" )"
fi
done
- echo "|| ( ${depend} ) virtual/rubygems"
+ echo "|| ( ${depend} )"
}
_ruby_single_set_globals() {