Created attachment 279875 [details] emerge --info Hi, while running smart-live-rebuild I see lots of errors like: !!! Error enumerating kde-base/kwin-4.7.49.9999: [AttributeError] 'NoneType' object has no attribute 'cpv' which causes a rebuild for every package with that error (178 packages on my system) What might be the cause for that?
Could you open smartliverebuild/core.py and add a 'raise' before the line with 'Error enumerating ...'? This should make it output a complete backtrace.
Hi Michał, this is the bt: *** Updating the repositories... -> git://anongit.kde.org/kde-runtime --> git ls-remote --heads git://anongit.kde.org/kde-runtime KDE/4.7 Traceback (most recent call last): File "/usr/bin/smart-live-rebuild-2.7", line 26, in <module> sys.exit(main(sys.argv)) File "/usr/lib64/python2.7/site-packages/smartliverebuild/cli.py", line 144, in main packages = SmartLiveRebuild(opts, cliargs = args) File "/usr/lib64/python2.7/site-packages/smartliverebuild/core.py", line 145, in SmartLiveRebuild elif rebuilds[uri].cpv[0] in packages: AttributeError: 'NoneType' object has no attribute 'cpv'
(In reply to comment #2) > Hi Michał, > > this is the bt: > > *** Updating the repositories... > -> git://anongit.kde.org/kde-runtime > --> git ls-remote --heads git://anongit.kde.org/kde-runtime KDE/4.7 > Traceback (most recent call last): > File "/usr/bin/smart-live-rebuild-2.7", line 26, in <module> > sys.exit(main(sys.argv)) > File "/usr/lib64/python2.7/site-packages/smartliverebuild/cli.py", line 144, > in main > packages = SmartLiveRebuild(opts, cliargs = args) > File "/usr/lib64/python2.7/site-packages/smartliverebuild/core.py", line 145, > in SmartLiveRebuild > elif rebuilds[uri].cpv[0] in packages: > AttributeError: 'NoneType' object has no attribute 'cpv' Honestly, I was afraid of that. I don't get how such a thing could happen. Considering that rebuilds[uri] is set only on l140 [1], to vcs. And vcs is the result of class instantiation on l135 [2]. I don't really think that can return None. You could try to print values of these vars in various places but I'd start by checking another Python version. [1]:https://github.com/mgorny/smart-live-rebuild/blob/smart-live-rebuild-1.0.1/smartliverebuild/core.py#L140 [2]:https://github.com/mgorny/smart-live-rebuild/blob/smart-live-rebuild-1.0.1/smartliverebuild/core.py#L135
Hi Michał, I am getting the same errors with python2.6 or python3.2 Honestly I do not fully understand the code as I have not read it completely or spent enough time on it. But what I have found is: The problem seems to have to do with packages that share the same vcs repo. I added that raise you mentioned as well as some debug output where I could see that the rebuilds array looked like that before the first error: rebuilds = {'git://anongit.kde.org/kde-workspace': None, 'git://anongit.kde.org/kalzium': <smartliverebuild.vcs.git_2.Git2Support object at 0x61cd490>, 'git://anongit.kde.org/kde-runtime': None} That is where the "None" comes from. So if we do not only check "if uri not in rebuilds:" but "if uri not in rebuilds or rebuilds[uri] == None:" instead it seems to work fine here. Please review the "fix" carefully as I am not sure if that really fixes the root cause or is just an ugly hack.
Created attachment 279965 [details] Patch for core.py
Ok, I see where my mistake was. This is fixed in dec3f8bd2e [1]. I will try to release 1.1 this week, with the fix included. [1]:https://github.com/mgorny/smart-live-rebuild/commit/dec3f8bd2e
Ok, s-l-r-1.1 in the tree now.