aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-05-31Merge pull request #8421 from fricklerhandwerk/doc-replaceStringsEelco Dolstra
update documentation according to release notes
2023-05-31Merge pull request #8318 from fricklerhandwerk/doc-currentTimeValentin Gagarin
document `builtins.currentTime`
2023-05-30update documentation according to release notesValentin Gagarin
2023-05-30Merge pull request #8398 from ↵Robert Hensing
polykernel/perf/lazy-eval-replacements-replacestrings primops: lazy evaluation of replaceStrings replacements
2023-05-30Merge pull request #8406 from NixOS/fix-ca-attrs-falseEelco Dolstra
Restore Nix 2.3 behaviour for {__impure,__contentAddressed} = false
2023-05-27Merge pull request #8399 from tweag/fix-chrooted-stores-error-pathEelco Dolstra
Properly report build errors on chrooted stores
2023-05-27Restore Nix 2.3 behaviour for {__impure,__contentAddressed} = falseEelco Dolstra
Fixes #8405.
2023-05-26create pathAccessible, use it to infer default dirsYorick van Pelt
2023-05-26getDefaultNixPath: ignore EPERMYorick van Pelt
2023-05-26Call getDefaultSSLCertFile() only when none is specifiedYorick van Pelt
This does pathExists on various paths, which crashes on EPERM in the macOS sandbox.
2023-05-26ci: Always run with sandbox, even on DarwinSilvan Mosberger
And fix a test failure in the sandbox due to /home existing on Darwin but not being accessible in the sandbox since it's a symlink to /System/Volumes/Data/home, see https://github.com/NixOS/nix/actions/runs/4205378453/jobs/7297384658#step:6:2127: C++ exception with description "error: getting status of /home/schnitzel/darmstadt/pommes: Operation not permitted" thrown in the test body. On Linux this wasn't a problem because there /home doesn't exist in the sandbox
2023-05-25primops: lazy evaluation of replaceStrings replacementspolykernel
The primop `builtins.replaceStrings` currently always strictly evaluates the replacement strings, however time and space are wasted for their computation if the corresponding pattern do not occur in the input string. This commit makes the evaluation of the replacement strings lazy by deferring their evaluation to when the corresponding pattern are matched and memoize the result for efficient retrieval on subsequent matches. The testcases for replaceStrings was updated to check for lazy evaluation of the replacements. A note was also added in the release notes to document the behavior change.
2023-05-25Properly report build errors on chrooted storesThéophane Hufschmitt
When encountering a build error, Nix moves the output paths out of the chroot into their final location (for “easier debugging of build failures”). However this was broken for chroot stores as it was moving it to the _logical_ location, not the _physical_ one. Fix it by moving to the physical (_real_) location. Fix https://github.com/NixOS/nix/issues/8395
2023-05-24Fix typo in error message of too long store pathoxalica
2023-05-23`nix flake check`: skip derivations for foreign systems (#7759)Peter Becich
`nix flake show` now skips derivations for foreign systems: https://github.com/NixOS/nix/pull/6988 This commit borrows from that to implement the same behavior for `nix flake check`. See "nix flake check breaks on IFD in multi-platform flake" https://github.com/NixOS/nix/issues/4265
2023-05-22Merge pull request #8377 from layus/fix-ssl-cert-mountThéophane Hufschmitt
Make mounting ssl cert file optional
2023-05-22Merge pull request #8365 from obsidiansystems/proto-structsThéophane Hufschmitt
Revert "Revert "Use template structs instead of phantoms""
2023-05-19Shortcircuit for empty caFileGuillaume Maudoux
2023-05-19Make mounting ssl cert file optionalGuillaume Maudoux
2023-05-19Merge pull request #8354 from KasyanDiGris/git-fetcher-ask-credentialsEelco Dolstra
Ask for git credentials in fetcher
2023-05-19Merge pull request #8215 from obsidiansystems/general-repair-pathEelco Dolstra
Support `repairPath` on most stores.
2023-05-19Merge pull request #7312 from layus/fixed-output-system-certEelco Dolstra
Allow system certs access to fixed-output derivations
2023-05-18Merge pull request #8366 from obsidiansystems/worker-proto-forward-decl-typesRobert Hensing
Don't use `store-api.hh` in `worker-protocol.hh`
2023-05-18Remove unusedKonstantin Vukolov
2023-05-18Add option isInteractiveKonstantin Vukolov
2023-05-18Don't use `store-api.hh` in `worker-protocol.hh`John Ericson
Using abstract types like can help cut down on compilation time, both from scratch, and especially incremental builds during development. The idea is that `worker-protocol.hh` can declare all the (de)serializers, but only again abstract types; when code needs to use some (de)serializers, it can include headers just for the data types it needs to (de)serialize. `store-api.hh` in particular is a bit of a sledgehammer, and the data types we want to serialize have their own headers.
2023-05-17Revert "Revert "Use template structs instead of phantoms""John Ericson
This is the more typically way to do [Argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)-leveraging generic serializers in C++. It makes the relationship between the `read` and `write` methods more clear and rigorous, and also looks more familiar to users coming from other languages that do not have C++'s libertine ad-hoc overloading. I am returning to this because during the review in https://github.com/NixOS/nix/pull/6223, it came up as something that would make the code easier to read --- easier today hopefully already, but definitely easier if we were have multiple codified protocols with code sharing between them as that PR seeks to accomplish. If I recall correctly, the main criticism of this the first time around (in 2020) was that having to specify the type when writing, e.g. `WorkerProto<MyType>::write`, was too verbose and cumbersome. This is now addressed with the `workerProtoWrite` wrapper function. This method is also the way `nlohmann::json`, which we have used for a number of years now, does its serializers, for what its worth. This reverts commit 45a0ed82f089158a79c8c25ef844c55e4a74fc35. That commit in turn reverted 9ab07e99f527d1fa3adfa02839da477a1528d64b.
2023-05-17Upgrade `downstreamPlaceholder` to a type with methodsJohn Ericson
This gets us ready for dynamic derivation dependencies (part of RFC 92).
2023-05-17Add test for `downstreamPlaceholder`John Ericson
This is good in general, but in particular ensures when we heavily refactor it in the next commit there is less likelihood for an unintentional change in behavior to sneak in.
2023-05-17Merge pull request #8349 from tweag/fix-control-masterJohn Ericson
Fix ControlMaster behaviour
2023-05-17Merge pull request #8360 from obsidiansystems/worker-protocol.ccJohn Ericson
Move `worker_proto` defs out of `remote-store.cc` to own file
2023-05-17Move `worker_proto` defs out of `remote-store.cc` to own fileJohn Ericson
These items are not templates, and they declared in `worker-protocol.hh`; therefore they should live in a `worker-protocol.cc`. Anything else needlessly diverges from convention. After all, it is not like this code is only used in `remote-store.cc`; it is also used in `daemon.cc`. There is no good reason to place it with the client implementation or the server implementation when it used equally by both.
2023-05-17add cross-references to pure evaluation modeValentin Gagarin
use consistent wording everywhere. add some details on the configuration option documentation.
2023-05-17Also use long options in src/nix/*.mdAlexander Schmolck
2023-05-17Ask for git credentials in fetcherKonstantin Vukolov
2023-05-16Merge pull request #8346 from tweag/fix-nix-profile-install-conflict-segfaultJohn Ericson
Fix the segfault on `nix profile install` with conflict
2023-05-16Fix ControlMaster behaviourAlexander Bantyev
2023-05-16Merge pull request #8154 from tweag/delete-old-on-all-profiles-dirJohn Ericson
undefined
2023-05-16Fix the printing of the installables on `nix profile install` conflictThéophane Hufschmitt
- If the element comes from a flake, print the full flakeref (with the fragment part) and not just the reference to the flake itself - If the element doesn't come from a flake, print its store path(s) This is a bit too verbose, but has the advantages of being correct (and not crashing), so it's strictly better than the previous situation Fix https://github.com/NixOS/nix/issues/8284
2023-05-16Rename `ProfileElement.describe()` to `.identifier`Théophane Hufschmitt
This method isn't used to describe what the element is, but to return a unique identifier for it whithin the current profile
2023-05-15Merge pull request #8341 from obsidiansystems/dedup-gen-hhJohn Ericson
Dedup some markdown -> C++ big literal stuff in build system
2023-05-15Merge pull request #8340 from NixOS/delete-commited-build-artifactsRobert Hensing
Delete commited build artifacts
2023-05-15Delete commited build artifactsJohn Ericson
They were improperly added in 8a93b5a55184d9d34effdd94d58429c9ad1a3d14. They were not `.gitignore`d because they were stale in that commit -- build artifacts no longer used that name by then and so `.gitignore` was updated accordingly.
2023-05-15Fix some bounds in rapid check instancesJohn Ericson
`inRange` is exclusive not inclusive: https://github.com/emil-e/rapidcheck/blob/master/doc/generators.md#usage Furthermore, use `std::variant_size_v` so we use the right number automatically. Finally, make the `switch` assert the discriminant is in bounds as expected.
2023-05-15Dedup some markdown -> C++ big literal stuff in build systemJohn Ericson
This pattern rule was unwisely hidden in `src/libstore/local.mk`. Now it is properly in `mk/` and we reuse it for the profile docs too.
2023-05-15Make more string values work as installablesJohn Ericson
As discussed in #7417, it would be good to make more string values work as installables. That is to say, if an installable refers to a value, and the value is a string, it used to not work at all, since #7484, it works somewhat, and this PR make it work some more. The new cases that are added for `BuiltPath` contexts: - Fixed input- or content-addressed derivation: ``` nix-repl> hello.out.outPath "/nix/store/jppfl2bp1zhx8sgs2mgifmsx6dv16mv2-hello-2.12" nix-repl> :p builtins.getContext hello.out.outPath { "/nix/store/c7jrxqjhdda93lhbkanqfs07x2bzazbm-hello-2.12.drv" = { outputs = [ "out" ]; }; } The string matches the specified single output of that derivation, so it should also be valid. - Floating content-addressed derivation: ``` nix-repl> (hello.overrideAttrs (_: { __contentAddressed = true; })).out.outPath "/1a08j26xqc0zm8agps8anxpjji410yvsx4pcgyn4bfan1ddkx2g0" nix-repl> :p builtins.getContext (hello.overrideAttrs (_: { __contentAddressed = true; })).out.outPath { "/nix/store/qc645pyf9wl37c6qvqzaqkwsm1gp48al-hello-2.12.drv" = { outputs = [ "out" ]; }; } ``` The string is not a path but a placeholder, however it also matches the context, and because it is a CA derivation we have no better option. This should also be valid. We may also want to think about richer attrset based values (also discussed in that issue and #6507), but this change "completes" our string-based building blocks, from which the others can be desugared into or at least described/document/taught in terms of. Progress towards #7417 Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-05-15Create `EvalState::coerceToDerivedPath`John Ericson
This gives us some round trips to test. `EvalState::coerceToDerivedPathUnchecked` is a factored out helper just for unit testing.
2023-05-15Expose `mkOutputString` as method of `EvalState`John Ericson
2023-05-15Split `mkOutputString` in twoJohn Ericson
This well help us with some unit testing
2023-05-15Remove unneeded argument for `mkOutputString`John Ericson