meson fails building osmesa when superbuild builds python due to length of path to install/bin/python3
When you have superbuild make python we get the following problem. Meson builds fine. However the meson python script installed as .../install/bin/meson (there is no .py) has an issue. Since the meson file is intended to be executable, it starts with a "!#/full/path/to/python/interpreter/python3". In the common (in my opinion) case where you have a non-short path to your build directory, this shebang can get quite long. Then, when the superbuild tries to run meson to build osmesa, you get a "interpreter: No such file or directory" error. The reason is that the shebang is too long. Apparently, there is a kernel setting "BINPRM_BUF_SIZE" in /usr/include/linus/binfmts.h (?). On our cee platform, this appears to be set to 80, although 128 seems to be the default and is presumably more common.
The workaround is to make sure that your paths are pretty short so that the full path to your superbuild-built python is less than 80 characters.
One possible fix would be to set PATH to have the location of the superbuild-built python3 (.../install/bin), and then get the meson build to just have !#python3 for the python interpreter. Another might be to get meson to use an external python3 different than the one superbuild is building. In any case, requiring the full path to .../install/bin/python3 to be 80 characters or less seems a bit bogus.