Repository: pantsbuild/pants

Issue:
Plugin resolution fails to resolve `pantsbuild.pants` for 1.8.0.dev3
Looks like so:
```
$ ./pants --version
INFO] Resolving new plugins...:
  pantsbuild.pants.contrib.node==1.8.0.dev3
Exception caught: (<class 'pex.resolver.Unsatisfiable'>)
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/bin/pants", line 11, in <module>
    sys.exit(main())
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/bin/pants_loader.py", line 69, in main
    PantsLoader.run()
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/bin/pants_loader.py", line 65, in run
    cls.load_and_execute(entrypoint)
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/bin/pants_loader.py", line 58, in load_and_execute
    entrypoint_main()
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/bin/pants_exe.py", line 39, in main
    PantsRunner(exiter, start_time=start_time).run()
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/bin/pants_runner.py", line 53, in run
    return runner.run()
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 46, in run
    self._run()
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 54, in _run
    build_config = BuildConfigInitializer.get(options_bootstrapper)
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/init/options_initializer.py", line 39, in get
    cls._cached_build_config = cls(options_bootstrapper, working_set).setup()
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/init/options_initializer.py", line 49, in __init__
    self._working_set = working_set or PluginResolver(self._options_bootstrapper).resolve()
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/init/plugin_resolver.py", line 74, in resolve
    for plugin_location in self._resolve_plugin_locations():
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/init/plugin_resolver.py", line 100, in _resolve_exact_plugin_locations
    for plugin in self._resolve_plugins():
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pants/init/plugin_resolver.py", line 115, in _resolve_plugins
    allow_prereleases=PANTS_SEMVER.is_prerelease)
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pex/resolver.py", line 453, in resolve
    return resolver.resolve(resolvables_from_iterable(requirements, builder))
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pex/resolver.py", line 235, in resolve
    resolvable_set.merge(resolvable, packages, parent)
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pex/resolver.py", line 131, in merge
    self._check()
  File "/home/jhersch/.cache/pants/setup/bootstrap-Linux-x86_64/1.8.0.dev3/local/lib/python2.7/site-packages/pex/resolver.py", line 123, in _check
    self._synthesize_parents(name)

Exception message: Could not satisfy all requirements for pantsbuild.pants==1.8.0.dev3:
    pantsbuild.pants==1.8.0.dev3(from: pantsbuild.pants.contrib.node==1.8.0.dev3)
```


Discussion:
OK, pex 1.4.3+ supports manylinux wheels, but not by default. We need to be passing `use_manylinux=True` in our uses of `pex.resolver.resolve`.

Resolving patch:
diff --git a/src/python/pants/backend/python/subsystems/python_setup.py b/src/python/pants/backend/python/subsystems/python_setup.py
--- a/src/python/pants/backend/python/subsystems/python_setup.py
+++ b/src/python/pants/backend/python/subsystems/python_setup.py
@@ -75,6 +75,9 @@ def register_options(cls, register):
               'NOTE: this keyword is a temporary fix and will be reverted per: '
               'https://github.com/pantsbuild/pants/issues/5696. The long term '
               'solution is tracked by: https://github.com/pantsbuild/pex/issues/456.')
+    register('--resolver-use-manylinux', advanced=True, type=bool, default=True, fingerprint=True,
+             help='Whether to consider manylinux wheels when resolving requirements for linux '
+                  'platforms.')
 
   @property
   def interpreter_constraints(self):
@@ -124,6 +127,10 @@ def resolver_allow_prereleases(self):
   def resolver_blacklist(self):
     return self.get_options().resolver_blacklist
 
+  @property
+  def use_manylinux(self):
+    return self.get_options().resolver_use_manylinux
+
   @property
   def artifact_cache_dir(self):
     """Note that this is unrelated to the general pants artifact cache."""
diff --git a/src/python/pants/backend/python/tasks/pex_build_util.py b/src/python/pants/backend/python/tasks/pex_build_util.py
--- a/src/python/pants/backend/python/tasks/pex_build_util.py
+++ b/src/python/pants/backend/python/tasks/pex_build_util.py
@@ -218,6 +218,7 @@ def _resolve_multi(interpreter, requirements, platforms, find_links):
       cache=requirements_cache_dir,
       cache_ttl=python_setup.resolver_cache_ttl,
       allow_prereleases=python_setup.resolver_allow_prereleases,
-      pkg_blacklist=python_setup.resolver_blacklist)
+      pkg_blacklist=python_setup.resolver_blacklist,
+      use_manylinux=python_setup.use_manylinux)
 
   return distributions
diff --git a/src/python/pants/init/plugin_resolver.py b/src/python/pants/init/plugin_resolver.py
--- a/src/python/pants/init/plugin_resolver.py
+++ b/src/python/pants/init/plugin_resolver.py
@@ -112,7 +112,10 @@ def _resolve_plugins(self):
                             context=self._python_repos.get_network_context(),
                             cache=self.plugin_cache_dir,
                             cache_ttl=10 * 365 * 24 * 60 * 60,  # Effectively never expire.
-                            allow_prereleases=PANTS_SEMVER.is_prerelease)
+                            allow_prereleases=PANTS_SEMVER.is_prerelease,
+                            # Plugins will all depend on `pantsbuild.pants` which is distributed as
+                            # a manylinux wheel.
+                            use_manylinux=True)
 
   @memoized_property
   def plugin_cache_dir(self):


Test patch: