{"action":"created","issue":{"url":"https://api.github.com/repos/pantsbuild/pants/issues/6022","repository_url":"https://api.github.com/repos/pantsbuild/pants","labels_url":"https://api.github.com/repos/pantsbuild/pants/issues/6022/labels{/name}","comments_url":"https://api.github.com/repos/pantsbuild/pants/issues/6022/comments","events_url":"https://api.github.com/repos/pantsbuild/pants/issues/6022/events","html_url":"https://github.com/pantsbuild/pants/pull/6022","id":335624046,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3Mjc3NDMy","number":6022,"title":"add the target fingerprint to the version of each local dist so that we don't use the first cached one","user":{"login":"cosmicexplorer","id":1305167,"node_id":"MDQ6VXNlcjEzMDUxNjc=","avatar_url":"https://avatars1.githubusercontent.com/u/1305167?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmicexplorer","html_url":"https://github.com/cosmicexplorer","followers_url":"https://api.github.com/users/cosmicexplorer/followers","following_url":"https://api.github.com/users/cosmicexplorer/following{/other_user}","gists_url":"https://api.github.com/users/cosmicexplorer/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmicexplorer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmicexplorer/subscriptions","organizations_url":"https://api.github.com/users/cosmicexplorer/orgs","repos_url":"https://api.github.com/users/cosmicexplorer/repos","events_url":"https://api.github.com/users/cosmicexplorer/events{/privacy}","received_events_url":"https://api.github.com/users/cosmicexplorer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/pantsbuild/pants/milestones/17","html_url":"https://github.com/pantsbuild/pants/milestone/17","labels_url":"https://api.github.com/repos/pantsbuild/pants/milestones/17/labels","id":3471083,"node_id":"MDk6TWlsZXN0b25lMzQ3MTA4Mw==","number":17,"title":"1.9.x","description":"","creator":{"login":"cosmicexplorer","id":1305167,"node_id":"MDQ6VXNlcjEzMDUxNjc=","avatar_url":"https://avatars1.githubusercontent.com/u/1305167?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmicexplorer","html_url":"https://github.com/cosmicexplorer","followers_url":"https://api.github.com/users/cosmicexplorer/followers","following_url":"https://api.github.com/users/cosmicexplorer/following{/other_user}","gists_url":"https://api.github.com/users/cosmicexplorer/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmicexplorer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmicexplorer/subscriptions","organizations_url":"https://api.github.com/users/cosmicexplorer/orgs","repos_url":"https://api.github.com/users/cosmicexplorer/repos","events_url":"https://api.github.com/users/cosmicexplorer/events{/privacy}","received_events_url":"https://api.github.com/users/cosmicexplorer/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":2,"state":"open","created_at":"2018-07-03T18:43:48Z","updated_at":"2018-07-15T17:11:38Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2018-06-26T01:25:52Z","updated_at":"2018-07-16T16:30:23Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/pantsbuild/pants/pulls/6022","html_url":"https://github.com/pantsbuild/pants/pull/6022","diff_url":"https://github.com/pantsbuild/pants/pull/6022.diff","patch_url":"https://github.com/pantsbuild/pants/pull/6022.patch"},"body":"### Problem\r\n\r\nI made #5479 because the dist resolved for a `python_dist()` would not change after changing any of the source files, and this persisted even after a `clean-all`. This issue is more thoroughly explained in #5449 (which I literally didn't see before making this PR, but describes almost exactly what this PR does, it seems -- great minds think alike?). We were building the `python_dist()` targets each time they were invalidated, but caching the package locally in `~/.cache/pants/` after we built it the first time and using that instead, because the version string was the same for both the first and subsequent builds of the `python_dist()` target.\r\n\r\n### Solution\r\n\r\n- Move argv generation for setup.py invocations into `BuildLocalPythonDistributions`.\r\n- Append the `python_dist()` target's fingerprint to the version string using `--tag-build`. This conforms to the \"local\" version specifier format as per [PEP 440](https://www.python.org/dev/peps/pep-0440/#local-version-identifiers). This tagged version is then used in the synthetic `PythonRequirement` stitched into the build graph for the local dist.\r\n- Add an integration test `test_invalidation()` using `mock_buildroot()` (which fails on master, but not in this PR) where we run a binary depending on a `python_dist()`, rewrite the contents of a source file to change the output, then run pants again to verify that the new dist is resolved.\r\n\r\n*Separately:*\r\n\r\n- Made `PythonDistribution` subclass `PythonTarget` to avoid duplicated logic. It's not clear what the original reason for not subclassing it was at first, but it seems to be not be in effect anymore.\r\n- Changed the `dir` field name for the `Manager` namedtuple in `mock_buildroot()` to be `new_buildroot` so it doesn't get highlighted as a builtin in certain text editors.\r\n\r\n### Result\r\n\r\nWhen we resolve local dists in any python requirements task, we get the dist corresponding to the target we just built. Resolves #5449."},"comment":{"url":"https://api.github.com/repos/pantsbuild/pants/issues/comments/405306409","html_url":"https://github.com/pantsbuild/pants/pull/6022#issuecomment-405306409","issue_url":"https://api.github.com/repos/pantsbuild/pants/issues/6022","id":405306409,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTMwNjQwOQ==","user":{"login":"jsirois","id":157586,"node_id":"MDQ6VXNlcjE1NzU4Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/157586?v=4","gravatar_id":"","url":"https://api.github.com/users/jsirois","html_url":"https://github.com/jsirois","followers_url":"https://api.github.com/users/jsirois/followers","following_url":"https://api.github.com/users/jsirois/following{/other_user}","gists_url":"https://api.github.com/users/jsirois/gists{/gist_id}","starred_url":"https://api.github.com/users/jsirois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsirois/subscriptions","organizations_url":"https://api.github.com/users/jsirois/orgs","repos_url":"https://api.github.com/users/jsirois/repos","events_url":"https://api.github.com/users/jsirois/events{/privacy}","received_events_url":"https://api.github.com/users/jsirois/received_events","type":"User","site_admin":false},"created_at":"2018-07-16T16:30:23Z","updated_at":"2018-07-16T16:30:23Z","author_association":"MEMBER","body":"@cosmicexplorer if you see this:\r\n```\r\npex: 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)"}}
{"actor":{"display_login":"jsirois"}}