component/ca-certificates: don't use implicit `python`
We can not rely on system python here, it's a bit better to rely on buildout's python ( the main reason is that it complies with slapos-sr-testing not having system python ). The implementation is a bit complicated, we can not just reference ${buildout:executable} in the profile, because doing so will cause an infinite loop with rebootstrap and software installation never finish because options of ca-certificates change at every run if they include the python path. Instead, we use a pre-make-hook to rewrite the Makefile without saving the interpreter in option. This python is only used during the build process (to generate the certificate files) and not used at run time, so it does not really depend on python strictly speaking. Anyway, because it's a component used very early in the bootstrap, we can not reference python here.
-
Owner
Instead of a hook (that currently doesn't work with Python 2) and a patch, can you change to use
pre-build = sed -i 's \bpython3\b ${buildout:executable} ' mozilla/Makefile
(not tested) ? -
Owner
this hooks runs with slapos buildout that is nowadays always python3, but that's right that a simple sed is easier, I'll try that, thanks
-
Owner
ah no, I remember, it's not OK to reference
${buildout:executable}
, because it makes the part depend on python after rebootstrap and it rebootstraps for ever -
Owner
this hooks runs with slapos buildout that is nowadays always python3
That's not the case for ERP5.PerformanceTest-Master with is failing in loop for hours.
ah no, I remember, it's not OK to reference
${buildout:executable}
, because it makes the part depend on python after rebootstrap and it rebootstraps for everOops, I read too fast the commit message.
Then let's still drop the patch but change the hook as follows (not tested):
import re import sys def pre_make_hook(options, buildout, environ): with open('mozilla/Makefile', 'r+') as f: x = re.sub(r'\bpython3\b', sys.executable, f.read()) f.seek(0) f.write(x) f.truncate()
-
Owner
but I'll implement this suggestion, it's silly to keep the patch now that we have the make hook and we don't really need to write this in python3 only, I did not think, I just like pathlib nowadays