GRI-1906: invalidate dummy-build cargo cache for shared/client in server Dockerfile #121
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!121
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-1906-docker-shared-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The server image's dependency-warming trick in
packaging/server/Dockerfilecompiled
sharedandclientagainst a stub (touch-only)lib.rsin thefirst
RUN, then deleted only the dummy sources andserver's ownbinary/deps before
COPYing in the real sources. Cargo's mtime-basedfingerprint for
shared/clientsurvived into the final build, so it linkedthe stub instead of recompiling against the real code — currently a hard
failure (the real
sharedhas modules the stub never had), and a silentstale-logic risk once that stops being true.
Fix:
cargo clean --release -p shared -p clientright after the dummy build,before the dummy sources are deleted (it needs the still-present manifest to
resolve what
-p sharedeven means). This forces the finalRUN cargo buildto recompile
shared/clientfrom the real, just-COPY'd source, whilestill reusing the warmed external-dependency cache for everything else.
Test plan
No Docker access on this account (
docker.sockisroot:docker, no sudo).Reproduced the exact
RUNsequence outside Docker instead, in a scratchworkspace mirroring the builder stage's file layout:
lib.rs) succeeds, compilingsharedfrom the stubcargo clean --release -p shared -p client, then delete dummysrc/crates/sharedandcrates/serversourcescargo build --release --locked -p serverprintsCompiling shared v0.1.0andCompiling server v0.1.0(not justserver), andsucceeds — confirming
sharedis recompiled against the real sourceinstead of linking the stub