mirror of
https://github.com/NixOS/nix.git
synced 2025-12-24 09:50:55 +01:00
Fix subflake handling
Relative 'path:' flake inputs now use the containing flake's InputAccessor. This has the following implications: * They're no longer locked in the lock file. * They don't cause an additional copy to the store. * They can reference the containing directory (i.e. a subflake can have an input '../foo', so long as it doesn't go outside the top-level containing flake). Note: this is not a complete fix for subflake handling, since the lock file currently makes it ambiguous what the containing flake is. We'll probably need to add another field to the lock file for that. Fixes #6352.
This commit is contained in:
parent
6ab3b86cf5
commit
8a0a55fe12
6 changed files with 69 additions and 43 deletions
|
|
@ -63,6 +63,8 @@ public:
|
|||
one that contains a commit hash or content hash. */
|
||||
bool isLocked() const { return locked; }
|
||||
|
||||
bool isRelative() const;
|
||||
|
||||
bool hasAllInfo() const;
|
||||
|
||||
bool operator ==(const Input & other) const;
|
||||
|
|
@ -151,6 +153,9 @@ struct InputScheme
|
|||
{
|
||||
throw UnimplementedError("getAccessor");
|
||||
}
|
||||
|
||||
virtual bool isRelative(const Input & input) const
|
||||
{ return false; }
|
||||
};
|
||||
|
||||
void registerInputScheme(std::shared_ptr<InputScheme> && fetcher);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue