File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -426,7 +426,16 @@ struct GitInputScheme : InputScheme
426426 auto url = parseURL (getStrAttr (input.attrs , " url" ));
427427 bool isBareRepository = url.scheme == " file" && !pathExists (url.path + " /.git" );
428428 repoInfo.isLocal = url.scheme == " file" && !forceHttp && !isBareRepository;
429- repoInfo.url = repoInfo.isLocal ? url.path : url.to_string ();
429+ //
430+ // FIXME: here we turn a possibly relative path into an absolute path.
431+ // This allows relative git flake inputs to be resolved against the
432+ // **current working directory** (as in POSIX), which tends to work out
433+ // ok in the context of flakes, but is the wrong behavior,
434+ // as it should resolve against the flake.nix base directory instead.
435+ //
436+ // See: https://discourse.nixos.org/t/57783 and #9708
437+ //
438+ repoInfo.url = repoInfo.isLocal ? std::filesystem::absolute (url.path ).string () : url.to_string ();
430439
431440 // If this is a local directory and no ref or revision is
432441 // given, then allow the use of an unclean working tree.
You can’t perform that action at this time.
0 commit comments