Age | Commit message (Collapse) | Author |
|
|
|
|
|
Allow empty hash in derivations
|
|
|
|
This replaces the copy&paste with a helper function in hash.hh.
|
|
|
|
This function was used in only one place, where it could easily be
replaced by readDerivation() since it's not
performance-critical. (This function appears to have been modelled
after queryDerivationOutputs(), which exists only to make the garbage
collector faster.)
|
|
Add tests for pool.hh
|
|
Add an option to print the logs in a machine-readable format
|
|
|
|
|
|
|
|
|
|
libutils/hash: remove default encoding
|
|
WSL1 doesn’t support i686-linux emulation, see https://github.com/microsoft/wsl/issues/2468
|
|
fetchTarball, fetchTree, and fetchGit all have *optional* hash attrs.
This means that we need to be careful with what we allow to avoid
accidentally making these defaults. When ‘hash = ""’ we assume the
empty hash is wanted.
|
|
follow up of https://github.com/NixOS/nix/pull/3544
This allows hash="" so that it can be used for debugging purposes. For
instance, this gives you an error message like:
warning: found empty hash, assuming you wanted 'sha256:0000000000000000000000000000000000000000000000000000'
hash mismatch in fixed-output derivation '/nix/store/asx6qw1r1xk6iak6y6jph4n58h4hdmbm-nix':
wanted: sha256:0000000000000000000000000000000000000000000000000000
got: sha256:0fpfhipl9v1mfzw2ffmxiyyzqwlkvww22bh9wcy4qrfslb4jm429
|
|
Needed so that we can include it as a logger in loggers.cc without
adding a dependency on nix
This also requires moving names.hh to libutil to prevent a circular
dependency between libmain and libexpr
|
|
|
|
Make the printing of the build logs systematically go through the
logger, and replicate the behavior of `no-build-output` by having two
different loggers (one that prints the build logs and one that doesn't)
|
|
Add a new `--log-format` cli argument to change the format of the logs.
The possible values are
- raw (the default one for old-style commands)
- bar (the default one for new-style commands)
- bar-with-logs (equivalent to `--print-build-logs`)
- internal-json (the internal machine-readable json format)
|
|
Add error message when FileIngestionMethod is out of bounds
|
|
Alternative fix to #3661. The cause was that 'name' is a
std::string_view into a temporary which could get overwritten.
|
|
bool coerces anything >0 to true, but in the future we may have other
file ingestion methods. This shows a better error message when the
“recursive” byte isn’t 1.
|
|
|
|
Fixes #3648.
|
|
This will make it easier to reason about the hash encoding and switch to
SRI everywhere where possible.
|
|
This was a latent bug that just appeared because of the tests that were
added. Remember to wait for CI! :)
|
|
Remove `addToStore` variant as requested by `FIXME`
|
|
|
|
Co-authored-by: James Lee <jbit@jbit.net>
|
|
|
|
As `git fetch` may chose to interpret refspec to it's liking, ensure that we
only pass refs that begin with `refs/` as is, otherwise, prepend them with
`refs/heads`. Otherwise, branches named `heads/foo` (I know it's bad, but it's
allowed), would be fetched as `foo`, instead of `heads/foo`.
|
|
The previous regex was too strict and did not match what git was allowing. It
could lead to `fetchGit` not accepting valid branch names, even though they
exist in a repository (for example, branch names containing `/`, which are
pretty standard, like `release/1.0` branches).
The new regex defines what a branch name should **NOT** contain. It takes the
definitions from `refs.c` in https://github.com/git/git and `git help
check-ref-format` pages.
This change also introduces a test for ref name validity checking, which
compares the result from Nix with the result of `git check-ref-format --branch`.
|
|
The idea is it's always more flexible to consumer a `Source` than a
plain string, and it might even reduce memory consumption.
I also looked at `addToStoreFromDump` with its `// FIXME: remove?`, but
the worked needed for that is far more up for interpretation, so I
punted for now.
|
|
Add unit tests for config.cc
|
|
Replace some `bool recursive` with a new `FileIngestionMethod` enum
|
|
There was an enum there that matched in perfectly.
|
|
This is much less confusing since recursive is no longer a boolean.
|
|
This is a different recursive than used in makeFixedOutputPath.
|
|
Provides some general overview on the mechanics of Config/Setting and
comments for the public methods of Config.
|
|
|
|
This moves the actual parsing of configuration contents into applyConfig
which applyConfigFile is then going to call. By changing this we can now
test the configuration file parsing without actually create a file on
disk.
|
|
|
|
Add unit tests for "json.hh"
|
|
Add unit tests for xml-writer
|
|
|
|
|
|
|
|
|