The legacy runtime-fixer script uses Python which is problematic since the script has to run prior to the buildpack actually installing Python.
As such:
For clean installs of new apps (where there is no cached Python install), the script ends up relying upon system Python.
For cached builds, the script ends up using the Python install restored from the cache. If an app has changed stack, this means a Python install intended for one Ubuntu version ends up being used on another during the next build. In the case of stack downgrades this results in a glibc warning (it's only a warning rather than an error, since the script is allowed to fail, because of this bug).
(It probably didn't help that there were no stack change tests back then.)
Regardless, the only purpose of this script is to trim whitespace from the contents of runtime.txt, which we can easily do using Bash built-ins instead to avoid this issue.
The legacy
runtime-fixer
script uses Python which is problematic since the script has to run prior to the buildpack actually installing Python.As such:
There was unfortunately no explanation given as to why Python was chosen when the
runtime-fixer
script was first added: https://github.com/heroku/heroku-buildpack-python/commit/df52fd46e5b357503601d0f336c7fccb31b1f68b(It probably didn't help that there were no stack change tests back then.)
Regardless, the only purpose of this script is to trim whitespace from the contents of
runtime.txt
, which we can easily do using Bash built-ins instead to avoid this issue.The whitespace stripping already has a test, which still passes.
As an added bonus, removing the
runtime-fixer
script means we won't have to make it compatible with thepython
->python3
switch for Heroku-24.GUS-W-8059923.