Allow runnable lock targets to reuse the `uv` cache
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 70/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
该 issue 指向 lock.bzl 文件以及设置 --no-cache 的具体行。首先检查 lock.bzl 文件,特别是生成可运行目标的函数。理解该标志在构建操作与可运行目标之间的不同应用方式。通过修改标志并运行目标进行测试,以确保缓存能按预期被重用。
由索引模型根据 Issue 内容生成。
描述
🚀 feature request
Relevant Rules
Description
The runnable targets generated by lock pass --no-cache to uv:
https://github.com/bazel-contrib/rules_python/blob/9cc620ebf92d9afaa1c0535968d82d5a7d7e4522/python/uv/private/lock.bzl#L146
This flag applies to both build actions and runnable targets. As a result, repeated invocations of bazel run //path:requirements.run (in our case via multirun), use temporary caches instead of reusing registry metadata, Git checkouts, and build metadata.
Describe the solution you'd like
Drop the --no-cache flag from .run target but keep it on build actions. This way runnable targets would use the caller's environment and write the lockfile into the workspace, so they could also reuse the cache. Callers could still pass --no-cache or select a cache with UV_CACHE_DIR if they want.
Describe alternatives you've considered
Patching rules_python downstream. I'll open up a PR to show what my patch looks like.
- 主要语言
- Starlark
- 星标
- 690
- 派生
- 722
- 平均合并
- 1 天 55 分钟
- 30 天内合并 PR
- 38
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bazel-contrib/rules_python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
bazel-contrib/rules_python#4164 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
bazel-contrib/rules_python#3821 ·
-
难度 3/5 1-2 天 新手友好度 45/100
bazel-contrib/rules_python#4181 ·
-
Release 2.4.0 未关闭type: release
难度 4/5 3-5 天 新手友好度 25/100
bazel-contrib/rules_python#4175 · 3 条评论 ·
-
Release 2.3.4 未关闭type: release
难度 2/5 1-3 小时 新手友好度 35/100
bazel-contrib/rules_python#4173 · 2 条评论 ·
查看 bazel-contrib/rules_python 的全部 Issue
相似的 Issue
-
Name consistency 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eellak/triplestore#65 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
area-Bzlmod team-ExternalDeps type: bug untriaged
难度 2/5 1-3 小时 新手友好度 65/100
bazelbuild/bazel#31291 · 2 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
bradcypert/plum#53 ·