-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pants python thrift building allows no control over the default thrift requirement. #2533
Comments
For reference - the Aurora issue blocked on this fix: https://issues.apache.org/jira/browse/AURORA-1499 |
The lowest-impact 1st step to free up Aurora and other users in a similar bind is to simply respect direct A second phase can plumb an option to change the fallback from |
Actually - the low-impact step already works, its just not obvious - depends on non-local properties of |
Stopping progress on this for now since Aurora is unblocked. |
Twitter commons was using a wrapper function around its python dependencies to create python_requirement_library targets. The python_requirements library is able to understand a pip requirements.txt file and convert each entry into the python_requirement_library target needed by Pants. The python_requirements target uses the project name as a target name. The original wrapper was maintained for a few dependencies when their name clashed with Pants BUILD file conventions. I also removed the easy_install thrift, it looks like it was put in place to service aurora, who was later unblocked. Let me know if you think it should be returned: pantsbuild/pants#2533 The purpose of this change is to enable a simple interface to convert some python dependencies from being hardcoded to a single rev into being able to be satisfied by a release range. I will submit any dependency version changes separately.
Not sure this is quite the same problem, but it looks like on master (and well before) there should be a way to specify the thrift version to use for generating thrift. I was hoping it would be possible to use that, but I don't seem to find anywhere that that can be specified from pants when doing. The following doesn't work in pants 1.0.1
Any help would be much appreciated. Thanks! Edit: Answering my own question, following up on some Aurora tickets, looks like adding
to my pants.ini upgrade version of thrift binary used. Takes a |
Just to follow up, when I am looking for options, I use
There are some options that aren't set directly on the task when they are shared across multiple tasks (we call these subsystems) Looking through the help dump you'll find the docs on the settings in the
|
@paulcavallaro that controls the thrift binary version for places where we execute that directly to generate code. the resolve failure highlighted above is separate and relates to the implicit injection of the python so afaict from a quick skim, this static requirement string the crux of the issue: https://github.com/pantsbuild/pants/blob/master/src/python/pants/backend/python/thrift_builder.py#L35-L37 |
Due to the way the pex resolver works today (like pip, in breadth 1st rounds), the unconstrained thrift dependency pants' PythonChroot (and ThriftBuilder) inject in the 1st resolution round can easily conflict with thrift requirements in later (deeper transitive dep) rounds. The solution for the pex cli or in pip itself is to use the top-level requirements to adjust deps. With pants implicit
thrift
requirement injection - this option is off the table. As a result, we see errors like this one in apache aurora when trying to upgrade to modern pants/pex (0.0.57/1.1.0) - debugging prints added:And NB:
The above is an example from apache aurora where the top-level req. is
thrift
injected by PythonChroot and that picksthrift 0.9.3
. The second round of resolution includes thethrift==0.9.1
requirement fromtwitter.common.recordio==0.3.3
and this leads to failure since0.9.3
does not satisfy==0.9.1
.At a high level, the 2 thrift requirements considered post-facto should lead to a solution,
thrift,thrift==0.9.1
->thrift==0.9.1
. The issue as explained above is the requirements are resolved in layers with no compatibility smarts at the pex layer and no backtracking to try alternate solutions from prior layers with the current layer. There is a TODO in the pex resolver code to consider backtracking, but this is both of questionable utility (it would be different behavior from pip - which is the behavior folks expect) and a not insignificant change. As a result pants should probably just provide better control of the injected thrift requirement, possibly using semver constraints as the basis for the default instead of a wide-open dep. The thrift utility it uses knows the thrift compiler version number after all.The text was updated successfully, but these errors were encountered: