Remote cache keys always include the OS and architecture, so a task whose outputs are the same on every platform can't share entries between macOS and Linux
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust, wasm
- Lĩnh vực
- build-system, cli, devtools
Hướng nghiên cứu
Start with encode_header and decode_key in crates/vt/src/session/cache/remote.rs (around lines 395-423), which build the OS and ARCH header that every remote key carries. Then read EnabledCacheConfig in crates/vt_graph/src/config/user.rs (around lines 246-256) to see where a per-task remote setting would go. Done means a task with the setting gets keys with empty os and arch, while its fallback decoding and the local cache keep working. The issue also depends on the unreleased remote cache work in #820 and on the open design of keys in #778 and #717, so check those before starting.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Written by an AI agent (Claude) on behalf of @jasonkuhrt.
Remote caching is still unreleased (#820), and cache.remote is hidden from the public types until then (crates/vt_graph/src/config/user.rs:254-256 at a3c087a7, the revision Vite+ 1.4.0 pins). So this is a request for its shape while that can still change.
What happens
Every remote key starts with a header holding the cache schema version, std::env::consts::OS and std::env::consts::ARCH (crates/vt/src/session/cache/remote.rs:395-416). The module doc says: "Platforms share an endpoint's namespace, but their keys differ" (remote.rs:12-14).
So an entry that Linux CI stored is never fetched on a developer's Mac, even for a task whose outputs are the same everywhere, such as a code generator that runs on Node. No task can opt out.
The case that motivates it
Our CI runs on Linux and our developers use macOS. To share entries anyway, our server rewrites each key's header to a platform-free one on every fetch and store. That depends on the key's private encoding (wincode's layout of KeyHeader), and it treats every task as platform-independent, which is wrong for any task that isn't.
The ask
A remote setting on a task that shares its entries across platforms:
tasks: {
generate: {
command: 'node generate.ts',
cache: { remote: { crossPlatform: true } },
},
}
remote takes true, false or an object, and true means {}.
What it means in each case:
- Its remote keys (
keyandsecondary_key) carry a header with emptyosandarchstrings. No platform Vite Task runs on has an empty name, so these keys can't equal any platform's. The schema version stays. - Decoding: a fallback match's key is decoded with the same header (
decode_key,remote.rs:418-423), so a fallback's miss reason still works. - The local cache is unaffected.
- A fetched entry is validated against the fetching machine's inputs, as every entry is.
- The rest of the key still has to match: the program, the arguments, the working directory, the environment, and the input and output globs. A task whose arguments hold absolute paths still won't share (#717).
- A task wrongly marked: if what makes its output platform-specific is something Vite Task tracks, such as a native binary read from the workspace, its entries never validate on the other platform. With one entry per key (#778), each platform's store also replaces the other's, so it hits less than it does today. If nothing it tracks differs (it branches on
process.platform, or runs a system binary outside the workspace), its entries validate and restore the other platform's outputs, as with any input a task doesn't track. That's why it's an opt-in declaration per task. - Turning it on or off changes the task's remote keys once.
- Default: off, so today's keys are unchanged.
Where it goes: encode_header (remote.rs:403-409) and decode_key take the task's setting, which lives in remote on EnabledCacheConfig (user.rs:246-256).
Alternatives considered
- Rewrite the header on the server, as we do today: it depends on a private encoding, and it applies to every task at once.
- A workspace-wide setting: that's too coarse, since a workspace usually has both kinds of task.
- Ngôn ngữ chính
- Rust
- Star
- 485
- Fork
- 51
- Merge trung bình
- 23 giờ 20 phút
- Pull request đã merge (30 ngày)
- 56
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của voidzero-dev/vite-task
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
voidzero-dev/vite-task#938 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
voidzero-dev/vite-task#936 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fspy linux backend
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 6/100
voidzero-dev/vite-task#932 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
remote cache
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
voidzero-dev/vite-task#931 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
☂️ Release remote cachingĐang mởremote cache
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 5/100
voidzero-dev/vite-task#930 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của voidzero-dev/vite-task
Issue tương tự
-
auto:producer auto:security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
fritzprix/libr-agent#2595 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:fs type:fix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Tripstack-Corp/spyc#1002 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
github_actions security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
dekobon/big-code-analysis#1815 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Detail Bug] Request logs can be forged via control characters in fetch object keys (log injection)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
s2-streamstore/cachey#211 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày