Fix the Mac installer to truly work in all macOS installs.
Review Request #8665 — Created Jan. 24, 2017 and submitted — Latest diff uploaded
We've had some.. fun.. figuring out the compatibility problems with the Mac RBTools installer, but we finally have it figured out. The paths for the Python 2.7 build of RBTools worked only if you had installed Python from python.org using their installers, and probably didn't work well otherwise. However, Python 2.6 was still taking precedence, meaning that most people could still use RBTools, in theory, but since we built the RBTools wheel with Python 2.7, argparse never got added as a dependency, so unless the user had previously installed a much older version of RBTools that explicitly added that, they couldn't run RBTools. All that is fixed. We now explicitly install the packages for the Mac Installer payload using the system Python, ensuring that everything ends up in /Library/Python/2.{6,7}/site-packages, which should be checked no matter which variant of Python is being used. This provides the greatest compatibility across a range of macOS versions and a range of Python setups. We also build a wheel per Python version, ensuring dependencies are correctly installed for the installer payload. This fixes the argparse on Python 2.6 problem. Finally, the /usr/local/bin/rbt script has been updated to no longer hard-code a Python binary path. Instead, it's been replaced with "/usr/bin/env python", which will get the version of Python being used on the system. This helps in the case where you have custom rbt scripts installed for your Python environment, and want them to work with RBTools. In the end, this should finally provide a universal installer that users can depend on.
Built the installer and tested on a system with Homebrew, one with the
Python installer, and one vanilla.Posted the latest version of this change for review with using only the
system Python (no third-party installer), and another with the official
Python from python.org.Manually inspected the package contents to check that all paths and
scripts were as expected.Checked that building in a virtualenv didn't break the package in any way.