From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B29AF15800C for ; Tue, 4 Apr 2023 00:02:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 273DDE0798; Tue, 4 Apr 2023 00:02:35 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E6767E0788 for ; Tue, 4 Apr 2023 00:02:34 +0000 (UTC) From: Sam James To: gentoo-dev@lists.gentoo.org Cc: ruby@gentoo.org, Sam James Subject: [gentoo-dev] [PATCH] ruby-single.eclass: depend on virtual/rubygems[ruby_targets_rubyNN(-)] for each impl Date: Tue, 4 Apr 2023 01:02:22 +0100 Message-Id: <20230404000222.3388767-1-sam@gentoo.org> X-Mailer: git-send-email 2.40.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 018906e0-386a-442f-a9ae-c6ca229cd44f X-Archives-Hash: 44777ca47789eb9f8dcf69f9ffa311bb 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 subsittute 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 --- eclass/ruby-single.eclass | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eclass/ruby-single.eclass b/eclass/ruby-single.eclass index 035675c4810a0..5f6cf9e46dcee 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() { -- 2.40.0