Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 554154 - catalyst: stage1's build.py is silently broken
Summary: catalyst: stage1's build.py is silently broken
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Catalyst (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Catalyst Developers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2015-07-07 17:19 UTC by Anthony Basile
Modified: 2018-08-31 19:12 UTC (History)
1 user (show)

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 Anthony Basile gentoo-dev 2015-07-07 17:19:57 UTC
A stage1 run of catalyst places build.py in /tmp and runs it to get the list of packages to be emerged into /tmp/stage1root.  The script looks over merged list of 'packages' and 'packages.build' from all layers of the profile stack as given by portage.settings.profiles.  The set coming from 'packages' contains initial *'s as described in man 5 portage.  However, when this list is merged with the list obtained from 'packages.build', a for loop runs the following at line 30 of build.py:

    portage.dep_getkey(pkgs[idx])

This always throws and exception because of the leading '*' making the purpose of the entire loop from 28-35 useless.

Solution: if pkgs[idx][0] == '*': pkgs[idx][1:].

Since we've live with this issue for a while (ie we haven't decorated our atoms with the correct < > = prefix operators or version numbers), I wonder if we even need it.



Reproducible: Always
Comment 1 Anthony Basile gentoo-dev 2015-07-07 17:22:08 UTC
(In reply to Anthony Basile from comment #0).
> 
> Solution: if pkgs[idx][0] == '*': pkgs[idx][1:].
> 

Not sure why that got cut off:

    if pkgs[idx][0] == '*' :
        pkgs[idx] = pkgs[idx][1:]
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2015-07-08 16:28:55 UTC
Hmm, if I'm thinking straight this morning... 

original code:

for idx in range(0, len(pkgs)):
	try:
		bidx = buildpkgs.index(portage.dep_getkey(pkgs[idx]))
		buildpkgs[bidx] = pkgs[idx]
		if buildpkgs[bidx][0:1] == "*":
			buildpkgs[bidx] = buildpkgs[bidx][1:]
	except: pass


My variation of your solution:

for idx in range(0, len(pkgs)):
	pkg = pkgs[idx].lstrip('*')
	try:
		bidx = buildpkgs.index(portage.dep_getkey(pkg))
		buildpkgs[bidx] = pkg
	except:
		pass


is correct?
Comment 3 Anthony Basile gentoo-dev 2015-07-08 20:05:55 UTC
yep that works.  i just tested.  for example, the old code used to give

buildpkgs = [ .... 'sys-apps/baselayout' ... ]

while your code gives

buildpkgs = [ .... '>=sys-apps/baselayout-2' .... ]

So some of our stage1's were probably wrong when we did the baselayout 1 -> 2 migration, and maybe some other packages were wrong too.  On amd64, sys-devel/patch was also wrong.  On the plus side, none of this probably got to our stage3's.
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2015-07-08 20:34:24 UTC
Change pushed in 2.X, will cherrypick to master soon.
Comment 5 Ben Kohler gentoo-dev 2018-01-10 18:22:43 UTC
Is this still an issue? This never made it to master/3.x