mirror of
https://github.com/NixOS/nix.git
synced 2025-11-21 09:49:36 +01:00
libstore: Call canonPath for constructing LocalFSStoreConfig::rootDir
This mirrors what OptionalPathSetting does. Otherwise we run into an assertion failure for relative paths specified as the authority + path: nix build nixpkgs#hello --store "local://a/b" nix: ../posix-source-accessor.cc:13: nix::PosixSourceAccessor::PosixSourceAccessor(std::filesystem::__cxx11::path&&): Assertion `root.empty() || root.is_absolute()' failed. This is now diagnosed properly: error: not an absolute path: 'a/b' Just as you'd specify the root via a query parameter: nix build nixpkgs#hello --store "local?root=a/b"
This commit is contained in:
parent
7817239644
commit
3a64d3c0da
1 changed files with 1 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ LocalFSStoreConfig::LocalFSStoreConfig(PathView rootDir, const Params & params)
|
|||
// FIXME don't duplicate description once we don't have root setting
|
||||
, rootDir{
|
||||
this,
|
||||
!rootDir.empty() && params.count("root") == 0 ? (std::optional<Path>{rootDir}) : std::nullopt,
|
||||
!rootDir.empty() && params.count("root") == 0 ? (std::optional{canonPath(rootDir)}) : std::nullopt,
|
||||
"root",
|
||||
"Directory prefixed to all other paths."}
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue