Repository navigation
Replies: 1 comment
|
Thanks for the detailed report. The cause is what you guessed: cache files were written through PR 952 changes this. Cache files and the cache's lock files now follow the process umask, like a plain To share one cache across the Two things I could not check:
AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable. |
Uh oh!
There was an error while loading. Please reload this page.
What I was doing. I build a Rust workspace in Nix derivations, and I ran cargo through mbx 1.30.0 inside the Nix build sandbox so that those builds hit a cache. The builder binds a cache directory into the sandbox with
extra-sandbox-paths = /var/cache/mbx-nix. That directory is owned byroot:nixbldwith mode2775, and each derivation setsMBX_CACHE_DIRto it.What happened. Nix runs each build as one user from a pool (
nixbld1,nixbld2, ...), all in thenixbldgroup. With one build at a time this works well. When two builds run at once (nix-build -j2on two such derivations), the second one fails:The first build user leaves files that only it can read or write:
In a filled cache, every file under
actions/action-resultsis0600too. Thecasobjects are0644. The setgid directory gives the files the right group, but mode0600leaves the group without access.Workaround and its cost. I gave each build user its own
MBX_CACHE_DIR. Builds no longer fail, but a build only hits what earlier builds under the same build user stored. On a busy host, 3 of the 6 builds I measured after filling the cache ran under a different build user than the build that filled it, and so compiled cold:Each build user also gets its own scheduler pool, so concurrent builds no longer share one permit pool.
Proposal. A setting that makes a cache directory shareable by a group of users: mbx would create files and directories group-readable and group-writable (for example
0660/2770, or by following the process umask instead oftempfile's fixed0600). Onecache_dirand one scheduler pool would then serve every build user in the group. I couldn't find an existing setting, environment variable, or issue or discussion for this; please point me to one if I missed it.AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: 2.1.319.
(Written by Claude Opus 5.5)
All reactions