Repository navigation
fix nix run eval cache - #9
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| { | ||
| virtual ~Installable() {} | ||
|
|
||
| virtual void releaseEvalCache() {} |
There was a problem hiding this comment.
🟡 New shared interface method added without documentation in header
The newly added shared method for dropping an installable's cached evaluation data (virtual void releaseEvalCache() {} at src/libcmd/include/nix/cmd/installables.hh:133) carries no explanatory comment, unlike every other method in the same interface, so future implementers have no stated contract about when it must be called or what remains valid afterwards.
Impact: Contributors extending or overriding this interface can misuse it, since nothing states that it must only be used right before the process is replaced.
Undocumented virtual API on the Installable base class
CONTRIBUTING.md lists "API documentation in header files" as a requirement for changes. All neighbouring virtual members in src/libcmd/include/nix/cmd/installables.hh (e.g. what() at lines 133-142, toDerivedPaths() at 143-150) have doc comments. The override declaration in src/libcmd/include/nix/cmd/installable-flake.hh:63 is likewise undocumented. The semantics are subtle: after calling it, openEvalCache() (src/libcmd/installable-flake.cc:330-336) will silently rebuild a fresh cache, so callers must not use the installable afterwards for evaluation if the goal is to flush the SQLite transaction before exec.
| virtual void releaseEvalCache() {} | |
| /** | |
| * Drop this installable's reference to any evaluation cache it | |
| * holds, so that the cache can be destroyed (and thus flushed to | |
| * disk) before we `exec()` out of this process without running | |
| * C++ destructors. After this call the installable should not be | |
| * used for further evaluation. | |
| */ | |
| virtual void releaseEvalCache() {} |
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Agreed, CONTRIBUTING.md requires it. Documented on the base declaration, including the constraint that the installable must not be used for evaluation afterwards (openEvalCache() would silently rebuild a fresh cache). Amended into the same commit — this PR is deliberately a single commit.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
589f7da to
9dd8691
Compare
fix nix run eval cache
Link to Devin session: https://app.devin.ai/sessions/36cf0993f74446ecab9a95becd1c5ee0
Requested by: @ryanjwong