Repository: pex-tool/pex

Issue:
OSX's python 2.7.10 interpreter reports a bad local platform, bdists fail to resolve
In particular, under the OSX system 2.7.10 / xcode 8.3 (on TravisCI), the reported platform is `macosx-10.12-intel` and the resulting calculated tags are:
```
                    E   	pex: E: tags for 'macosx-10.12-intel' x PythonInterpreter('/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', PythonIdentity('CPython', 2, 7, 10), {('matplotlib', '1.3.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-corelocation', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-coretext', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-syncservices', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('six', '1.4.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-fsevents', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-cocoa', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-preferencepanes', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('zope.interface', '4.1.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyparsing', '2.0.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-collaboration', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pytz', '2013.7'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-pubsub', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-scriptingbridge', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-servicemanagement', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('numpy', '1.8.0rc1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-installerplugins', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('setuptools', '18.5'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-opendirectory', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-applescriptkit', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-automator', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-addressbook', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-searchkit', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-applescriptobjc', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-qtkit', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-latentsemanticmapping', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('scipy', '0.13.0b1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('modulegraph', '0.10.4'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('altgraph', '0.10.2'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-instantmessage', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('xattr', '0.6.4'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-eventkit', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-social', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-cfnetwork', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-quartz', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-exceptionhandling', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-launchservices', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-coredata', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('python', '2.7.10'): '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', ('bdist-mpkg', '0.5.0'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-message', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-inputmethodkit', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('py2app', '0.7.3'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-dictionaryservices', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-accounts', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyobjc-framework-screensaver', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('pyopenssl', '0.13.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('bonjour-py', '0.3'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-core', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('wsgiref', '0.1.2'): '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', ('pyobjc-framework-webkit', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('python-dateutil', '1.5'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', ('pyobjc-framework-systemconfiguration', '2.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', ('macholib', '1.5.1'): '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python'}) -> [('cp27', 'cp27m', 'macosx_10_8_universal'), ('cp27', 'cp27m', 'macosx_10_12_universal'), ('cp27', 'cp27mu', 'macosx_10_7_intel'), ('cp27', 'cp27mu', 'macosx_10_4_intel'), ('cp27', 'cp27d', 'macosx_10_9_intel'), ('cp27', 'cp27d', 'macosx_10_12_universal'), ('cp27', 'cp27dm', 'macosx_10_8_intel'), ('cp27', 'cp27dmu', 'macosx_10_0_universal'), ('cp27', 'cp27d', 'macosx_10_11_intel'), ('cp27', 'cp27dmu', 'macosx_10_10_intel'), ('cp27', 'cp27dm', 'macosx_10_8_universal'), ('cp27', 'cp27dm', 'macosx_10_11_universal'), ('cp27', 'cp27m', 'macosx_10_4_universal'), ('cp27', 'cp27mu', 'macosx_10_9_intel'), ('cp27', 'cp27dm', 'macosx_10_0_universal'), ('py2', 'none', 'macosx_10_0_universal'), ('cp27', 'cp27dmu', 'macosx_10_12_intel'), ('cp27', 'cp27m', 'macosx_10_5_universal'), ('cp2', 'none', 'any'), ('cp27', 'cp27m', 'macosx_10_8_intel'), ('py2', 'none', 'macosx_10_11_universal'), ('cp27', 'cp27m', 'macosx_10_10_intel'), ('cp27', 'cp27u', 'macosx_10_9_intel'), ('py2', 'none', 'macosx_10_6_intel'), ('cp27', 'none', 'macosx_10_10_intel'), ('py2', 'none', 'any'), ('cp27', 'none', 'macosx_10_5_intel'), ('cp27', 'none', 'macosx_10_8_intel'), ('cp27', 'cp27mu', 'macosx_10_0_universal'), ('cp27', 'cp27u', 'macosx_10_9_universal'), ('cp27', 'cp27mu', 'macosx_10_11_universal'), ('cp27', 'none', 'macosx_10_12_intel'), ('py27', 'none', 'any'), ('cp27', 'cp27dm', 'macosx_10_4_intel'), ('cp27', 'cp27mu', 'macosx_10_6_intel'), ('cp27', 'none', 'macosx_10_6_intel'), ('cp27', 'cp27mu', 'macosx_10_9_universal'), ('cp27', 'cp27mu', 'macosx_10_5_intel'), ('cp27', 'cp27dmu', 'macosx_10_11_intel'), ('cp27', 'cp27dmu', 'macosx_10_5_universal'), ('cp27', 'cp27dmu', 'macosx_10_5_intel'), ('cp27', 'cp27u', 'macosx_10_3_universal'), ('cp27', 'cp27dmu', 'macosx_10_4_universal'), ('cp27', 'cp27dmu', 'macosx_10_6_intel'), ('cp27', 'cp27dm', 'macosx_10_7_intel'), ('cp27', 'none', 'macosx_10_12_universal'), ('cp27', 'cp27u', 'macosx_10_4_intel'), ('cp27', 'none', 'macosx_10_11_intel'), ('cp27', 'cp27u', 'macosx_10_0_universal'), ('cp27', 'cp27m', 'macosx_10_12_intel'), ('cp27', 'none', 'macosx_10_4_universal'), ('cp27', 'cp27dmu', 'macosx_10_11_universal'), ('cp27', 'cp27dmu', 'macosx_10_3_universal'), ('cp27', 'none', 'macosx_10_5_universal'), ('cp27', 'cp27dmu', 'macosx_10_12_universal'), ('py2', 'none', 'macosx_10_9_universal'), ('cp27', 'cp27dm', 'macosx_10_9_universal'), ('cp27', 'cp27u', 'macosx_10_11_universal'), ('cp27', 'cp27dm', 'macosx_10_1_universal'), ('cp27', 'cp27m', 'macosx_10_2_universal'), ('cp27', 'cp27d', 'macosx_10_8_intel'), ('cp27', 'cp27u', 'macosx_10_1_universal'), ('cp27', 'none', 'macosx_10_10_universal'), ('cp27', 'cp27d', 'macosx_10_5_intel'), ('cp27', 'cp27m', 'macosx_10_10_universal'), ('cp27', 'cp27mu', 'macosx_10_7_universal'), ('cp27', 'cp27mu', 'macosx_10_11_intel'), ('cp27', 'cp27dmu', 'macosx_10_6_universal'), ('cp27', 'none', 'macosx_10_2_universal'), ('cp27', 'cp27u', 'macosx_10_7_intel'), ('cp27', 'none', 'macosx_10_3_universal'), ('cp27', 'cp27d', 'macosx_10_4_intel'), ('cp27', 'cp27dm', 'macosx_10_9_intel'), ('py2', 'none', 'macosx_10_9_intel'), ('cp27', 'cp27m', 'macosx_10_7_intel'), ('cp27', 'cp27m', 'macosx_10_3_universal'), ('cp27', 'cp27m', 'macosx_10_5_intel'), ('cp27', 'cp27m', 'macosx_10_6_universal'), ('cp27', 'none', 'macosx_10_6_universal'), ('py2', 'none', 'macosx_10_7_universal'), ('py2', 'none', 'macosx_10_11_intel'), ('cp27', 'cp27m', 'macosx_10_6_intel'), ('cp27', 'cp27dmu', 'macosx_10_2_universal'), ('cp27', 'cp27m', 'macosx_10_1_universal'), ('cp27', 'cp27dmu', 'macosx_10_8_intel'), ('cp27', 'cp27d', 'macosx_10_11_universal'), ('cp27', 'cp27mu', 'macosx_10_12_intel'), ('cp27', 'cp27u', 'macosx_10_5_intel'), ('cp27', 'cp27u', 'macosx_10_8_universal'), ('cp27', 'cp27dm', 'macosx_10_6_universal'), ('cp27', 'none', 'macosx_10_9_universal'), ('cp27', 'cp27d', 'macosx_10_6_intel'), ('cp27', 'cp27mu', 'macosx_10_10_intel'), ('cp27', 'cp27u', 'macosx_10_7_universal'), ('cp27', 'cp27dmu', 'macosx_10_7_universal'), ('py2', 'none', 'macosx_10_12_intel'), ('cp27', 'cp27dmu', 'macosx_10_9_universal'), ('py2', 'none', 'macosx_10_8_universal'), ('py2', 'none', 'macosx_10_12_universal'), ('cp27', 'cp27mu', 'macosx_10_5_universal'), ('cp27', 'cp27d', 'macosx_10_3_universal'), ('cp27', 'cp27d', 'macosx_10_1_universal'), ('cp27', 'cp27m', 'macosx_10_7_universal'), ('py2', 'none', 'macosx_10_10_intel'), ('cp27', 'cp27mu', 'macosx_10_4_universal'), ('cp27', 'cp27dm', 'macosx_10_12_universal'), ('cp27', 'cp27d', 'macosx_10_10_universal'), ('cp27', 'cp27u', 'macosx_10_11_intel'), ('cp27', 'cp27dmu', 'macosx_10_10_universal'), ('cp27', 'cp27m', 'macosx_10_0_universal'), ('cp27', 'cp27mu', 'macosx_10_8_universal'), ('cp27', 'cp27mu', 'macosx_10_12_universal'), ('cp27', 'cp27d', 'macosx_10_2_universal'), ('cp27', 'cp27d', 'macosx_10_7_intel'), ('cp27', 'cp27dm', 'macosx_10_6_intel'), ('cp27', 'cp27m', 'macosx_10_4_intel'), ('py2', 'none', 'macosx_10_4_universal'), ('cp27', 'none', 'macosx_10_4_intel'), ('py2', 'none', 'macosx_10_5_intel'), ('cp27', 'cp27d', 'macosx_10_6_universal'), ('cp27', 'cp27dm', 'macosx_10_5_universal'), ('cp27', 'cp27dm', 'macosx_10_4_universal'), ('cp27', 'none', 'macosx_10_1_universal'), ('cp27', 'cp27dmu', 'macosx_10_4_intel'), ('cp27', 'cp27u', 'macosx_10_2_universal'), ('cp27', 'cp27mu', 'macosx_10_6_universal'), ('cp27', 'cp27mu', 'macosx_10_2_universal'), ('cp27', 'cp27d', 'macosx_10_9_universal'), ('cp27', 'cp27dm', 'macosx_10_10_universal'), ('cp27', 'cp27dmu', 'macosx_10_1_universal'), ('cp27', 'cp27mu', 'macosx_10_8_intel'), ('cp27', 'cp27u', 'macosx_10_10_intel'), ('cp27', 'cp27dmu', 'macosx_10_9_intel'), ('cp27', 'none', 'macosx_10_8_universal'), ('py2', 'none', 'macosx_10_6_universal'), ('cp27', 'cp27dm', 'macosx_10_12_intel'), ('cp27', 'cp27d', 'macosx_10_0_universal'), ('cp27', 'none', 'any'), ('cp27', 'cp27m', 'macosx_10_9_universal'), ('cp27', 'cp27d', 'macosx_10_7_universal'), ('cp27', 'none', 'macosx_10_9_intel'), ('py2', 'none', 'macosx_10_8_intel'), ('cp27', 'cp27dm', 'macosx_10_2_universal'), ('cp27', 'cp27m', 'macosx_10_11_universal'), ('cp27', 'cp27u', 'macosx_10_6_universal'), ('cp27', 'cp27dm', 'macosx_10_10_intel'), ('cp27', 'cp27dmu', 'macosx_10_8_universal'), ('cp27', 'cp27d', 'macosx_10_12_intel'), ('cp27', 'cp27u', 'macosx_10_12_intel'), ('cp27', 'none', 'macosx_10_7_intel'), ('cp27', 'cp27u', 'macosx_10_6_intel'), ('py2', 'none', 'macosx_10_3_universal'), ('py2', 'none', 'macosx_10_5_universal'), ('py2', 'none', 'macosx_10_2_universal'), ('cp27', 'cp27dmu', 'macosx_10_7_intel'), ('cp27', 'cp27d', 'macosx_10_10_intel'), ('cp27', 'cp27u', 'macosx_10_4_universal'), ('cp27', 'cp27mu', 'macosx_10_3_universal'), ('py2', 'none', 'macosx_10_1_universal'), ('py2', 'none', 'macosx_10_10_universal'), ('cp27', 'cp27dm', 'macosx_10_5_intel'), ('cp27', 'cp27d', 'macosx_10_5_universal'), ('cp27', 'cp27u', 'macosx_10_5_universal'), ('cp27', 'cp27dm', 'macosx_10_11_intel'), ('cp27', 'cp27dm', 'macosx_10_7_universal'), ('cp27', 'cp27u', 'macosx_10_12_universal'), ('cp27', 'cp27d', 'macosx_10_4_universal'), ('cp27', 'cp27u', 'macosx_10_10_universal'), ('cp27', 'cp27m', 'macosx_10_9_intel'), ('py2', 'none', 'macosx_10_7_intel'), ('py2', 'none', 'macosx_10_4_intel'), ('cp27', 'cp27d', 'macosx_10_8_universal'), ('cp27', 'cp27u', 'macosx_10_8_intel'), ('cp27', 'none', 'macosx_10_0_universal'), ('cp27', 'cp27mu', 'macosx_10_1_universal'), ('cp27', 'cp27mu', 'macosx_10_10_universal'), ('cp27', 'cp27m', 'macosx_10_11_intel'), ('cp27', 'none', 'macosx_10_11_universal'), ('cp27', 'none', 'macosx_10_7_universal'), ('cp27', 'cp27dm', 'macosx_10_3_universal')]
                     E   	pex: Activating PEX virtual environment from /Users/travis/build/pantsbuild/pants/.pants.d/tmp/tmplw9xet.pants.d/run/py/CPython-2.7.10/b7fd9c60f3d9da53f70d142884661a3be9b93bdb
                     E   	pex: Activating PEX virtual environment from /Users/travis/build/pantsbuild/pants/.pants.d/tmp/tmplw9xet.pants.d/run/py/CPython-2.7.10/b7fd9c60f3d9da53f70d142884661a3be9b93bdb :: Searching dependency cache: /Users/travis/build/pantsbuild/pants/.pants.d/tmp/tmplw9xet.pants.d/run/py/CPython-2.7.10/b7fd9c60f3d9da53f70d142884661a3be9b93bdb/.deps
                     E   	pex: Activating PEX virtual environment from /Users/travis/build/pantsbuild/pants/.pants.d/tmp/tmplw9xet.pants.d/run/py/CPython-2.7.10/b7fd9c60f3d9da53f70d142884661a3be9b93bdb: 0.3ms
                     E   	pex:   Searching dependency cache: /Users/travis/build/pantsbuild/pants/.pants.d/tmp/tmplw9xet.pants.d/run/py/CPython-2.7.10/b7fd9c60f3d9da53f70d142884661a3be9b93bdb/.deps: 0.3ms
                     E   	pex: Activating PEX virtual environment from /Users/travis/build/pantsbuild/pants/.pants.d/tmp/tmplw9xet.pants.d/pyprep/requirements/CPython-2.7.10/a0e818ec6d7c24442ce52bcd8807dd335f927336-DefaultFingerprintStrategy_8c9b6e40089d
                     E   	pex: Activating PEX virtual environment from /Users/travis/build/pantsbuild/pants/.pants.d/tmp/tmplw9xet.pants.d/pyprep/requirements/CPython-2.7.10/a0e818ec6d7c24442ce52bcd8807dd335f927336-DefaultFingerprintStrategy_8c9b6e40089d :: Searching dependency cache: /Users/travis/build/pantsbuild/pants/.pants.d/tmp/tmplw9xet.pants.d/pyprep/requirements/CPython-2.7.10/a0e818ec6d7c24442ce52bcd8807dd335f927336-DefaultFingerprintStrategy_8c9b6e40089d/.deps
                     E   	pex: Activating PEX virtual environment from /Users/travis/build/pantsbuild/pants/.pants.d/tmp/tmplw9xet.pants.d/pyprep/requirements/CPython-2.7.10/a0e818ec6d7c24442ce52bcd8807dd335f927336-DefaultFingerprintStrategy_8c9b6e40089d :: Resolving fasthello==1.0.0
                     E   	pex: Failed to resolve a requirement: The 'fasthello==1.0.0' distribution was not found and is required by the application
                     E   	pex: Unresolved requirements:
                     E   	pex:   - fasthello
                     E   	pex: Distributions contained within this pex:
                     E   	pex:   - fasthello-1.0.0-cp27-cp27m-macosx_10_12_x86_64.whl
                     E   	Failed to execute PEX file, missing macosx_10_12_x86_64-cp-27-cp27m compatible dependencies for:
                     E   	fasthello
```

Easier to digest, and sorted, that's PEXEnvironment reported supported tag for interpreter:
PythonInterpreter(
  '/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python',
  PythonIdentity('CPython', 2, 7, 10) ...)

And `pkg_resources.Environmentf`'s default calculation of 'macosx-10.12-intel' as the platform:
```
('cp27', 'none', 'any'),
('cp2', 'none', 'any'),
('py27', 'none', 'any'),
('py2', 'none', 'any'),
('cp27', 'cp27d', 'macosx_10_0_universal'),
('cp27', 'cp27dm', 'macosx_10_0_universal'),
('cp27', 'cp27dmu', 'macosx_10_0_universal'),
('cp27', 'cp27m', 'macosx_10_0_universal'),
('cp27', 'cp27mu', 'macosx_10_0_universal'),
('cp27', 'cp27u', 'macosx_10_0_universal'),
('cp27', 'none', 'macosx_10_0_universal'),
('py2', 'none', 'macosx_10_0_universal'),
('cp27', 'cp27d', 'macosx_10_10_intel'),
('cp27', 'cp27dm', 'macosx_10_10_intel'),
('cp27', 'cp27dmu', 'macosx_10_10_intel'),
('cp27', 'cp27m', 'macosx_10_10_intel'),
('cp27', 'cp27mu', 'macosx_10_10_intel'),
('cp27', 'cp27u', 'macosx_10_10_intel'),
('cp27', 'none', 'macosx_10_10_intel'),
('py2', 'none', 'macosx_10_10_intel'),
('cp27', 'cp27d', 'macosx_10_10_universal'),
('cp27', 'cp27dm', 'macosx_10_10_universal'),
('cp27', 'cp27dmu', 'macosx_10_10_universal'),
('cp27', 'cp27m', 'macosx_10_10_universal'),
('cp27', 'cp27mu', 'macosx_10_10_universal'),
('cp27', 'cp27u', 'macosx_10_10_universal'),
('cp27', 'none', 'macosx_10_10_universal'),
('py2', 'none', 'macosx_10_10_universal'),
('cp27', 'cp27d', 'macosx_10_11_intel'),
('cp27', 'cp27dm', 'macosx_10_11_intel'),
('cp27', 'cp27dmu', 'macosx_10_11_intel'),
('cp27', 'cp27m', 'macosx_10_11_intel'),
('cp27', 'cp27mu', 'macosx_10_11_intel'),
('cp27', 'cp27u', 'macosx_10_11_intel'),
('cp27', 'none', 'macosx_10_11_intel'),
('py2', 'none', 'macosx_10_11_intel'),
('cp27', 'cp27d', 'macosx_10_11_universal'),
('cp27', 'cp27dm', 'macosx_10_11_universal'),
('cp27', 'cp27dmu', 'macosx_10_11_universal'),
('cp27', 'cp27m', 'macosx_10_11_universal'),
('cp27', 'cp27mu', 'macosx_10_11_universal'),
('cp27', 'cp27u', 'macosx_10_11_universal'),
('cp27', 'none', 'macosx_10_11_universal'),
('py2', 'none', 'macosx_10_11_universal'),
('cp27', 'cp27d', 'macosx_10_12_intel'),
('cp27', 'cp27dm', 'macosx_10_12_intel'),
('cp27', 'cp27dmu', 'macosx_10_12_intel'),
('cp27', 'cp27m', 'macosx_10_12_intel'),
('cp27', 'cp27mu', 'macosx_10_12_intel'),
('cp27', 'cp27u', 'macosx_10_12_intel'),
('cp27', 'none', 'macosx_10_12_intel'),
('py2', 'none', 'macosx_10_12_intel'),
('cp27', 'cp27d', 'macosx_10_12_universal'),
('cp27', 'cp27dm', 'macosx_10_12_universal'),
('cp27', 'cp27dmu', 'macosx_10_12_universal'),
('cp27', 'cp27m', 'macosx_10_12_universal'),
('cp27', 'cp27mu', 'macosx_10_12_universal'),
('cp27', 'cp27u', 'macosx_10_12_universal'),
('cp27', 'none', 'macosx_10_12_universal'),
('py2', 'none', 'macosx_10_12_universal'),
('cp27', 'cp27d', 'macosx_10_1_universal'),
('cp27', 'cp27dm', 'macosx_10_1_universal'),
('cp27', 'cp27dmu', 'macosx_10_1_universal'),
('cp27', 'cp27m', 'macosx_10_1_universal'),
('cp27', 'cp27mu', 'macosx_10_1_universal'),
('cp27', 'cp27u', 'macosx_10_1_universal'),
('cp27', 'none', 'macosx_10_1_universal'),
('py2', 'none', 'macosx_10_1_universal'),
('cp27', 'cp27d', 'macosx_10_2_universal'),
('cp27', 'cp27dm', 'macosx_10_2_universal'),
('cp27', 'cp27dmu', 'macosx_10_2_universal'),
('cp27', 'cp27m', 'macosx_10_2_universal'),
('cp27', 'cp27mu', 'macosx_10_2_universal'),
('cp27', 'cp27u', 'macosx_10_2_universal'),
('cp27', 'none', 'macosx_10_2_universal'),
('py2', 'none', 'macosx_10_2_universal'),
('cp27', 'cp27d', 'macosx_10_3_universal'),
('cp27', 'cp27dm', 'macosx_10_3_universal'),
('cp27', 'cp27dmu', 'macosx_10_3_universal'),
('cp27', 'cp27m', 'macosx_10_3_universal'),
('cp27', 'cp27mu', 'macosx_10_3_universal'),
('cp27', 'cp27u', 'macosx_10_3_universal'),
('cp27', 'none', 'macosx_10_3_universal'),
('py2', 'none', 'macosx_10_3_universal'),
('cp27', 'cp27d', 'macosx_10_4_intel'),
('cp27', 'cp27dm', 'macosx_10_4_intel'),
('cp27', 'cp27dmu', 'macosx_10_4_intel'),
('cp27', 'cp27m', 'macosx_10_4_intel'),
('cp27', 'cp27mu', 'macosx_10_4_intel'),
('cp27', 'cp27u', 'macosx_10_4_intel'),
('cp27', 'none', 'macosx_10_4_intel'),
('py2', 'none', 'macosx_10_4_intel'),
('cp27', 'cp27d', 'macosx_10_4_universal'),
('cp27', 'cp27dm', 'macosx_10_4_universal'),
('cp27', 'cp27dmu', 'macosx_10_4_universal'),
('cp27', 'cp27m', 'macosx_10_4_universal'),
('cp27', 'cp27mu', 'macosx_10_4_universal'),
('cp27', 'cp27u', 'macosx_10_4_universal'),
('cp27', 'none', 'macosx_10_4_universal'),
('py2', 'none', 'macosx_10_4_universal'),
('cp27', 'cp27d', 'macosx_10_5_intel'),
('cp27', 'cp27dm', 'macosx_10_5_intel'),
('cp27', 'cp27dmu', 'macosx_10_5_intel'),
('cp27', 'cp27m', 'macosx_10_5_intel'),
('cp27', 'cp27mu', 'macosx_10_5_intel'),
('cp27', 'cp27u', 'macosx_10_5_intel'),
('cp27', 'none', 'macosx_10_5_intel'),
('py2', 'none', 'macosx_10_5_intel'),
('cp27', 'cp27d', 'macosx_10_5_universal'),
('cp27', 'cp27dm', 'macosx_10_5_universal'),
('cp27', 'cp27dmu', 'macosx_10_5_universal'),
('cp27', 'cp27m', 'macosx_10_5_universal'),
('cp27', 'cp27mu', 'macosx_10_5_universal'),
('cp27', 'cp27u', 'macosx_10_5_universal'),
('cp27', 'none', 'macosx_10_5_universal'),
('py2', 'none', 'macosx_10_5_universal'),
('cp27', 'cp27d', 'macosx_10_6_intel'),
('cp27', 'cp27dm', 'macosx_10_6_intel'),
('cp27', 'cp27dmu', 'macosx_10_6_intel'),
('cp27', 'cp27m', 'macosx_10_6_intel'),
('cp27', 'cp27mu', 'macosx_10_6_intel'),
('cp27', 'cp27u', 'macosx_10_6_intel'),
('cp27', 'none', 'macosx_10_6_intel'),
('py2', 'none', 'macosx_10_6_intel'),
('cp27', 'cp27d', 'macosx_10_6_universal'),
('cp27', 'cp27dm', 'macosx_10_6_universal'),
('cp27', 'cp27dmu', 'macosx_10_6_universal'),
('cp27', 'cp27m', 'macosx_10_6_universal'),
('cp27', 'cp27mu', 'macosx_10_6_universal'),
('cp27', 'cp27u', 'macosx_10_6_universal'),
('cp27', 'none', 'macosx_10_6_universal'),
('py2', 'none', 'macosx_10_6_universal'),
('cp27', 'cp27d', 'macosx_10_7_intel'),
('cp27', 'cp27dm', 'macosx_10_7_intel'),
('cp27', 'cp27dmu', 'macosx_10_7_intel'),
('cp27', 'cp27m', 'macosx_10_7_intel'),
('cp27', 'cp27mu', 'macosx_10_7_intel'),
('cp27', 'cp27u', 'macosx_10_7_intel'),
('cp27', 'none', 'macosx_10_7_intel'),
('py2', 'none', 'macosx_10_7_intel'),
('cp27', 'cp27d', 'macosx_10_7_universal'),
('cp27', 'cp27dm', 'macosx_10_7_universal'),
('cp27', 'cp27dmu', 'macosx_10_7_universal'),
('cp27', 'cp27m', 'macosx_10_7_universal'),
('cp27', 'cp27mu', 'macosx_10_7_universal'),
('cp27', 'cp27u', 'macosx_10_7_universal'),
('cp27', 'none', 'macosx_10_7_universal'),
('py2', 'none', 'macosx_10_7_universal'),
('cp27', 'cp27d', 'macosx_10_8_intel'),
('cp27', 'cp27dm', 'macosx_10_8_intel'),
('cp27', 'cp27dmu', 'macosx_10_8_intel'),
('cp27', 'cp27m', 'macosx_10_8_intel'),
('cp27', 'cp27mu', 'macosx_10_8_intel'),
('cp27', 'cp27u', 'macosx_10_8_intel'),
('cp27', 'none', 'macosx_10_8_intel'),
('py2', 'none', 'macosx_10_8_intel'),
('cp27', 'cp27d', 'macosx_10_8_universal'),
('cp27', 'cp27dm', 'macosx_10_8_universal'),
('cp27', 'cp27dmu', 'macosx_10_8_universal'),
('cp27', 'cp27m', 'macosx_10_8_universal'),
('cp27', 'cp27mu', 'macosx_10_8_universal'),
('cp27', 'cp27u', 'macosx_10_8_universal'),
('cp27', 'none', 'macosx_10_8_universal'),
('py2', 'none', 'macosx_10_8_universal'),
('cp27', 'cp27d', 'macosx_10_9_intel'),
('cp27', 'cp27dm', 'macosx_10_9_intel'),
('cp27', 'cp27dmu', 'macosx_10_9_intel'),
('cp27', 'cp27m', 'macosx_10_9_intel'),
('cp27', 'cp27mu', 'macosx_10_9_intel'),
('cp27', 'cp27u', 'macosx_10_9_intel'),
('cp27', 'none', 'macosx_10_9_intel'),
('py2', 'none', 'macosx_10_9_intel'),
('cp27', 'cp27d', 'macosx_10_9_universal'),
('cp27', 'cp27dm', 'macosx_10_9_universal'),
('cp27', 'cp27dmu', 'macosx_10_9_universal'),
('cp27', 'cp27m', 'macosx_10_9_universal'),
('cp27', 'cp27mu', 'macosx_10_9_universal'),
('cp27', 'cp27u', 'macosx_10_9_universal'),
('cp27', 'none', 'macosx_10_9_universal'),
('py2', 'none', 'macosx_10_9_universal'),
```

It seems pex should hack support for this or fail fast if it see this sort of platform.


Discussion:
Found in https://github.com/pantsbuild/pants/pull/6104

Resolving patch:
diff --git a/pex/environment.py b/pex/environment.py
--- a/pex/environment.py
+++ b/pex/environment.py
@@ -120,13 +120,17 @@ def __init__(self, pex, pex_info, interpreter=None, **kw):
     self._interpreter = interpreter or PythonInterpreter.get()
     self._inherit_path = pex_info.inherit_path
     self._supported_tags = []
+
+    platform = Platform.current()
+    platform_name = platform.platform
     super(PEXEnvironment, self).__init__(
       search_path=[] if pex_info.inherit_path == 'false' else sys.path,
+      # NB: Our pkg_resources.Environment base-class wants the platform name string and not the
+      # pex.platform.Platform object.
+      platform=platform_name,
       **kw
     )
-    self._supported_tags.extend(
-      Platform.create(self.platform).supported_tags(self._interpreter)
-    )
+    self._supported_tags.extend(platform.supported_tags(self._interpreter))
     TRACER.log(
       'E: tags for %r x %r -> %s' % (self.platform, self._interpreter, self._supported_tags),
       V=9
diff --git a/pex/interpreter.py b/pex/interpreter.py
--- a/pex/interpreter.py
+++ b/pex/interpreter.py
@@ -261,8 +261,10 @@ def __str__(self):
     )
 
   def __repr__(self):
-    return 'PythonIdentity(%r, %s, %s, %s)' % (
-      self._interpreter,
+    return 'PythonIdentity(%r, %r, %r, %r, %r, %r)' % (
+      self.abbr_impl,
+      self.abi_tag,
+      self.impl_ver,
       self._version[0],
       self._version[1],
       self._version[2]
diff --git a/pex/resolver.py b/pex/resolver.py
--- a/pex/resolver.py
+++ b/pex/resolver.py
@@ -164,10 +164,58 @@ class Resolver(object):
 
   class Error(Exception): pass
 
+  @staticmethod
+  def _maybe_expand_platform(interpreter, platform=None):
+    # Expands `platform` if it is 'current' and abbreviated.
+    #
+    # IE: If we're on linux and handed a platform of `None`, 'current', or 'linux_x86_64', we expand
+    # the platform to an extended platform matching the given interpreter's abi info, eg:
+    # 'linux_x86_64-cp-27-cp27mu'.
+
+    cur_plat = Platform.current()
+    def expand_platform():
+      expanded_platform = Platform(platform=cur_plat.platform,
+                                   impl=interpreter.identity.abbr_impl,
+                                   version=interpreter.identity.impl_ver,
+                                   abi=interpreter.identity.abi_tag)
+      TRACER.log("""
+Modifying given platform of {given_platform!r}:
+Using the current platform of {current_platform!r}
+Under current interpreter {current_interpreter!r}
+
+To match given interpreter {given_interpreter!r}.
+
+Calculated platform: {calculated_platform!r}""".format(
+        given_platform=platform,
+        current_platform=cur_plat,
+        current_interpreter=PythonInterpreter.get(),
+        given_interpreter=interpreter,
+        calculated_platform=expanded_platform),
+        V=9
+      )
+      return expanded_platform
+
+    if platform in (None, 'current'):
+      # Always expand the default local (abbreviated) platform to the given interpreter.
+      return expand_platform()
+    else:
+      given_platform = Platform.create(platform)
+      if given_platform.is_extended:
+        # Always respect an explicit extended platform.
+        return given_platform
+      elif given_platform.platform != cur_plat.platform:
+        # IE: Say we're on OSX and platform was 'linux-x86_64'; we can't expand a non-local
+        # platform so we leave as-is.
+        return given_platform
+      else:
+        # IE: Say we're on 64 bit linux and platform was 'linux-x86_64'; ie: the abbreviated local
+        # platform.
+        return expand_platform()
+
   def __init__(self, allow_prereleases=None, interpreter=None, platform=None,
                pkg_blacklist=None, use_manylinux=None):
     self._interpreter = interpreter or PythonInterpreter.get()
-    self._platform = Platform.create(platform) if platform else Platform.current()
+    self._platform = self._maybe_expand_platform(self._interpreter, platform)
     self._allow_prereleases = allow_prereleases
     self._blacklist = pkg_blacklist.copy() if pkg_blacklist else {}
     self._supported_tags = self._platform.supported_tags(


Test patch:
diff --git a/tests/test_environment.py b/tests/test_environment.py
--- a/tests/test_environment.py
+++ b/tests/test_environment.py
@@ -1,23 +1,36 @@
 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
 # Licensed under the Apache License, Version 2.0 (see LICENSE).
-
 import os
+import platform
+import subprocess
 from contextlib import contextmanager
 
+import pytest
 from twitter.common.contextutil import temporary_dir
 
-from pex.compatibility import nested
+from pex import resolver
+from pex.compatibility import nested, to_bytes
 from pex.environment import PEXEnvironment
+from pex.installer import EggInstaller, WheelInstaller
+from pex.interpreter import PythonInterpreter
+from pex.package import EggPackage, SourcePackage, WheelPackage
+from pex.pex import PEX
 from pex.pex_builder import PEXBuilder
 from pex.pex_info import PexInfo
 from pex.testing import make_bdist, temporary_filename
+from pex.version import SETUPTOOLS_REQUIREMENT, WHEEL_REQUIREMENT
 
 
 @contextmanager
-def yield_pex_builder(zip_safe=True):
-  with nested(temporary_dir(), make_bdist('p1', zipped=True, zip_safe=zip_safe)) as (td, p1):
-    pb = PEXBuilder(path=td)
-    pb.add_egg(p1.location)
+def yield_pex_builder(zip_safe=True, installer_impl=EggInstaller, interpreter=None):
+  with nested(temporary_dir(),
+              make_bdist('p1',
+                         zipped=True,
+                         zip_safe=zip_safe,
+                         installer_impl=installer_impl,
+                         interpreter=interpreter)) as (td, p1):
+    pb = PEXBuilder(path=td, interpreter=interpreter)
+    pb.add_dist_location(p1.location)
     yield pb
 
 
@@ -95,3 +108,57 @@ def test_load_internal_cache_unzipped():
     assert len(dists) == 1
     assert normalize(dists[0].location).startswith(
         normalize(os.path.join(pb.path(), pb.info.internal_cache)))
+
+
+_KNOWN_BAD_APPLE_INTERPRETER = ('/System/Library/Frameworks/Python.framework/Versions/'
+                                '2.7/Resources/Python.app/Contents/MacOS/Python')
+
+
+@pytest.mark.skipif(not os.path.exists(_KNOWN_BAD_APPLE_INTERPRETER),
+                    reason='Test requires known bad Apple interpreter {}'
+                           .format(_KNOWN_BAD_APPLE_INTERPRETER))
+def test_osx_platform_intel_issue_523():
+  def bad_interpreter(include_site_extras=True):
+    return PythonInterpreter.from_binary(_KNOWN_BAD_APPLE_INTERPRETER,
+                                         include_site_extras=include_site_extras)
+
+  interpreter = bad_interpreter(include_site_extras=False)
+  with temporary_dir() as cache:
+    # We need to run the bad interpreter with a modern, non-Apple-Extras setuptools in order to
+    # successfully install psutil.
+    for requirement in (SETUPTOOLS_REQUIREMENT, WHEEL_REQUIREMENT):
+      for dist in resolver.resolve([requirement],
+                                   cache=cache,
+                                   # We can't use wheels since we're bootstrapping them.
+                                   precedence=(SourcePackage, EggPackage),
+                                   interpreter=interpreter):
+        interpreter = interpreter.with_extra(dist.key, dist.version, dist.location)
+
+    with nested(yield_pex_builder(installer_impl=WheelInstaller, interpreter=interpreter),
+                temporary_filename()) as (pb, pex_file):
+      for dist in resolver.resolve(['psutil==5.4.3'],
+                                   cache=cache,
+                                   precedence=(SourcePackage, WheelPackage),
+                                   interpreter=interpreter):
+        pb.add_dist_location(dist.location)
+      pb.build(pex_file)
+
+      # NB: We want PEX to find the bare bad interpreter at runtime.
+      pex = PEX(pex_file, interpreter=bad_interpreter())
+      args = ['-c', 'import pkg_resources; print(pkg_resources.get_supported_platform())']
+      env = os.environ.copy()
+      env['PEX_VERBOSE'] = '1'
+      process = pex.run(args=args,
+                        env=env,
+                        blocking=False,
+                        stdout=subprocess.PIPE,
+                        stderr=subprocess.PIPE)
+      stdout, stderr = process.communicate()
+      assert 0 == process.returncode, (
+        'Process failed with exit code {} and stderr:\n{}'.format(process.returncode, stderr)
+      )
+
+      # Verify this all worked under the previously problematic pkg_resources-reported platform.
+      release, _, _ = platform.mac_ver()
+      major_minor = '.'.join(release.split('.')[:2])
+      assert to_bytes('macosx-{}-intel'.format(major_minor)) == stdout.strip()