aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-02-25Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2021-02-24Respect command registrations in plugins.Shea Levy
2021-02-24Initialize plugins after handling initial command line flagsShea Levy
This is technically a breaking change, since attempting to set plugin files after the first non-flag argument will now throw an error. This is acceptable given the relative lack of stability in a plugin interface and the need to tie the knot somewhere once plugins can actually define new subcommands.
2021-02-24Bail if plugin-files is set after plugins have been loaded.Shea Levy
We know the flag will be ignored but the user wants it to take effect.
2021-02-23Merge pull request #4551 from danieldk/system-features-compute-levelEelco Dolstra
Add x86_64 compute levels as system features
2021-02-22Warn about instability of plugin APIShea Levy
2021-02-22Make missing auto-call arguments throw an eval errorregnat
The PR #4240 changed messag of the error that was thrown when an auto-called function was missing an argument. However this change also changed the type of the error, from `EvalError` to a new `MissingArgumentError`. This broke hydra which was relying on an `EvalError` being thrown. Make `MissingArgumentError` a subclass of `EvalError` to un-break hydra.
2021-02-22Tweak error messageEelco Dolstra
2021-02-22Add x86_64 compute levels as additional system typesDaniël de Kok
When performing distributed builds of machine learning packages, it would be nice if builders without the required SIMD instructions can be excluded as build nodes. Since x86_64 has accumulated a large number of different instruction set extensions, listing all possible extensions would be unwieldy. AMD, Intel, Red Hat, and SUSE have recently defined four different microarchitecture levels that are now part of the x86-64 psABI supplement and will be used in glibc 2.33: https://gitlab.com/x86-psABIs/x86-64-ABI https://lwn.net/Articles/844831/ This change uses libcpuid to detect CPU features and then uses them to add the supported x86_64 levels to the additional system types. For example on a Ryzen 3700X: $ ~/aps/bin/nix -vv --version | grep "Additional system" Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
2021-02-19Merge pull request #4541 from obsidiansystems/simpler-store-path-commandEelco Dolstra
Deeper `Command` hierarchy to remove redundancy
2021-02-19Remove the drv resolution caching mechanismregnat
It isn't needed anymore now that don't need to eagerly resolve everything like we used to do. So we can safely get rid of it
2021-02-19Store the output hashes in the initialOutputs of the drv goalregnat
That way we 1. Don't have to recompute them several times 2. Can compute them in a place where we know the type of the parent derivation, meaning that we don't need the casting dance we had before
2021-02-19Don't expose the "bang" drvoutput syntaxThéophane Hufschmitt
It's not fixed nor useful atm, so better keep it hidden Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-02-19Syntactic fixesThéophane Hufschmitt
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-02-19Register the realisations for unresolved drvsregnat
Once a build is done, get back to the original derivation, and register all the newly built outputs for this derivation. This allows Nix to work properly with derivations that don't have all their build inputs available − thus allowing garbage collection and (once it's implemented) binary substitution
2021-02-19Don't crash nix-build when not all outputs are realisedregnat
Change the `nix-build` logic for linking/printing the output paths to allow for some outputs to be missing. This might happen when the toplevel derivation didn't have to be built, either because all the required outputs were already there, or because they have all been substituted.
2021-02-18Increase default stack size on LinuxEelco Dolstra
Workaround for #4550.
2021-02-17Document meta.mainProgramEelco Dolstra
Issue #4498.
2021-02-17nix run: Allow program name to be set in meta.mainProgramEelco Dolstra
This is useful when the program name doesn't match the package name (e.g. ripgrep vs rg). Fixes #4498.
2021-02-17Throw an error if --arg / --argstr is used with a flakeEelco Dolstra
Fixes #3949.
2021-02-17Make 'nix --version -vv' workEelco Dolstra
Fixes #3743.
2021-02-17nix flake show: Handle 'overlays' outputEelco Dolstra
Fixes #4542.
2021-02-17nix develop: Fix quoted string handlingEelco Dolstra
Fixes #4540.
2021-02-12Deeper `Command` hierarchy to remove redundancyJohn Ericson
Simply put, we now have `StorePathCommand : public StorePathsCommand` so `StorePathCommand` doesn't reimplement work.
2021-02-09Revert "narinfo: Change NAR URLs to be addressed on the NAR hash instead of ↵Graham Christensen
the compressed hash"
2021-02-09Merge pull request #4464 from tweag/nar-narhash-addressedEelco Dolstra
narinfo: Change NAR URLs to be addressed on the NAR hash instead of the compressed hash
2021-02-07Merge pull request #4525 from sternenseemann/lowdown-0.8.0Eelco Dolstra
libcmd/markdown: handle allocation errors in lowdown_term_rndr
2021-02-07Support --no-net for backwards compatibilityEelco Dolstra
2021-02-06libcmd/markdown: handle allocation errors in lowdown_term_rndrsternenseemann
We upgrade to lowdown 0.8.0 [1] which contains a fix/improvement to a behavior mentioned in this issue thread [2] where a big part of lowdown's API would just call exit(1) on allocation errors since that is a satisfying behavior for the lowdown binary. Now lowdown_term_rndr returns 0 if an allocation error occurred which we check for in libcmd/markdown.cc. Also the extern "C" { } wrapper around lowdown.h has been removed as it is not necessary. [1]: https://github.com/kristapsdz/lowdown/blob/6ca7c855a063d1c77ae0b89405047cc3913a74d8/versions.xml#L987-L1006 [2]: https://github.com/kristapsdz/lowdown/issues/45#issuecomment-756681153
2021-02-05Add more instrumentation for #4270Eelco Dolstra
2021-02-05Merge pull request #4372 from tweag/ca/drvoutputs-commandsEelco Dolstra
Add a new Cmd type working on RealisedPaths
2021-02-05Merge pull request #4515 from matthewbauer/fix-nix-profile-install-first-outputEelco Dolstra
Use derivation output name from toDerivation
2021-02-05Add a trace to readLine() failuresEelco Dolstra
Hopefully this helps to diagnose 'error: unexpected EOF reading a line' on macOS.
2021-02-05Remove the `visit` machinery in `RealisedPath`regnat
In addition to being some ugly template trickery, it was also totally useless as it was used in only one place where I could replace it by just a few extra characters
2021-02-05Move the GENERATE_CMP macro to its own fileregnat
Despite being an ugly hack, it can probably be useful in a couple extra places
2021-02-04Fix a whitespace issueThéophane Hufschmitt
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-02-04Normalize some error messagesThéophane Hufschmitt
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-02-03Always enter first level of attrset in nix searchMatthew Bauer
This makes nix search always go through the first level of an attribute set, even if it's not a top level attribute. For instance, you can now list all GHC compilers with: $ nix search nixpkgs#haskell.compiler ... This is similar to how nix-env works when you pass in -A.
2021-02-03Include note about type of catched errors in tryEval documentationsternenseemann
Reference #356.
2021-02-02Use derivation output name from toDerivationMatthew Bauer
This fixes an issue where derivations with a primary output that is not "out" would fail with: $ nix profile install nixpkgs#sqlite error: opening directory '/nix/store/2a2ydlgyydly5czcc8lg12n6qqkfz863-sqlite-3.34.1-bin': No such file or directory This happens because while derivations produce every output when built, you might not have them if you didn't build the derivation yourself (for instance, the store path was fetch from a binary cache). This uses outputName provided from DerivationInfo which appears to match the first output of the derivation.
2021-02-01--no-net -> --offlineDomen Kožar
2021-01-29Merge pull request #4461 from NixOS/ca/error-logging-fixesEelco Dolstra
Fix some logging with ca derivations
2021-01-29Shorten `mktemp` flag for macOSJames Ottaway
Address `mktemp: illegal option -- -`.
2021-01-28Add a new Cmd type working on RealisedPathsregnat
Where a `RealisedPath` is a store path with its history, meaning either an opaque path for stuff that has been directly added to the store, or a `Realisation` for stuff that has been built by a derivation This is a low-level refactoring that doesn't bring anything by itself (except a few dozen extra lines of code :/ ), but raising the abstraction level a bit is important on a number of levels: - Commands like `nix build` have to query for the realisations after the build is finished which is fragile (see 27905f12e4a7207450abe37c9ed78e31603b67e1 for example). Having them oprate directly at the realisation level would avoid that - Others like `nix copy` currently operate directly on (built) store paths, but need a bit more information as they will need to register the realisations on the remote side
2021-01-27Merge pull request #4483 from shlevy/libcmdEelco Dolstra
Move command plugin interface to libnixcmd
2021-01-27Add trace to build errors during import-from-derivationEelco Dolstra
Example: error: builder for '/nix/store/9ysqfidhipyzfiy54mh77iqn29j6cpsb-failing.drv' failed with exit code 1; last 1 log lines: > FAIL For full logs, run 'nix log /nix/store/9ysqfidhipyzfiy54mh77iqn29j6cpsb-failing.drv'. … while importing '/nix/store/pfp4a4bjh642ylxyipncqs03z6kkgfvy-failing' at /nix/store/25wgzr2qrqqiqfbdb1chpiry221cjglc-source/flake.nix:58:15: 57| 58| ifd = import self.hydraJobs.broken; | ^ 59|
2021-01-27Drop trailing whitespaceEelco Dolstra
2021-01-27Add traces to errors while updating flake lock fileEelco Dolstra
Example: $ nix build --show-trace error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/commits/no-such-branch': HTTP error 422 ('') response body: { "message": "No commit found for SHA: no-such-branch", "documentation_url": "https://docs.github.com/rest/reference/repos#get-a-commit" } … while fetching the input 'github:NixOS/nixpkgs/no-such-branch' … while updating the flake input 'nixpkgs' … while updating the lock file of flake 'git+file:///home/eelco/Dev/nix'
2021-01-27Remove mkFlag()Eelco Dolstra
2021-01-26Fix the error message when a dep is missingregnat
Fix a mismatch in the errors thrown when a needed output was missing from an input derivation that was leading to a wrong and quite misleading error message