lix/src/libstore
John Ericson cb5052d98f Revert "Revert "Use template structs instead of phantoms""
This is the more typically way to do [Argument-dependent
lookup](https://en.cppreference.com/w/cpp/language/adl)-leveraging
generic serializers in C++. It makes the relationship between the `read`
and `write` methods more clear and rigorous, and also looks more
familiar to users coming from other languages that do not have C++'s
libertine ad-hoc overloading.

I am returning to this because during the review in
https://github.com/NixOS/nix/pull/6223, it came up as something that
would make the code easier to read --- easier today hopefully already,
but definitely easier if we were have multiple codified protocols with
code sharing between them as that PR seeks to accomplish.

If I recall correctly, the main criticism of this the first time around
(in 2020) was that having to specify the type when writing, e.g.
`WorkerProto<MyType>::write`, was too verbose and cumbersome. This is
now addressed with the `workerProtoWrite` wrapper function.

This method is also the way `nlohmann::json`, which we have used for a
number of years now, does its serializers, for what its worth.

This reverts commit 45a0ed82f0. That
commit in turn reverted 9ab07e99f5.
2023-05-17 22:44:47 -04:00
..
build Revert "Revert "Use template structs instead of phantoms"" 2023-05-17 22:44:47 -04:00
builtins Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
tests Merge pull request #8340 from NixOS/delete-commited-build-artifacts 2023-05-15 17:30:20 +02:00
binary-cache-store.cc Explain various .self = false, 2023-04-17 09:15:11 -04:00
binary-cache-store.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
build-result.hh Introduce SingleDrvOutputs 2023-04-15 12:51:19 -04:00
builtins.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
ca-specific-schema.sql ca: add sqlite index on RealisationsRefs(realisationReference) 2022-04-21 10:06:39 +02:00
content-address.cc Improve error message for self reference with text hashing 2023-05-09 14:44:08 -04:00
content-address.hh Improve error message for self reference with text hashing 2023-05-09 14:44:08 -04:00
crypto.cc Make sodium a required dependency 2021-01-06 17:56:53 +01:00
crypto.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
daemon.cc Revert "Revert "Use template structs instead of phantoms"" 2023-05-17 22:44:47 -04:00
daemon.hh Add Store::isTrustedClient() 2023-04-06 19:59:57 -04:00
derivations.cc Revert "Revert "Use template structs instead of phantoms"" 2023-05-17 22:44:47 -04:00
derivations.hh Remove references from fixed output derivation ab syntax 2023-04-19 15:00:04 -04:00
derived-path.cc Legacy vs non-legacy to_string/parse for DerivedPath 2023-04-14 20:45:11 -04:00
derived-path.hh Legacy vs non-legacy to_string/parse for DerivedPath 2023-04-14 20:45:11 -04:00
dummy-store.cc Push getFSAccessor unsupported(...) down Store class hierarchy 2023-04-13 13:39:44 -04:00
dummy-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
export-import.cc Revert "Revert "Use template structs instead of phantoms"" 2023-05-17 22:44:47 -04:00
filetransfer.cc Allow open switch-enum in 5 places 2023-04-03 18:45:20 +02:00
filetransfer.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
fs-accessor.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
gc-store.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
gc.cc Make findRuntimeRoots() more resilient to disappearing processes 2023-03-09 16:44:51 +01:00
globals.cc removes MaxSubstitutionJobsSetting 2023-05-08 19:21:57 +01:00
globals.hh Merge pull request #8141 from tweag/user-files-doc 2023-05-15 07:11:47 -04:00
http-binary-cache-store.cc Add Store::isTrustedClient() 2023-04-06 19:59:57 -04:00
http-binary-cache-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
legacy-ssh-store.cc Revert "Revert "Use template structs instead of phantoms"" 2023-05-17 22:44:47 -04:00
legacy-ssh-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
local-binary-cache-store.cc Add Store::isTrustedClient() 2023-04-06 19:59:57 -04:00
local-binary-cache-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
local-fs-store.cc getBuildLog: factor out resolving derivations 2022-12-15 15:58:54 -05:00
local-fs-store.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
local-store.cc Explain various .self = false, 2023-04-17 09:15:11 -04:00
local-store.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
local-store.md Tweaks 2023-03-23 15:32:59 +01:00
local.mk Dedup some markdown -> C++ big literal stuff in build system 2023-05-15 10:38:11 -04:00
lock.cc Move enabled experimental feature to libutil struct 2023-03-20 11:05:22 -04:00
lock.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
log-store.cc Move the getBuildLog implementation to its own implementation file 2023-01-13 11:05:44 +01:00
log-store.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
machines.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
machines.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
make-content-addressed.cc No inheritance for TextInfo and FixedOutputInfo 2023-02-28 12:14:11 -05:00
make-content-addressed.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
misc.cc Rename a few things in new tests 2023-05-08 08:01:58 -04:00
names.cc return string_views from forceString* 2022-01-27 17:15:43 +01:00
names.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
nar-accessor.cc Add explicit case statements where -Wswitch-enum would report them 2023-04-03 18:17:32 +02:00
nar-accessor.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
nar-info-disk-cache.cc Use "raw pattern" for content address types 2023-03-30 17:12:49 -04:00
nar-info-disk-cache.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
nar-info.cc Make "NAR info file is corrupt" messages more informative 2023-04-18 14:10:49 +02:00
nar-info.hh Merge remote-tracking branch 'upstream/master' into path-info 2023-04-07 20:39:04 -04:00
nix-store.pc.in Fix building with GCC 9 2023-02-10 18:38:57 +01:00
optimise-store.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
outputs-spec.cc Test store paths, with property tests 2023-01-23 07:05:50 -05:00
outputs-spec.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
parsed-derivations.cc Merge pull request #3600 from NixOS/auto-uid-allocation 2022-11-29 14:01:42 +01:00
parsed-derivations.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
path-info.cc Revert "Revert "Use template structs instead of phantoms"" 2023-05-17 22:44:47 -04:00
path-info.hh Merge remote-tracking branch 'upstream/master' into path-info 2023-04-07 20:39:04 -04:00
path-regex.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
path-with-outputs.cc Merge pull request #6815 from obsidiansystems/better-wanted-outputs 2023-01-13 16:03:12 +01:00
path-with-outputs.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
path.cc Test store paths, with property tests 2023-01-23 07:05:50 -05:00
path.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
pathlocks.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
pathlocks.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
profiles.cc Factor out the generation of the profile/channel directory 2023-03-23 10:22:42 +01:00
profiles.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
realisation.cc libstore: also pass unwanted outputs to the post-build-hook 2023-05-08 12:58:59 +02:00
realisation.hh libstore: also pass unwanted outputs to the post-build-hook 2023-05-08 12:58:59 +02:00
references.cc Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
references.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
remote-fs-accessor.cc Replace src/libutil/json.cc with nlohmann json generation 2022-11-16 16:50:50 +01:00
remote-fs-accessor.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
remote-store.cc Revert "Revert "Use template structs instead of phantoms"" 2023-05-17 22:44:47 -04:00
remote-store.hh Merge remote-tracking branch 'upstream/master' into ca-drv-exotic 2023-04-17 18:10:12 -04:00
repair-flag.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
s3-binary-cache-store.cc Add Store::isTrustedClient() 2023-04-06 19:59:57 -04:00
s3-binary-cache-store.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
s3-binary-cache-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
s3.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
schema.sql schema.sql: add comment about hash being in base16 2022-06-01 14:59:57 +02:00
serve-protocol.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
sqlite.cc Move warning timing logic into handleSQLiteBusy. 2023-04-11 16:14:16 +01:00
sqlite.hh Move warning timing logic into handleSQLiteBusy. 2023-04-11 16:14:16 +01:00
ssh-store-config.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
ssh-store.cc Fix SSHStore 2023-03-23 09:35:35 +01:00
ssh-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
ssh.cc Fix ControlMaster behaviour 2023-05-16 18:50:09 +04:00
ssh.hh Fix ControlMaster behaviour 2023-05-16 18:50:09 +04:00
store-api.cc Merge remote-tracking branch 'upstream/master' into path-info 2023-04-07 20:39:04 -04:00
store-api.hh Remove references from fixed output derivation ab syntax 2023-04-19 15:00:04 -04:00
store-cast.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
uds-remote-store.cc Register LocalStore to ensure it's included in the manual 2023-03-23 15:23:13 +01:00
uds-remote-store.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
uds-remote-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
worker-protocol.cc Revert "Revert "Use template structs instead of phantoms"" 2023-05-17 22:44:47 -04:00
worker-protocol.hh Revert "Revert "Use template structs instead of phantoms"" 2023-05-17 22:44:47 -04:00