aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-03-02Merge branch 'master' into paths-from-stdinThéophane Hufschmitt
2023-03-02Merge pull request #7940 from tweag/fix-http-errors-encodingEelco Dolstra
Log the decompressed body in case of http errors
2023-03-02Get rid of some unchecked calls to std::coutEelco Dolstra
2023-03-02Log the decompressed body in case of http errorsThéophane Hufschmitt
Don't show the users the raw (possibly compressed) error message as everyone isn't able to decompress brotli in their brain.
2023-03-02Logger::cout: Use fmt()Eelco Dolstra
This ensures that in cout(s), 's' does not get interpreted as a format string.
2023-03-02nix store cat: Use writeFull()Eelco Dolstra
Fixes #7939.
2023-03-02Logger::writeToStdout(): Use writeFull()Eelco Dolstra
This ensures that write errors do not get ignored.
2023-03-02Merge pull request #7924 from mkenigs/validEelco Dolstra
Always set valid in path-info --json output
2023-03-01Merge pull request #7932 from obsidiansystems/remove-sameMachineThéophane Hufschmitt
Remove dead code `RemoteStore::sameMachine`
2023-03-01Merge pull request #7854 from aameen-tulip/patch-1Valentin Gagarin
2023-03-01Remove dead code `RemoteStore::sameMachine`John Ericson
It has been dead code since 9747ea84b43c75f719d719673b9d0a7cb50d34e5.
2023-03-01Merge pull request #7788 from ↵Valentin Gagarin
bobvanderlinden/pr-improve-nix-profile-install-error Improve error on conflict for nix profile install
2023-03-01nix-profile: add FIXME about using C++20 std::rangesBob van der Linden
2023-02-28Always set valid in path-info --json outputMatthew Kenigsberg
Currently the valid key is only present when the path is invalid, which makes checking path validity more complex than it should be. With this change, the valid key can always be used to check if a path is valid
2023-02-28Get rid of `.drv` special-casing for store path installablesJohn Ericson
The release notes document the change in behavior, I don't include it here so there is no risk to it getting out of sync. > Motivation >> Plumbing CLI should be simple Store derivation installations are intended as "plumbing": very simple utilities for advanced users and scripts, and not what regular users interact with. (Similarly, regular Git users will use branch and tag names not explicit hashes for most things.) The plumbing CLI should prize simplicity over convenience; that is its raison d'etre. If the user provides a path, we should treat it the same way not caring what sort of path it is. >> Scripting This is especially important for the scripting use-case. when arbitrary paths are sent to e.g. `nix copy` and the script author wants consistent behavior regardless of what those store paths are. Otherwise the script author needs to be careful to filter out `.drv` ones, and then run `nix copy` again with those paths and `--derivation`. That is not good! >> Surprisingly low impact Only two lines in the tests need changing, showing that the impact of this is pretty light. Many command, like `nix log` will continue to work with just the derivation passed as before. This because we used to: - Special case the drv path and replace it with it's outputs (what this gets rid of). - Turn those output path *back* into the original drv path. Now we just skip that entire round trip! > Context Issue #7261 lays out a broader vision for getting rid of `--derivation`, and has this as one of its dependencies. But we can do this with or without that. `Installable::toDerivations` is changed to handle the case of a `DerivedPath::Opaque` ending in `.drv`, which is new: it simply doesn't need to do any extra work in that case. On this basis, commands like `nix {show-derivation,log} /nix/store/...-foo.drv` still work as before, as described above. When testing older daemons, the post-build-hook will be run against the old CLI, so we need the old version of the post-build-hook to support that use-case. Co-authored-by: Travis A. Everett <travis.a.everett@gmail.com> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-02-28nix-store: read paths from standard inputTimothy DeHerrera
Resolves #7437 for new `nix-store` by adding a `--stdin` flag.
2023-02-28feat: read installable paths from stdinTimothy DeHerrera
Resolves #7437 for new `nix` commands only by adding a `--stdin` flag. If paths are also passed on the cli they will be combined with the ones from standard input.
2023-02-28Merge pull request #7793 from layus/interrupt_downloadsEelco Dolstra
Check interrupts even when download stalled
2023-02-28Merge pull request #7904 from anatol/patch-1Eelco Dolstra
Example uses gitlab.com thus clarify the comment
2023-02-28nix-profile-install: show helpful error upon package conflictBob van der Linden
Whenever a file conflict happens during "nix profile install" an error is shown that was previously thrown inside builtins.buildEnv. We catch BuildProfileConflictError here so that we can provide the user with more useful instructions on what to do next. Most notably, we give the user concrete commands to use with all parameters already filled in. This avoids the need for the user to look up these commands in manual pages.
2023-02-28Merge pull request #7911 from edolstra/revert-7689Eelco Dolstra
Revert #7689
2023-02-27buildenv: throw BuildEnvFileConflictError with more contextBob van der Linden
At the moment an Error is thrown that only holds an error message regarding `nix-env` and `nix profile`. These tools make use of builtins.buildEnv, but buildEnv is also used in other places. These places are unrelated to Nix profiles, so the error shouldn't mention these tools. This generic error is now BuildEnvFileConflictError, which holds more contextual information about the files that were conflicting while building the environment.
2023-02-27Merge pull request #7776 from yorickvP/fix-path-escapes-7707Théophane Hufschmitt
Properly escape local paths into URLs in fetchTree
2023-02-27Merge pull request #7913 from fricklerhandwerk/masterEelco Dolstra
add information on the `build-hook` setting
2023-02-27add information on the `build-hook` settingValentin Gagarin
add a warning that you probably never want to change this.
2023-02-27fetchTree: convert fs path to url via ParsedURL::to_stringYorick van Pelt
2023-02-27url: make percentEncode stricter, expose and unit test itYorick van Pelt
2023-02-27Revert "getDefaultNixPath: actually respect `{restrict,pure}-eval`"Eelco Dolstra
This reverts commit 1cba5984a68a489c4a56691032e4c87991c678f4.
2023-02-27Revert "Document default `nix-path` value"Eelco Dolstra
This reverts commit dba9173a1d8cb1dd40e5922d009cb3a434e081c3.
2023-02-27Merge pull request #7796 from hercules-ci/fix-7263Théophane Hufschmitt
Ensure that `self.outPath == ./.`
2023-02-24Example uses gitlab.com thus clarify the commentAnatol Pomozov
2023-02-22Merge pull request #7764 from yorickvP/build-remote-warningThéophane Hufschmitt
build-remote: don't warn when all local build slots are taken
2023-02-22flakes: Differentiate `self.outPath` and `self.sourceInfo.outPath`Robert Hensing
It would be incorrect to say that the `sourceInfo` has an `outPath` that isn't the root. `sourceInfo` is about the root, whereas only the flake may not be about the root. Thanks Eelco for pointing that out.
2023-02-22flakes: Ensure that `self.outPath == ./.`Robert Hensing
Users expect `self` to refer to the directory where the `flake.nix` file resides.
2023-02-21Merge pull request #7874 from obsidiansystems/fix-no-gc-buildThéophane Hufschmitt
Fix the build without GC
2023-02-21Merge pull request #7755 from obsidiansystems/mix-read-only-modeThéophane Hufschmitt
Make `--read-only` a separate mixin
2023-02-21Fix the build without GCJohn Ericson
I had given it an improper trailing comma in 1bd03ad100e8813751b6c08b0c21ae8cf5a9c21d.
2023-02-21Merge pull request #7856 from yorickvP/fix-nsswitchThéophane Hufschmitt
Wait with making /etc unwritable until after build env setup
2023-02-20`Derivation::toJSON`: fix bug!John Ericson
When I moved this code from the binary to libnixstore #7863, I forgot to display the environment variables!
2023-02-20Merge pull request #7863 from obsidiansystems/test-derivation-to-jsonRobert Hensing
Move Derivation JSON printing logic to lib and test it
2023-02-20Make `--read-only` a separate mixinJohn Ericson
It is independent of SourceExprCommand, which is about parsing installables, except for the fact that parsing installables is one of the many things influenced by read-only mode.
2023-02-20Split out `CmdRepl` and `editorFor`John Ericson
The REPL itself and the `nix repl` CLI are conceptually different things, and thus deserve to be in different files.
2023-02-20Slight cleanup of `InstallablesCommand::load`John Ericson
2023-02-20Split out `InstallableFlake` and `InstallableAttrPath`John Ericson
2023-02-19Merge pull request #7158 from sternenseemann/foldl-strict-accumulation-valueValentin Gagarin
2023-02-19Test `toJSON` of `DerivationOutput` and `Derivation`John Ericson
2023-02-19Move `Derivation` toJSON logic to libnixstoreJohn Ericson
2023-02-17Wait with making /etc unwritable until after build env setupYorick van Pelt
This fixes /etc/nsswitch.conf
2023-02-16Document `hasAllInfo`aameen-tulip
If this documentation is inaccurate in any way please do not hesitate to suggest corrections. My understanding of this function is strictly from reading the source code and some limited experience implementing fetchers.
2023-02-16Merge pull request #7811 from Et7f3/fix_memory_leaksRobert Hensing
Reduce memory leaks