如何有效地缓存货物/生锈项目在Azure Build Pipeline中
我有一组Azure构建管道来编译Rust Projects,目前使用Blob存储存储.cargo
和target
文件夹作为缓存。
When compiling locally, once a binary is compiled the first time, subsequent cargo build
's don't compile the dependent libraries/crates again, just the local binary, however with my current pipeline system, after downloading缓存并使用正确的目标文件夹构建,管道仍下载并构建板条箱。
这是我的Config.toml,用于缓存和任何管道构建。
[build]
target-dir = "./target"
dep-info-basedir = "."
incremental = true
在某些情况下,它减少了汇编时间,但并不像我预期的那样多。 我可以缓存更多文件夹以提高速度吗?是否有一些缓存标识符,货物正在检查和污染缓存?
管道运行一个自定义XTASK二进制文件,该二进制执行许多任务,包括运行货物构建 - 释放
这会引起问题吗?
I have a set of Azure Build Pipelines that compile rust projects and currently use blob storage to store the .cargo
and target
folders as a cache.
When compiling locally, once a binary is compiled the first time, subsequent cargo build
's don't compile the dependent libraries/crates again, just the local binary, however with my current pipeline system, after downloading the cache and using the correct target folder to build into, the pipeline still downloads and builds crates.
This is my config.toml for the cache and any pipeline builds.
[build]
target-dir = "./target"
dep-info-basedir = "."
incremental = true
It has reduced compilation times in some cases but not nearly as much as I expect.
Can I cache more folders to increase speed? Is there some cache identifier that cargo is checking and fouling the cache over?
The pipelines run a custom xtask binary which performs many tasks including running cargo build --release
could this be causing issues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要缓存
target
和〜/.cargo/.cargo/registristr
,凯撒在上面的评论中提到。以下对我有用():
You need to cache
target
and~/.cargo/registry
as mentioned by Caesar in the comments above.The following worked for me (docs):