Using command "emerge --usepkg=n --getbinpkg=n rust" in order to avoid emerging a binpkg, doesn't work if /etc/portage/make.conf already has FEATURES=getbinpkg ie. it wants to emerge binary pkg anyway! Reproducible: Always Steps to Reproduce: 1. have FEATURES=getbinpkg in /etc/portage.make.conf 2. run "emerge --usepkg=n --getbinpkg=n rust" or: "emerge --usepkg n --getbinpkg n rust" or: "emerge --usepkg n --getbinpkg n --getbinpkgonly=n --usepkgonly=n rust" Actual Results: [binary R ] dev-lang/rust-1.48.0 Expected Results: [ebuild R ] dev-lang/rust-1.48.0 workaround: # FEATURES=-getbinpkg emerge --usepkg=n --getbinpkg=n rust see: https://github.com/gentoo/portage/blob/master/lib/_emerge/EbuildBuild.py#L291 or search for "#buildsyspkg" in there. Also note that EMERGE_DEFAULT_OPTS (in make.conf) doesn't contain any usepkg or getbinpkg args
workaround can be a bit simpler like: FEATURES=-getbinpkg emerge --usepkg=n rust which possibly means that only getbinpkg overriding is broken somehow.
please ignore the github link I used before. The problem seems to be this line: https://github.com/gentoo/portage/blob/15ac405fecf3e52ffd93d9a34e472bdc18604a4f/lib/_emerge/actions.py#L2924 if "getbinpkg" in emerge_config.target_config.settings.features: emerge_config.opts["--getbinpkg"] = True in other words, it sets "--getbinpkg" if it's set in FEATURES but there's no code afterwards that would unset it or set it to =False if it's --getbinpkg=n on args.
ah I see I misunderstood how it works: emerge_config.opts["--getbinpkg"] = False is the same as emerge_config.opts["--getbinpkg"] = True I guess then removing the key is what I assumed =False would do. confirmed something like this works: emerge_config.opts.pop("--getbinpkg", None)
Created attachment 677344 [details, diff] allow --getbinpkg=n arg to override FEATURES=getbinpkg using this temp-patch until official fix is available.
oops, I made a booboo
Created attachment 677353 [details, diff] rev2: allow --getbinpkg=n arg to override FEATURES=getbinpkg fixed temp-patch example output after: # FEATURES=getbinpkg emerge --getbinpkg=n --usepkg=n --pretend --ask=n rust * Just avoided bug https://bugs.gentoo.org/759067 where --getbinpkg=n wouldn't be considered! These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] dev-lang/rust-1.48.0 # FEATURES=-getbinpkg emerge --getbinpkg=n --usepkg=n --pretend --ask=n rust These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] dev-lang/rust-1.48.0 example output before: # FEATURES=getbinpkg emerge --getbinpkg=n --usepkg=n --pretend --ask=n rust These are the packages that would be merged, in order: Calculating dependencies... done! [binary R ] dev-lang/rust-1.48.0 # FEATURES=-getbinpkg emerge --getbinpkg=n --usepkg=n --pretend --ask=n rust These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] dev-lang/rust-1.48.0
it's still not good. --getbinpkg is not in emerge_config.opts even before that emerge_config.target_config.settings.features line adds it. I should probably go to sleep for making the same mistake twice :D
(In reply to flippynelle from comment #7) > it's still not good. > > --getbinpkg is not in emerge_config.opts even before that > emerge_config.target_config.settings.features line adds it. > actually I was wrong: --getbinpkg is in emerge_config.opts if arg is --getbinpkg=y or --getbinpkg and isn't if --getbinpkg=n which is correct! so the only problem is that it gets overridden by the one in FEATURES at that very line in comment 2
So wait a second: # EMERGE_DEFAULT_OPTS= FEATURES=getbinpkg emerge --getbinpkg=n --pretend --ask=n rust have only: {'--pretend': True, '--regex-search-auto': 'y'} in emerge_config.opts this means that there's no way to detect that --getbinpkg=n was passed? or not via emerge_config.opts I would've expected(at first) emerge_config.opts["--getbinpkg"]=False for that --getbinpkg=n how odd So how would you detect that a FEATURES=getbinpkg is overridden by command line arg --getbinpkg=n ? since it looks like either --getbinpkg arg wasn't specified on cmdline or that getbinpkg wasn't on FEATURES So something like --ask=n is the same as not specifying --ask=y or --ask on command line for emerge. But how would you detect that --ask=n was specified in order to be used as an explicit override?! Something seems fundamentally wrong.
Created attachment 677356 [details] obsoleted bad patches
(In reply to flippynelle from comment #9) > So wait a second: > # EMERGE_DEFAULT_OPTS= FEATURES=getbinpkg emerge --getbinpkg=n --pretend > --ask=n rust > > have only: {'--pretend': True, '--regex-search-auto': 'y'} > in emerge_config.opts > > this means that there's no way to detect that --getbinpkg=n was passed? > or not via emerge_config.opts > I would've expected(at first) emerge_config.opts["--getbinpkg"]=False for > that --getbinpkg=n > > how odd > > So how would you detect that a FEATURES=getbinpkg is overridden by command > line arg --getbinpkg=n ? since it looks like either --getbinpkg arg wasn't > specified on cmdline or that getbinpkg wasn't on FEATURES > > So something like --ask=n is the same as not specifying --ask=y or --ask on > command line for emerge. But how would you detect that --ask=n was specified > in order to be used as an explicit override?! Something seems fundamentally > wrong. ok this way still works (as long as I place it above the overriding line from comment 2): emerge_config.opts.get('--getbinpkg') returns "True" if --getbinpkg=y or --getbinpkg=True or --getbinpkg was used and "None" if --getbinpkg=n was used, as emerge arg. so this can still be fixed and there's nothing fundamentally wrong then :-"
(In reply to flippynelle from comment #11) > (In reply to flippynelle from comment #9) > > So wait a second: > > # EMERGE_DEFAULT_OPTS= FEATURES=getbinpkg emerge --getbinpkg=n --pretend > > --ask=n rust > > > > have only: {'--pretend': True, '--regex-search-auto': 'y'} > > in emerge_config.opts > > > > this means that there's no way to detect that --getbinpkg=n was passed? > > or not via emerge_config.opts > > I would've expected(at first) emerge_config.opts["--getbinpkg"]=False for > > that --getbinpkg=n > > > > how odd > > > > So how would you detect that a FEATURES=getbinpkg is overridden by command > > line arg --getbinpkg=n ? since it looks like either --getbinpkg arg wasn't > > specified on cmdline or that getbinpkg wasn't on FEATURES > > > > So something like --ask=n is the same as not specifying --ask=y or --ask on > > command line for emerge. But how would you detect that --ask=n was specified > > in order to be used as an explicit override?! Something seems fundamentally > > wrong. > > ok this way still works (as long as I place it above the overriding line > from comment 2): > emerge_config.opts.get('--getbinpkg') > returns "True" if --getbinpkg=y or --getbinpkg=True or --getbinpkg was used > and "None" if --getbinpkg=n was used, as emerge arg. > > so this can still be fixed and there's nothing fundamentally wrong then :-" NEVERMIND that! I forgot to test the case when no arg of --getbinpkg is specified in which case it returns "None" lol dang it! Ideas?
Alright, I see the problem: if myoptions.getbinpkg in true_y: myoptions.getbinpkg = True #else: # myoptions.getbinpkg = None now I can get =n
We should do something like this commit from bug 409085: https://gitweb.gentoo.org/proj/portage.git/commit/?id=500e0567432019835ef56e69d60266f9189c6700 This part is important because it blocks FEATURES=buildpkg from being enabled via package.env: settings.features.discard("buildpkg") The special discard behavior came from here: https://gitweb.gentoo.org/proj/portage.git/commit/?id=13af7cb709711b00394e80b3a7a928a95133229f
Created attachment 677371 [details] small bash script to test if behavior is good # time ./test_getbinpkg.bash good: expected 'binary' got 'binary' for 'FEATURES=-getbinpkg' and emerge arg:'--getbinpkg' good: expected 'binary' got 'binary' for 'FEATURES=-getbinpkg' and emerge arg:'--getbinpkg=True' good: expected 'binary' got 'binary' for 'FEATURES=-getbinpkg' and emerge arg:'--getbinpkg=y' good: expected 'ebuild' got 'ebuild' for 'FEATURES=-getbinpkg' and emerge arg:'--getbinpkg=n' good: expected 'ebuild' got 'ebuild' for 'FEATURES=-getbinpkg' and emerge arg:'' good: expected 'binary' got 'binary' for 'FEATURES=getbinpkg' and emerge arg:'--getbinpkg' good: expected 'binary' got 'binary' for 'FEATURES=getbinpkg' and emerge arg:'--getbinpkg=True' good: expected 'binary' got 'binary' for 'FEATURES=getbinpkg' and emerge arg:'--getbinpkg=y' good: expected 'ebuild' got 'ebuild' for 'FEATURES=getbinpkg' and emerge arg:'--getbinpkg=n' good: expected 'binary' got 'binary' for 'FEATURES=getbinpkg' and emerge arg:'' good: expected 'binary' got 'binary' for 'FEATURES=' and emerge arg:'--getbinpkg' good: expected 'binary' got 'binary' for 'FEATURES=' and emerge arg:'--getbinpkg=True' good: expected 'binary' got 'binary' for 'FEATURES=' and emerge arg:'--getbinpkg=y' good: expected 'ebuild' got 'ebuild' for 'FEATURES=' and emerge arg:'--getbinpkg=n' good: expected 'binary' got 'binary' for 'FEATURES=' and emerge arg:'' good: expected 'binary' got 'binary' for 'FEATURES=-getbinpkg' and emerge arg:'--getbinpkg' good: expected 'binary' got 'binary' for 'FEATURES=-getbinpkg' and emerge arg:'--getbinpkg=True' good: expected 'binary' got 'binary' for 'FEATURES=-getbinpkg' and emerge arg:'--getbinpkg=y' good: expected 'ebuild' got 'ebuild' for 'FEATURES=-getbinpkg' and emerge arg:'--getbinpkg=n' good: expected 'ebuild' got 'ebuild' for 'FEATURES=-getbinpkg' and emerge arg:'' good: expected 'binary' got 'binary' for 'FEATURES=getbinpkg' and emerge arg:'--getbinpkg' good: expected 'binary' got 'binary' for 'FEATURES=getbinpkg' and emerge arg:'--getbinpkg=True' good: expected 'binary' got 'binary' for 'FEATURES=getbinpkg' and emerge arg:'--getbinpkg=y' good: expected 'ebuild' got 'ebuild' for 'FEATURES=getbinpkg' and emerge arg:'--getbinpkg=n' good: expected 'binary' got 'binary' for 'FEATURES=getbinpkg' and emerge arg:'' good: expected 'binary' got 'binary' for 'FEATURES=' and emerge arg:'--getbinpkg' good: expected 'binary' got 'binary' for 'FEATURES=' and emerge arg:'--getbinpkg=True' good: expected 'binary' got 'binary' for 'FEATURES=' and emerge arg:'--getbinpkg=y' good: expected 'ebuild' got 'ebuild' for 'FEATURES=' and emerge arg:'--getbinpkg=n' good: expected 'ebuild' got 'ebuild' for 'FEATURES=' and emerge arg:'' All ok. real 1m13.876s user 1m10.832s sys 0m3.104s
Created attachment 677377 [details, diff] temp-patch I'm using that works for me
Any update on this? I'm running into the same issue. I have setup a binhost, but I sometimes want to debug packages. That FEATURES=getbinpkg trumps both the merge option flags and package.env settings makes this quite tedious.