-
Notifications
You must be signed in to change notification settings - Fork 0
source origins #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d87febd
599ccae
9cefde7
94175c2
99fb0a5
2941382
617c6cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -989,6 +989,10 @@ struct GitInputScheme : InputScheme | |
| ref<SourceAccessor> accessor = | ||
| repo->getAccessor(repoInfo.workdirInfo, {.exportIgnore = exportIgnore}, makeNotAllowedError(repoPath)); | ||
|
|
||
| // Record the git repo root as the original filesystem path so that | ||
| // source-origins can map store paths back to their original locations. | ||
| accessor->originalRootPath = repoPath; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 originalRootPath lost when git repo has submodules
Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| /* If the repo has submodules, return a mounted input accessor | ||
| consisting of the accessor for the top-level repo and the | ||
| accessors for the submodule workdirs. */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Strategy 3 heuristic silently maps unrelated store paths to wrong original path
In
recordPathOriginatsrc/libexpr/eval.cc:2658-2661, whensrcPath.path.isRoot()andsourceStoreToOriginalPathhas exactly one entry, the code unconditionally maps the newstorePathto that entry's original path without verifying any relationship between them. This means if there's one flake source mounted and any otherbuiltins.pathcall with a root source path, the resulting store path gets silently mapped to the flake's source directory. ThegetOriginalPath()query atsrc/libexpr/eval.cc:2683-2688then returns a wrong filesystem path, which propagates to thesourcePathfield in the command output.Was this helpful? React with 👍 or 👎 to provide feedback.