lix/src/libstore
Eelco Dolstra bbe97dff8b Make the Store API more type-safe
Most functions now take a StorePath argument rather than a Path (which
is just an alias for std::string). The StorePath constructor ensures
that the path is syntactically correct (i.e. it looks like
<store-dir>/<base32-hash>-<name>). Similarly, functions like
buildPaths() now take a StorePathWithOutputs, rather than abusing Path
by adding a '!<outputs>' suffix.

Note that the StorePath type is implemented in Rust. This involves
some hackery to allow Rust values to be used directly in C++, via a
helper type whose destructor calls the Rust type's drop()
function. The main issue is the dynamic nature of C++ move semantics:
after we have moved a Rust value, we should not call the drop function
on the original value. So when we move a value, we set the original
value to bitwise zero, and the destructor only calls drop() if the
value is not bitwise zero. This should be sufficient for most types.

Also lots of minor cleanups to the C++ API to make it more modern
(e.g. using std::optional and std::string_view in some places).
2019-12-10 22:06:05 +01:00
..
builtins Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
binary-cache-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
binary-cache-store.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
build.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
builtins.hh Make <nix/unpack-channel.nix> a builtin builder 2019-11-26 22:07:28 +01:00
crypto.cc binary-cache-public-keys -> trusted-public-keys 2017-11-20 17:32:34 +01:00
crypto.hh Revert "Get rid of unicode quotes (#1140)" 2016-11-26 00:38:01 +01:00
daemon.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
daemon.hh Recursive Nix support 2019-11-06 00:52:38 +01:00
derivations.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
derivations.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
download.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
download.hh Remove #include 2019-11-07 10:12:35 +01:00
export-import.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
fs-accessor.hh Shut up some warnings 2019-09-22 21:57:05 +02:00
gc.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
globals.cc Merge remote-tracking branch 'origin/recursive-nix' 2019-12-02 12:34:46 +01:00
globals.hh Fix typos 2019-11-30 19:04:14 -05:00
http-binary-cache-store.cc Add some noexcepts 2019-09-03 13:45:35 +02:00
legacy-ssh-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
local-binary-cache-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
local-fs-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
local-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
local-store.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
local.mk Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
machines.cc getMachines(): Cache result 2019-04-01 21:09:35 +02:00
machines.hh Replace $NIX_REMOTE_SYSTEMS with an option "builder-files" 2017-05-02 15:46:09 +02:00
misc.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
nar-accessor.cc Provide random access to cached NARs 2017-12-07 01:07:07 +01:00
nar-accessor.hh Fix build on gcc 7 2017-12-16 00:49:31 +01:00
nar-info-disk-cache.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
nar-info-disk-cache.hh Fix clang warnings 2019-11-26 21:07:44 +01:00
nar-info.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
nar-info.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
nix-store.pc.in pkg-config files: Use c++17 2019-03-14 14:11:12 +01:00
optimise-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
parsed-derivations.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
parsed-derivations.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
path.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
path.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
pathlocks.cc pathlocks: add include to fcntl.h for O_CLOEXEC 2019-08-07 07:41:22 -05:00
pathlocks.hh Use BSD instead of POSIX file locks 2019-08-02 18:39:16 +02:00
profiles.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
profiles.hh this updates issues that were addressed by people in pr 2018-03-01 21:47:57 -05:00
references.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
references.hh Allow content-addressable paths to have references 2019-10-21 17:47:24 +02:00
remote-fs-accessor.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
remote-fs-accessor.hh Provide random access to cached NARs 2017-12-07 01:07:07 +01:00
remote-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
remote-store.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
s3-binary-cache-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
s3-binary-cache-store.hh Fix getS3Stats() 2016-10-06 17:00:52 +02:00
s3.hh s3: make scheme configurable 2018-12-07 23:55:38 +01:00
sandbox-defaults.sb Remove extraneous comment 2017-11-08 16:17:32 +01:00
sandbox-minimal.sb Always use the Darwin sandbox 2017-06-06 18:44:49 +02:00
sandbox-network.sb OS X sandbox: Improve builtin sandbox profile 2017-05-31 17:25:51 +02:00
schema.sql
serve-protocol.hh Make adding paths via nix-store --serve run in constant memory 2018-08-03 21:21:16 +02:00
sqlite.cc Use extended SQLite error codes 2018-05-30 13:25:03 +02:00
sqlite.hh Use boost::format from the boost package 2018-03-14 19:24:04 +01:00
ssh-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
ssh.cc getEnv(): Return std::optional 2019-11-22 16:18:13 +01:00
ssh.hh SSHMaster: Bypass SSH when connecting to localhost 2018-08-03 21:20:38 +02:00
store-api.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
store-api.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
worker-protocol.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00