Age | Commit message (Collapse) | Author |
|
Also use std::string_view in a few more places.
|
|
|
|
|
|
Just doing a very stupid thing taking as argument a serialised drv
output and returning a serialised realisation.
This is needed for `nix-serve` to handle ca derivations
|
|
|
|
Previously, the build system used uname(1) output when it wanted to
check the operating system it was being built for, which meant that it
didn't take into-account cross-compilation when the build and host
operating systems were different.
To fix this, instead of consulting uname output, we consult the host
triple, specifically the third "kernel" part.
For "kernel"s with stable ABIs, like Linux or Cygwin, we can use a
simple ifeq to test whether we're compiling for that system, but for
other platforms, like Darwin, FreeBSD, or Solaris, we have to use a
more complicated check to take into account the version numbers at the
end of the "kernel"s. I couldn't find a way to just strip these
version numbers in GNU Make without shelling out, which would be even
more ugly IMO. Because these checks differ between kernels, and the
patsubst ones are quite fiddly, I've added variables for each host OS
we might want to check to make them easier to reuse.
|
|
|
|
|
|
This isn't used anywhere except in the configure script of the Perl
bindings. I've changed the latter to use the C++ API's Settings object
at runtime.
|
|
|
|
derivation-header-include-order
|
|
|
|
Offer a safer interface for path and pathOpt
|
|
Path is null when not known statically.
|
|
|
|
new-interface-for-path-pathOpt
|
|
derivation-header-include-order
|
|
new-interface-for-path-pathOpt
|
|
|
|
better-ca-parse-errors
|
|
|
|
optional-derivation-output-storepath
|
|
better-ca-parse-errors
|
|
derivation-header-include-order
|
|
|
|
This is only used by hydra-queue-runner and it's better to implement
it there.
|
|
|
|
we don’t need a full storepath for a fixedoutput derivation. So just
putting the ingestion method + the hash is sufficient.
|
|
|
|
|
|
|
|
|
|
This will make it easier to reason about the hash encoding and switch to
SRI everywhere where possible.
|
|
|
|
|
|
|
|
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).
|
|
|
|
|
|
This reverts commit 717e821b99797845e1bef47d862f8cb0fb69cfc9. It's
much more convenient to do 'make OPTIMIZE=0'.
|
|
As is normal for autoconf-based projects.
For example, it is a common use case to do
./configure CXXFLAGS=-O0
This did not work for nix until now, because the `CXXFLAGS=` declaration
would unconditionally erase what the user had specified.
The custom `OPTIMIZE` flag is removed, but the default `-O3` is retained;
autoconf would default to `-g -O2` by default otherwise as documented on:
https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C-Compiler.html
https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C_002b_002b-Compiler.html
|
|
|
|
Allow global config settings to be defined in multiple Config
classes. For example, this means that libutil can have settings and
evaluator settings can be moved out of libstore. The Config classes
are registered in a new GlobalConfig class to which config files
etc. are applied.
Relevant to https://github.com/NixOS/nix/issues/2009 in that it
removes the need for ad hoc handling of useCaseHack, which was the
underlying cause of that issue.
|
|
|
|
Relevant RFC: NixOS/rfcs#4
$ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
|
|
Also simplify the Hash API.
Fixes #1437.
|
|
|
|
|
|
|
|
This makes all config options self-documenting.
Unknown or unparseable config settings and --option flags now cause a
warning.
|