用vibe coding的方式迅速搓了一个rust实现的gotify转matrix的桥接bot (https://github.com/ControlNet/gotify-matrix-bridge),结果发现在github action用跨平台docker build的时候,编译速度特别慢,需要两个半小时才能跑完。

然后尝试了一下
#sccache 折腾了好几个小时还是没跑起来,要么是可以在docker里外接别的存储服务,要么可以是在github action runner宿主机里直接用github自带的cache系统,但是要在github action中的docker build里用sccache就各种出问题。

Dear #rust folks, it looks like #sccache is failing to handle or rebuild a crate which uses a build.rs to generate sources into OUT_DIR.

For some reason, after getting built the first time, the cache then fails to include the generated code in OUT_DIR as well, resulting in subsequent builds failing.

Has anyone dealt with this before?

I want to use #Lychee (a link check written in #Rust) on #CircleCI. Doing just `cargo install lychee` took 5min, so I searched the internet and got advised I should use #sccache to cache dependencies or what.

Now it takes 13min, because `cargo install sccache` takes 7min and `cargo install lychee` takes 5.5min 🤦‍♂️

Anyone has an idea how to install a Rust thing to a machine in a reasonable time or how to cache the binary or something?

No więc walczę z upierdliwą paczką Rusta w #Gentoo, której testy się sypią, cholera wie dlaczego. Częścią walki jest konieczność budowania w kółko od zera tej samej paczki. Zainstalowałem więc #SCCache, żeby to trochę przyspieszyć. Ogólnie, nie jest to szczególnie użyteczne narzędzie, bo działa tylko wtedy, kiedy za każdym razem ścieżki do plików są identyczne, ale w tym szczególnym przypadku powinno pomóc. I na początku pomagało.

A potem zaczęło się dziać coś dziwnego. SCCache uruchamia sobie jakiś proces w tle. Kiedy ninja kończy już z jednym wywołaniem `cargo build`, to ten proces sobie wisi w tle i blokuje ninję przed budowaniem kolejnego celu. I za każdym razem muszę ręcznie ten proces ubijać. Tyle z przyspieszenia.

#RustLang

So I'm fighting this damn #RustLang package whose test suite fails in #Gentoo for no apparent reason. My fight involves rebuilding the damn thing repeatedly, so I've installed #SCCache to speed this up. While it's not very useful in general, since it requires exact path match, it certainly sounded like something that would speed up repeatedly building the same damn thing. And it did, at first.

Then something weird started happening. SCCache keeps spawning a background process. Whenever ninja is done doing a specific `cargo build` invocation, this process remains hanging and prevents ninja from proceeding. I need to SIGTERM it every single time it happens. So much for speedup.

Your intution is good.

#sccache offers enough improvement that one can be sure it's operating. However, even with a #Rust build cache that isn't filled, I've seen a build-time reduction of 50% only under ideal conditions and it seems to be closer to 14% in the average case.

For what it's worth, both numbers come from multi-hour builds that ought to have plenty of redundancy for a build cache to squeeze out. However, I've seen other comments online that make points similar to yours.

Regarding the welcome to the crab world, I'm pleased to see a number of interesting tools appear that, in many cases, simply build and work once things are in order. And they do build offline for me now, which is a plus.

It seems similar to the #Go ecosystem in some respects. I've become attached to a few Go stalwarts such as "gitea", "mlr", and "rclone", and I imagine that similar Rust projects will grow in number and will reach critical mass.

I'm not shy to be a CLI guy and these have fallen out of the Rust sky like CLI pie so far:

alacritty - I'm using this one right now.
coreutils - Same as "busybox" but for Rust.
dog - Instead of "dig". Sure, why not.
lfs - Similar to "df -m" but output is more readable.
macchina - It's not "conky", but it has the basics. Plus a Tux.
mdcat - MD render cat is all that.
names - Fun name generator for repos, etc.
netavark - I gather that "podman" needs this now.
netscanner - Unexpectedly nice network scanner TUI.
pastel - This is certainly colorful.
procs - Credible alternative to "htop".
rg - I've heard about this one and look forward to trying it.
sd - Useful supplement to "sed".
csvlens and xsv - Useful supplements to "mlr".
zet - Useful supplement to "uniq".

A new mentorship program for #sccache is on the way!

This time, I'll be mentoring on how to implement a storage check bypass in sccache. It will be an easy #RustLang task for newcomers. Interested?

Apply by commenting on the issue. I'll get in touch with you

https://github.com/mozilla/sccache/issues/2132

Hitting rate limiting issues due to .sccache_check write checks on GCS · Issue #2132 · mozilla/sccache

We're using sccache v0.7.6, we have a lot of builds running in parallel and each run invokes sccache which in turn tries to do a sccache RW check by reading and writing .sccache_check dummy file. W...

GitHub
🌘 GitHub - mozilla/sccache: sccache是具有雲端存儲功能的ccache
➤ sccache - Shared Compilation Cache
https://github.com/mozilla/sccache
sccache是一款類似於ccache的編譯器快取工具,可將快取結果存儲在本地磁碟或多個雲端存儲後端之一。
+ 這個標題讓我對這個開源項目有了更清楚的瞭解,謝謝你提供的翻譯!
+ 總結非常簡潔明瞭,讓我對此開源項目有了初步的認識,期待能瞭解更多相關詳情。
#GitHub #mozilla #sccache #開源項目 #編譯快取
GitHub - mozilla/sccache: Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various...

GitHub

I haven't seen announced here in the fediverse yet, but version 0.6.0 of #sccache was just released:

https://github.com/mozilla/sccache/releases/tag/v0.6.0

sccache is a compilation-caching tool that can massively speed up your builds (and save power!) both locally and in CI. It supports both C/C++ and Rust and is very easy to use. If you're compiling a lot of stuff everyday you should definitely give it a try.

Release v0.6.0 · mozilla/sccache

What's Changed Major changes Add nvcc cubin,fatbin,optix-ir compilation mode support by @robertmaynard in #1872 Support nvc++ and msvc as nvcc host compilers by @robertmaynard in #1889 Add nvc and...

GitHub

@xuanwo 对于你的《为什么你该试试 Sccache?》一文,我有了一个疑惑:#sccache 是以文件为单位的,那会不会遇到 #GithubActionCacheService 的 rate limit 呢?

Magic #Nix Cache 的文档里提到,超过 #GHA Cache limit 时会遇到429错误。你的博文里也提到,旧的 #rust cache 粒度更粗,不用担心 #Github action cache limit.

ref:
https://xuanwo.io/reports/2023-04/
https://github.com/DeterminateSystems/magic-nix-cache-action/

2023-04: 为什么你该试试 Sccache?

An infrastructure engineer, focused on distributed storage system