diff --git a/lix/legacy/nix-instantiate.cc b/lix/legacy/nix-instantiate.cc index 201de62e4..6127ce27b 100644 --- a/lix/legacy/nix-instantiate.cc +++ b/lix/legacy/nix-instantiate.cc @@ -168,10 +168,7 @@ static int main_nix_instantiate(std::string programName, Strings argv) if (findFile) { for (auto & i : files) { auto p = evaluator->paths.findFile(i); - if (auto fn = p.getPhysicalPath()) - std::cout << fn->abs() << std::endl; - else - throw Error("'%s' has no physical path", p); + std::cout << p.path.abs() << std::endl; } return 0; } diff --git a/lix/libcmd/editor-for.cc b/lix/libcmd/editor-for.cc index fc0f13b45..5eecd27d2 100644 --- a/lix/libcmd/editor-for.cc +++ b/lix/libcmd/editor-for.cc @@ -7,9 +7,6 @@ namespace nix { Strings editorFor(const SourcePath & file, uint32_t line) { - auto path = file.getPhysicalPath(); - if (!path) - throw Error("cannot open '%s' in an editor because it has no physical path", file); auto editor = getEnv("EDITOR").value_or("cat"); auto args = tokenizeString(editor); if (line > 0 && ( @@ -18,7 +15,7 @@ Strings editorFor(const SourcePath & file, uint32_t line) editor.find("vim") != std::string::npos || editor.find("kak") != std::string::npos)) args.push_back(fmt("+%d", line)); - args.push_back(path->abs()); + args.push_back(file.path.abs()); return args; } diff --git a/lix/libutil/source-path.hh b/lix/libutil/source-path.hh index f64fd641f..1c9868b08 100644 --- a/lix/libutil/source-path.hh +++ b/lix/libutil/source-path.hh @@ -103,13 +103,6 @@ struct SourcePath PathFilter & filter = defaultPathFilter) const { sink << nix::dumpPath(path.abs(), filter); } - /** - * Return the location of this path in the "real" filesystem, if - * it has a physical location. - */ - std::optional getPhysicalPath() const - { return path; } - std::string to_string() const { return path.abs(); }