From dcaba9de64354fa699ee6b292efbedfb984582db Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Thu, 23 Jul 2020 12:35:52 -0400 Subject: feat(3p/nix): Add main function for grpc daemon Implement the main function for the new, proto-based nix daemon. This mostly replicates the behavior of the previous nix daemon - it starts a grpc server listening on the same nix socket path and supports the same set of options - with the exception of --stdio, which has been renamed to --pipe and documented in the man page. Change-Id: Ib729283c1d5d35c0e1b0a968bc1f052f5527f2d7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1356 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: kanepyork --- third_party/nix/src/libutil/util.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'third_party/nix/src/libutil') diff --git a/third_party/nix/src/libutil/util.cc b/third_party/nix/src/libutil/util.cc index f69c341c2c59..75a8e73eac77 100644 --- a/third_party/nix/src/libutil/util.cc +++ b/third_party/nix/src/libutil/util.cc @@ -167,6 +167,7 @@ Path canonPath(const Path& path, bool resolveSymlinks) { return s.empty() ? "/" : s; } +// TODO(grfn) remove in favor of std::filesystem::path::parent_path() Path dirOf(absl::string_view path) { Path::size_type pos = path.rfind('/'); if (pos == std::string::npos) { @@ -175,6 +176,7 @@ Path dirOf(absl::string_view path) { return pos == 0 ? "/" : Path(path, 0, pos); } +// TODO(grfn) remove in favor of std::filesystem::path::root_name() std::string baseNameOf(const Path& path) { if (path.empty()) { return ""; @@ -558,6 +560,7 @@ Path getDataDir() { return dataDir; } +// TODO(grfn): Remove in favor of std::filesystem::create_directories Paths createDirs(const Path& path) { Paths created; if (path == "/") { -- cgit 1.4.1