fixup! update default SlapOS gcc version to 10.5
-
Owner
Hello!
This change is the source of a bug that was hard to track down:
When reinstalling erp5 SR in place (with
slapos node software --all
orslapos node software --only <sr-url>
), so as to trigger buildout execution again, I noticed thatgcc-10.5
was recompiled because its buildout signature changed in a weird way: the previously installed part hadpython:<hash>
in the signature but the part-to-be-reinstalled not, and this change was the logged reason for reinstallinggcc-10.5
.Here's what actually happens:
- [slapgrid]
buildout bootstrap
=> createsbin/buildout
with#! python3-from-system
- [slapgrid]
bin/buildout
=> before rebootstrap:- [slapos.rebootstrap] => install part
python
only (as if${buildout:parts} == python
) - [slapos.rebootstrap] =>
python
pulls sectiongcc
andsys.executable==python3
therefore${gcc:part} == gcc-10.5
- [slapos.rebootstrap] =>
python
'sinit
callsbarrier()
after sectiongcc-10.5
is initialized, therefore this does not result inpython:<hash>
being added togcc-10.5
's__buildout_signature__
- [slapos.rebootstrap] => creates
bin/buildout
with#! python2-just-installed
- [slapos.rebootstrap] => install part
- [slapgrid]
bin/buildout
=> after rebootstrap:- install all
${buildout:parts}
-
sys.executable==python2
therefore [${gcc:part} == gcc-8.5
] - part
python
occurs first in${buildout:parts}
, pullsgcc
which pullsgcc-8.5
, and callsbarrier()
-
gcc-10.5
is initialized much later being pulled byinkscape
, and therefore is affected bybarrier()
: it now haspython:<hash>
in its__buildout_signature__
- I didn't check but am pretty sure
gcc-10.5
is recompiled after rebootstrap because its signature changed - worse: I didn't check but am pretty sure
python
is recompiled after rebootstrap because itsgcc
dependency changes
- install all
- [slapgrid]
buildout bootstrap
=> createsbin/buildout
with#! python3-from-system
- [slapgrid]
bin/buildout
=> before rebootstrap:-
gcc-10.5
is recompiled for no reason becausepython:<hash>
is removed from its signature -
python
is recompiled because its signature changed: it depends throughgcc
ongcc-10.5
instead ofgcc-8.5
-
Note: part of the problem (step 5) does not occur if step 4 does not occur, and even with
slapos node software --all
it's not systematic: slapgrid does not always callbuildout bootstrap
.But even if erp5 is never reinstalled in place, I'm pretty sure the first compilation compiles
gcc-10.5
andpython
twice for no reason.A possible solution: put
[gcc] part = gcc-8.5
in
slapos-py2.cfg
In any case: never do
[gcc:python2]
(or[gcc:python3]
) ever, because sincegcc
is installed before rebootstrap, this can trigger it being reinstalled after because python version changed. - [slapgrid]
-
Owner
/cc @tomo
-
Owner
A possible solution: put
[gcc] part = gcc-8.5
in
slapos-py2.cfg
I'm not commenting on whether this is good fix or not, but about a potential difficulty with this approach (and maybe all possible approaches ;)). For ERP5, we are still in a configuration where there is no
software-py2.cfg
,software.cfg
is python2 andsoftware-py3.cfg
extends it (sosoftware-py3.cfg
extendsslapos-py2.cfg
), if this is complicating things the fix here, we can reorganise profiles here, maybe have a "common" that py2 and py3 would extend.
These days, testnodes feel really slow, I have not investigated why. Can it be because of this ?
-
Owner
For ERP5, we are still in a configuration where there is no
software-py2.cfg
,software.cfg
is python2 andsoftware-py3.cfg
extends it (sosoftware-py3.cfg
extendsslapos-py2.cfg
), if this is complicating things the fix here, we can reorganise profiles here, maybe have a "common" that py2 and py3 would extend.Looking at
software-py3
, it seems it extendsstack/erp5/buildout.cfg
directly, notsoftware.cfg
. So this does not seem like an issue.Moreover:
- with
slapos-py2.cfg
, what determines if an SR uses Python2 is whetherslapos-py2.cfg
is in theextends
tree and appears aftercomponent/defaults.cfg
when walking the tree depth first (with the current implementation of theextends
algorithm), i.e. ifslapos-py2.cfg
overridescomponent/defaults.cfg
. - Exactly the same, if
slapos-py2.cfg
containspart = gcc-8.5
, what determines ifgcc-8.5
applies is whetherslapos-py2.cfg
overrides (i.e. appears after)component/defaults.cfg
So
gcc-8.5
will apply exactly when Python2 applies in any case :)
These days, testnodes feel really slow, I have not investigated why. Can it be because of this ?
The thought crossed my mind too.
- with
-
Owner
Oh sorry you seem to be right :)
stack/erp5/buildout.cfg
extendssoftware/neoppod/software-common.cfg
which contains thisgcc:python2
but if we remove it and put it only in slapos-py2.cfg as you suggest it probably work.Are you planning to try this ? ( I am not )
-
Owner
/cc @jm
yes, could you try this @xavier_thompson thanks :)