rules_python icon indicating copy to clipboard operation
rules_python copied to clipboard

Pull rules_pycross into rules_python

Open rickeylev opened this issue 2 years ago • 5 comments

A recurring source of issues in rules_python is the underlying support for how wheels are handled, mainly that support for multiple platforms and versions doesn't work very well because a lot of activity happens at repo-rule time. Several of us have been looking at different parts of this problem, and we've generally come to the conclusion that a more idealized implementation is more akin to having simple http_file download's of the pypi artifacts, and moving any subsequent logic out of repo-rule time and into the regular build phase. This is a pretty big change in how things are done.

Luckily for us, @jvolkman's rules_pycross has done much of this already, and he's said its OK for us to take that code.

Per Google's rules, there are two ways we can do this:

  1. jvolkman@ signs the Google CLA (done already, can check internal signcla page for jvolkman) and then sends a pull request contributing his code. This is treated like any other pull request, and rules_python then owns the code.
  2. Copy the rules_pycross code in a top-level third_party directory. Any existing LICENSE and copyright headers must be preserved. If we edit a file, we must modify the copyright header to include Google LLC.

(1) is preferred because it's just less overhead in the long run.

I suggest we ask Jeremy to simply do a one-time code-dump it into //python/private/pycross_staging, then we can start picking it apart as necessary. This avoids the extra overhead of license and copyright management from (2), and having to ask Jeremy to send a PR for some new piece of pycross we want to reuse.

After its ingested, we can rename things to drop the "pycross" prefixes, figure out appropriate APIs we wish to expose, how to integrate with our existing code, etc

  • [ ] jvolkman@ sends PR contributing code
  • [ ] Rename to remove "pycross" prefixes
  • [ ] Figure out public API surface
  • [ ] Integrate with existing workspace/bzlmod build styles

rickeylev avatar Aug 03 '23 19:08 rickeylev

Who is working on this?

chrislovecnm avatar Aug 05 '23 14:08 chrislovecnm

Option 1 LGTM if LGTY @jvolkman

groodt avatar Aug 06 '23 13:08 groodt

I assume it's me working on this, but we're camping this week so I won't be able to get to it until after.

jvolkman avatar Aug 06 '23 15:08 jvolkman

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!

github-actions[bot] avatar Feb 18 '24 22:02 github-actions[bot]

@rickeylev

Since the robots are gonna close this soonish, are we still aiming to do this? While I can't contribute on this, I would be interested in this being available in rules_python eventually.

martis42 avatar Feb 25 '24 13:02 martis42

Code was vendored here https://github.com/bazelbuild/rules_python/tree/main/third_party/rules_pycross

Closing this as the code is ported which completes the main motivators here. We have yet to really use or take advantage of the code. Plans have changed as well so perhaps we won't end up using the code after all.

groodt avatar Jun 21 '24 09:06 groodt