Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 690734 - Invalid '-' operator in non-incremental variable 'RUBY_TARGETS': '-ruby25' on ia64 and ppc64 profiles
Summary: Invalid '-' operator in non-incremental variable 'RUBY_TARGETS': '-ruby25' on...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-25 21:29 UTC by Sergei Trofimovich (RETIRED)
Modified: 2019-07-27 08:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-25 21:29:58 UTC
Noticed a few days ago emerge compains about invalid profile syntax:
    Invalid '-' operator in non-incremental variable 'RUBY_TARGETS': '-ruby25' on ia64 and ppc64 profiles

emerge issues warnings on every operation.
Comment 1 Hans de Graaff gentoo-dev Security 2019-07-26 04:04:52 UTC
I can't reproduce this on amd64 even though it currently has the same setup, either with or without a RUBY_TARGETS in /etc/make.conf.

The error message is also weird: my testing clearly shows that RUBY_TARGETS is incremental at least within profiles, because (at least on amd64) adding -ruby25 in arch/amd64/make.defaults clearly negates ruby25 in base/make.defaults. This is also the reason that -ruby25 is there: without it people get errors because portage wants to install ruby25 due to RUBY_TARGETS in base/make.defaults even though it is still stable use masked.
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-26 06:28:23 UTC
Looking at precise syntax on ia64 file:
  profiles/arch/ia64/make.defaults
    RUBY_TARGETS="ruby24 -ruby25"

Trying on amd64:

$ RUBY_TARGETS="ruby24 -ruby25" emerge -pv1 lv
Invalid '-' operator in non-incremental variable 'RUBY_TARGETS': '-ruby25'

Is it not the behaviour you see?
Comment 3 Hans de Graaff gentoo-dev Security 2019-07-26 06:33:19 UTC
(In reply to Sergei Trofimovich from comment #2)
> Looking at precise syntax on ia64 file:
>   profiles/arch/ia64/make.defaults
>     RUBY_TARGETS="ruby24 -ruby25"

You are leaving out profiles/base/make.defaults which has
  RUBY_TARGETS="ruby24 ruby25"

So the effective case is that RUBY_TARGETS="ruby24".

> Trying on amd64:
> 
> $ RUBY_TARGETS="ruby24 -ruby25" emerge -pv1 lv
> Invalid '-' operator in non-incremental variable 'RUBY_TARGETS': '-ruby25'
> 
> Is it not the behaviour you see?

If I explicitly use RUBY_TARGETS in this way, yes. But not in the default case  (without RUBY_TARGETS on command line or in /etc/portage/make.conf) because the -ruby25 gets resolved before that in the profiles, leading to a valid RUBY_TARGETS="ruby24".
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-26 08:52:57 UTC
(In reply to Hans de Graaff from comment #3)
> (In reply to Sergei Trofimovich from comment #2)
> > Looking at precise syntax on ia64 file:
> >   profiles/arch/ia64/make.defaults
> >     RUBY_TARGETS="ruby24 -ruby25"
> 
> You are leaving out profiles/base/make.defaults which has
>   RUBY_TARGETS="ruby24 ruby25"
> 
> So the effective case is that RUBY_TARGETS="ruby24".
> 
> > Trying on amd64:
> > 
> > $ RUBY_TARGETS="ruby24 -ruby25" emerge -pv1 lv
> > Invalid '-' operator in non-incremental variable 'RUBY_TARGETS': '-ruby25'
> > 
> > Is it not the behaviour you see?
> 
> If I explicitly use RUBY_TARGETS in this way, yes. But not in the default
> case  (without RUBY_TARGETS on command line or in /etc/portage/make.conf)
> because the -ruby25 gets resolved before that in the profiles, leading to a
> valid RUBY_TARGETS="ruby24".

If I read https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-560005.3.1 correctly only USE itself is treated as an incremental variable. Thus I suspect RUBY_TARGETS="ruby24 -ruby25" is not a valid expression in a profile.

USE="ruby_targets_ruby24 -ruby_targets_ruby24" probably would be correct.
Comment 5 Hans de Graaff gentoo-dev Security 2019-07-26 09:03:52 UTC
(In reply to Sergei Trofimovich from comment #4)

> If I read https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-560005.3.1
> correctly only USE itself is treated as an incremental variable. Thus I
> suspect RUBY_TARGETS="ruby24 -ruby25" is not a valid expression in a profile.

In section 5.3.2 it says:

 USE_EXPAND
    Defines a list of variables which are to be treated incrementally and whose contents are to be expanded into the USE variable as passed to ebuilds.

So all USE_EXPAND variables, which RUBY_TARGETS is, are also to be treated incrementally.

So that explains why I see the incremental behaviour in the profiles, but it still does not explain why you are seeing this issue on ia64 and ppc64.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-26 09:29:58 UTC
(In reply to Hans de Graaff from comment #5)
> (In reply to Sergei Trofimovich from comment #4)
> 
> > If I read https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-560005.3.1
> > correctly only USE itself is treated as an incremental variable. Thus I
> > suspect RUBY_TARGETS="ruby24 -ruby25" is not a valid expression in a profile.
> 
> In section 5.3.2 it says:
> 
>  USE_EXPAND
>     Defines a list of variables which are to be treated incrementally and
> whose contents are to be expanded into the USE variable as passed to ebuilds.
> 
> So all USE_EXPAND variables, which RUBY_TARGETS is, are also to be treated
> incrementally.
> 
> So that explains why I see the incremental behaviour in the profiles, but it
> still does not explain why you are seeing this issue on ia64 and ppc64.

Oh, good point! Both of those machines have the following expression that triggers it:
  /etc/portage/make.conf
    RUBY_TARGETS="${RUBY_TARGETS} ruby23 ruby24"
It's a leftover from past stabilization and should have been a RUBY_TARGETS="ruby23 ruby24".

Closing as INVALID.

Apologies for the noise!
Comment 7 rnddim 2019-07-26 18:39:48 UTC
I just encountered this same problem, and my make.conf has

RUBY_TARGETS="${RUBY_TARGETS} ruby25"

I presume I'm right in thinking that deleting the ${RUBY_TARGETS} portion would fix the issue? (I'd also like to know why this changed, and why the error message lies about what RUBY_TARGETS is.)
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-26 20:42:16 UTC
(In reply to rnddim from comment #7)
> I just encountered this same problem, and my make.conf has
> 
> RUBY_TARGETS="${RUBY_TARGETS} ruby25"
> 
> I presume I'm right in thinking that deleting the ${RUBY_TARGETS} portion
> would fix the issue? (I'd also like to know why this changed, and why the
> error message lies about what RUBY_TARGETS is.)

Yeah, RUBY_TARGETS="ruby25" should be the correct syntax of appending to existing list.
Comment 9 Hans de Graaff gentoo-dev Security 2019-07-27 08:43:51 UTC
(In reply to Sergei Trofimovich from comment #6)

> Apologies for the noise!

No need, I'm glad we could figure this out. I'm sure this will come up in the future as well and now we know why this is an issue.