firebase-unity-sdk
firebase-unity-sdk copied to clipboard
Fix python interpreter build issues on systems without `python` executable
Hardcoding python as the Python executable doesn't work on new MacBooks (and gLinux) since the python executable does not exist, only python3. So instead, use cmake's built-in mechanism for finding a Python interpreter, which will find either python or python3. This is the analogue of https://github.com/firebase/firebase-cpp-sdk/pull/1017.
The scripts that are run on GitHub Actions runners needed to be changed to explicitly specify -DFIREBASE_PYTHON_EXECUTABLE:FILEPATH=<python path> to ensure that the Python interpreter into which the dependencies (e.g. absl-py) were installed gets used. Otherwise, FindPythonInterp/find_package(Python3) may choose a different Python interpreter which does not have the dependencies installed and cause the scripts to fail due to the missing dependencies.
I also removed the "shebang" line and executable permission bits from .py files (e.g. #!/usr/bin/python) since they (a) hardcode python, (b) inconsistently use /usr/bin/env, and (c) could be accidentally invoked from other scripts without specifying the Python interpreter in GitHub actions, causing an unpredictable Python interpreter to be used.
Note: There is still a build issue on Windows that I need to fix: https://github.com/firebase/firebase-unity-sdk/actions/runs/2631934095. This is an AI for me.