aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
AgeCommit message (Collapse)Author
2023-01-12Split `OutputsSpec::merge` into `OuputsSpec::{union_, isSubsetOf}`John Ericson
Additionally get rid of the evil time we made an empty `OutputSpec::Names()`.
2023-01-11Remove default constructor from `OutputsSpec`John Ericson
This forces us to be explicit. It also requires to rework how `from_json` works. A `JSON_IMPL` is added to assist with this.
2023-01-11Make it hard to construct an empty `OutputsSpec::Names`John Ericson
This should be a non-empty set, and so we don't want people doing this by accident. We remove the zero-0 constructor with a little inheritance trickery.
2023-01-11Simplify and document store path installable parsingJohn Ericson
2023-01-11Split `OutputsSpec` and `ExtendedOutputsSpec`, use the former moreJohn Ericson
`DerivedPath::Built` and `DerivationGoal` were previously using a regular set with the convention that the empty set means all outputs. But it is easy to forget about this rule when processing those sets. Using `OutputSpec` forces us to get it right.
2023-01-11Rename `OutputPath` -> `ExtendedOutputPath`John Ericson
Do this prior to making a new more limitted `OutputPath` we will use in more places.
2023-01-11Improve `OutputsSpec` slightlyJohn Ericson
A few little changes preparing for the rest.
2023-01-11Merge pull request #7543 from obsidiansystems/typed-string-contextThéophane Hufschmitt
Parse string context elements properly
2023-01-10Merge pull request #7541 from hercules-ci/check-manual-linksRobert Hensing
Check links in the manual
2023-01-10doc/manual: Introduce @docroot@ as a stable base for includable snippetsRobert Hensing
This way the links are clearly within the manual (ie not absolute paths), while allowing snippets to reference the documentation root reliably, regardless of at which base url they're included.
2023-01-10Make clear that `StorePathWithOutputs` is a deprecated typeJohn Ericson
- Add a comment - Put `OutputsSpec` in a different header (First part of #6815) - Make a few stray uses of it in new code use `DerivedPath` instead.
2023-01-10Clean up toDerivedPaths() logicEelco Dolstra
2023-01-10Apply suggestions from code reviewEelco Dolstra
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2023-01-10Show string in error messageEelco Dolstra
2023-01-10ExtraInfo -> ExtraPathInfoEelco Dolstra
2023-01-10Merge remote-tracking branch 'origin/master' into fix-7417Eelco Dolstra
2023-01-05Merge pull request #7539 from tweag/fix-nix-why-depends--derivationEelco Dolstra
Fix `nix why-depends --derivation`
2023-01-02Merge remote-tracking branch 'origin/master' into coerce-stringEelco Dolstra
2023-01-02Fix why-depends for CA derivations (again)Théophane Hufschmitt
This has the same goal as b13fd4c58e81b2b2b0d72caa5ce80de861622610,but achieves it in a different way in order to not break `nix why-depends --derivation`.
2022-12-21link "store derivation" to glossary definitionValentin Gagarin
2022-12-20InstallableFlake::toDerivedPaths(): Support paths and store pathsEelco Dolstra
This makes 'nix build' work on paths (which will be copied to the store) and store paths (returned as is). E.g. the following flake output attributes can be built using 'nix build .#foo': foo = ./src; foo = self.outPath; foo = builtins.fetchTarball { ... }; foo = (builtins.fetchTree { .. }).outPath; foo = builtins.fetchTree { .. } + "/README.md"; foo = builtins.storePath /nix/store/...; Note that this is potentially risky, e.g. foo = /.; will cause Nix to try to copy the entire file system to the store. What doesn't work yet: foo = self; foo = builtins.fetchTree { .. }; because we don't handle attrsets with an outPath attribute in it yet, and foo = builtins.storePath /nix/store/.../README.md; since result symlinks have to point to a store path currently (rather than a file inside a store path). Fixes #7417.
2022-12-20Merge toDerivations() into toDerivedPaths()Eelco Dolstra
toDerivedPaths() now returns DerivedPathWithInfo, which is DerivedPath with some attributes needed by 'nix profile' etc. Preparation for #7417.
2022-12-20Merge pull request #7451 from edolstra/abstract-posEelco Dolstra
Introduce AbstractPos
2022-12-13Merge pull request #7455 from rapenne-s/documentation_fixEelco Dolstra
Add anchors and links to definition
2022-12-13Improve cast safetyEelco Dolstra
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-12-13documentation: link flake URL term to definitionSolène Rapenne
2022-12-13documentation: fix link to definitionSolène Rapenne
2022-12-13Introduce AbstractPosEelco Dolstra
This makes the position object used in exceptions abstract, with a method getSource() to get the source code of the file in which the error originated. This is needed for lazy trees because source files don't necessarily exist in the filesystem, and we don't want to make libutil depend on the InputAccessor type in libfetcher.
2022-12-12Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputsJohn Ericson
2022-12-12Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputsJohn Ericson
2022-12-12Add docs from the lazy-trees branchEelco Dolstra
2022-12-12Support flake references in the old CLIEelco Dolstra
Fixes #7026.
2022-12-12Move isUri() and resolveUri() out of filetransfer.ccEelco Dolstra
These are purely related to NIX_PATH / -I command line parsing, so put them in libexpr.
2022-12-12Merge branch 'master' into indexed-store-path-outputsJohn Ericson
2022-12-12-I description: Use -I examplesEelco Dolstra
2022-12-12Manual improvementsEelco Dolstra
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-11-29Merge pull request #3600 from NixOS/auto-uid-allocationEelco Dolstra
Automatic UID allocation
2022-11-28use logger->cout Naïm Favier
in order to avoid potential problems with the progress bar Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2022-11-28repl: print a newline on ctrl-DNaïm Favier
2022-11-25Merge branch 'master' into indexed-store-path-outputsJohn Ericson
2022-11-21nix build --json: Include build statisticsEelco Dolstra
Example: # nix build -L --extra-experimental-features cgroups --impure --expr 'with import <nixpkgs> {}; runCommand "foo" {} "dd if=/dev/urandom bs=1M count=1024 | md5sum; mkdir $out"' --json [ { "cpuSystem": 1.911431, "cpuUser": 1.214249, "drvPath": "/nix/store/xzdqz67xba18hljhycp0hwfigzrs2z69-foo.drv", "outputs": { "out": "/nix/store/rh9mc9l2gkpq8kn2sgzndr6ll7ffjh6l-foo" }, "startTime": 1669024076, "stopTime": 1669024079 } ]
2022-11-21Merge remote-tracking branch 'origin/master' into auto-uid-allocationEelco Dolstra
2022-11-21nix build --json: Include build statisticsEelco Dolstra
Example: # nix build -L --extra-experimental-features cgroups --impure --expr 'with import <nixpkgs> {}; runCommand "foo" {} "dd if=/dev/urandom bs=1M count=1024 | md5sum; mkdir $out"' --json [ { "cpuSystem": 1.911431, "cpuUser": 1.214249, "drvPath": "/nix/store/xzdqz67xba18hljhycp0hwfigzrs2z69-foo.drv", "outputs": { "out": "/nix/store/rh9mc9l2gkpq8kn2sgzndr6ll7ffjh6l-foo" }, "startTime": 1669024076, "stopTime": 1669024079 } ]
2022-11-18IndentationEelco Dolstra
2022-11-16Merge pull request #7134 from yorickvP/disable-dbg-on-completeThéophane Hufschmitt
Temporarily disable the debugger during completion evaluation
2022-11-16Swallow the error in a more idiomatic wayThéophane Hufschmitt
2022-11-12build: use pkg-config for lowdownEt7f3
2022-11-03SourceExprCommand: swallow EvalError, add tests for thisYorick van Pelt
Completing things that would error would print an ugly error in the middle of your command line. Avoid printing this error.
2022-11-02Temporarily disable the debugger during completion evaluationYorick van Pelt
readline is not re-entrant, so entering the debugger from the completioncallback results in an eventual segfault. The workaround is to temporarily disable the debugger when searching for possible completions.