Skip to content
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

feat: add a persistent worker for download actions #18

Open
oxidase opened this issue Apr 6, 2023 · 3 comments
Open

feat: add a persistent worker for download actions #18

oxidase opened this issue Apr 6, 2023 · 3 comments

Comments

@oxidase
Copy link
Owner

oxidase commented Apr 6, 2023

As the pip cache is disabled a persistent downloader could potentially speed up builds by removing duplicated downloads of the same wheels for different Bazel configurations.

@oxidase oxidase added this to the 0.2.0 milestone Apr 6, 2023
@oxidase oxidase modified the milestones: 0.2.0, 0.3.0 May 18, 2023
@alexeagle
Copy link

Could it use the Bazel downloader (repository_ctx.download) so that Bazel naturally uses its --repository_cache to avoid re-fetching?

@oxidase
Copy link
Owner Author

oxidase commented Jul 14, 2023

Using repository_ctx.download won't work here as the wheels download is moved to a rule context where the required Python toolchain is resolved and unfortunately it is not possible to share wheels between a host and target configuration even if the resolved toolchain is the same for both configurations.

rules_pycross uses a combined way: downloads within a repository context with repository_ctx.download and builds/installs wheels within a rule context where downloaded wheels are selected from a pre-defined set of Python environments in wheel attribute . rules_python uses even a simpler approach: downloads and installs within a repository context with some fixed pre-defined Python toolchain.

Moving downloads to a repository context will require a same approach with select as in rules_pycross.

@alexeagle
Copy link

Awesome, thank you for summarizing. I think what I'm really after from this repo is your TOML parser (well, Poetry lockfile parser to be precise, there's no promise that it correctly parses arbitrary files, just the subset Poetry actually uses.)

I'd like to plug it together with pip_parse from rules_python, similar to what https://github.com/AndrewGuenther/rules_python_poetry does, but without relying on poetry being on the path during repository rule execution, and without attempting to fetch a hermetic poetry and run as a binary during repository rule execution.

@oxidase oxidase removed this from the 0.3.0 milestone Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants