aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/store-api.cc
AgeCommit message (Collapse)Author
2024-03-11util.hh: split out signals stuffJade Lovelace
Copies part of the changes of ac89bb064aeea85a62b82a6daf0ecca7190a28b7 Change-Id: I9ce601875cd6d4db5eb1132d7835c5bab9f126d8
2024-03-04Merge pull request #9992 from edolstra/fix-warningeldritch horrors
Fix "may be used uninitialized" warning (cherry picked from commit c4ebb82da4eade975e874da600dc50e9dec610cb) Change-Id: I0ce99bf102ad12902f7055c29a56e665b8320ca8
2024-03-04Merge pull request #9804 from edolstra/missing-nar-crasheldritch horrors
Fix crash when NAR is missing from binary cache (cherry picked from commit 3b20cca9625a1701a10a883735e7315185629563) Change-Id: I50ff18f4a6de69c323473b4a8e3e098d1f365145
2024-03-04Merge pull request #9662 from shlevy/flat-fixed-references-asserteldritch horrors
Improve error message for fixed-outputs with references. (cherry picked from commit ff6de4a9ee6c3862db9ee5f09ff9c3f43ae7a088) Change-Id: I733c49760b9a3f1b76a6bece3b250b8579cd6cac
2024-03-04Merge pull request #9588 from obsidiansystems/queryDerivationOutputMap-evalStoreeldritch horrors
Give `Store::queryDerivationOutputMap` and `evalStore` argument (cherry picked from commit 8cddda4f892cb42be43e9bd87aa0111572617e78) Change-Id: I394e7e11c3f2e0cd3dbe0f48d757c14c09835e44
2024-03-04Merge pull request #9289 from edolstra/fix-warningseldritch horrors
Fix gcc warnings (cherry picked from commit 66cb364f581486e0c426b35149ac13d19f7842bc) Change-Id: I1474dbc18a4beaaf1bce16d4abbcc99806b79ff1
2024-03-04Merge pull request #6223 from obsidiansystems/worker-proto-with-versioneldritch horrors
Give `nix daemon` and `nix-store --serve` protocols separate serializers with version info (cherry picked from commit 8b68bbb77745fda0d14939b6c23d31cc89da41ce) Change-Id: Ia3d3b9fbaf9f0ae62ab225020b7d14790e793655
2023-08-02Add infra for experimental store implemenationsJohn Ericson
This is analogous to that for experimental settings and flags that we have also added as of late.
2023-07-21Merge pull request #8724 from ↵John Ericson
obsidiansystems/queryPartialDerivationOutputMap-evalStore Give `queryPartialDerivationOutputMap` an `evalStore` parameter
2023-07-20Give `queryPartialDerivationOutputMap` an `evalStore` parameterJohn Ericson
This makes it more useful. In general, the derivation will be in one store, and the realisation info is in another. This also helps us avoid duplication. See how `resolveDerivedPath` is now simpler because it uses `queryPartialDerivationOutputMap`. In #8369 we get more flavors of derived path, and need more code to resolve them all, and this problem only gets worse. The fact that we need a new method to deal with the multiple dispatch is unfortunate, but this generally relates to the fact that `Store` is a sub-par interface, too bulky/unwieldy and conflating separate concerns. Solving that is out of scope of this PR. This is part of the RFC 92 work. See tracking issue #6316
2023-07-07Simplify `ContentAddress`John Ericson
Whereas `ContentAddressWithReferences` is a sum type complex because different varieties support different notions of reference, and `ContentAddressMethod` is a nested enum to support that, `ContentAddress` can be a simple pair of a method and hash. `ContentAddress` does not need to be a sum type on the outside because the choice of method doesn't effect what type of hashes we can use. Co-Authored-By: Cale Gibbard <cgibbard@gmail.com>
2023-04-07Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2023-04-02Move `querySubstitutablePathInfos` from `LocalStore` to `Store`John Ericson
The code is not local-store-specific, so we should share it with all stores. More uniform behavior is better, and a less store-specific functionality is more maintainable. This fixes a FIXME added in f73d911628 by @edolstra himself.
2023-03-31Replace unnecessary Sync<uint64_t> with std::atomic<uint64_t>Patrick Jackson
2023-03-30Only lock oncePatrick Jackson
2023-03-30Fix data race in copyPathsPatrick Jackson
2023-03-30Use "raw pattern" for content address typesJohn Ericson
We weren't because this ancient PR predated it! This is actually a new version of the pattern which addresses some issues identified in #7479.
2023-03-30Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
Also improve content-address.hh API docs.
2023-03-20Move enabled experimental feature to libutil structJohn Ericson
This is needed in subsequent commits to allow the settings and CLI args infrastructure itself to read this setting.
2023-03-10Merge pull request #8015 from tweag/progress-during-nix-copyThéophane Hufschmitt
Display progress when running copyPaths (nix copy)
2023-03-09Display progress when running copyPaths (nix copy)Alexander Bantyev
`nix copy` operations did not show progress. This is quite confusing. Add a `progressSink` which displays the progress during `copyPaths`, pretty much copied from `copyStorePath`. Fixes https://github.com/NixOS/nix/issues/8000
2023-03-02Remove FormatOrString and remaining uses of format()Eelco Dolstra
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-28No inheritance for `TextInfo` and `FixedOutputInfo`John Ericson
2023-02-28Revert "Remove some designated initializers"John Ericson
This reverts commit ee9eb83a842eb97d0180fd9d349d30ff27fdb485.
2023-02-28Clarify store path grammar and improve comment on `makeType`John Ericson
2023-02-28Fix typo in the method nameJohn Ericson
2023-02-02Merge branch 'master' into path-infoJohn Ericson
2023-02-01Remove an unused captureEelco Dolstra
2023-02-01Remove some designated initializersJohn Ericson
With the switch to C++20, the rules became more strict, and we can no longer initialize base classes. Make them comments instead. (BTW https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2287r1.html this offers some new syntax for this use-case. Hopefully this will be adopted and we can eventually use it.)
2023-01-30Avoid some `StorePath` <-> `Path` round tripsJohn Ericson
Avoid needless work and throwing away invariants. These conversions date back to when `StorePath` was in Rust and there were issues with it missing utility methods.
2023-01-23Don't add `StorePathDescriptor` for nowJohn Ericson
We don't need it yet, we can add it back later.
2023-01-14Make `ValidPathInfo` have plain `StorePathSet` references like beforeJohn Ericson
This change can wait for another PR.
2023-01-14Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2023-01-13Move `ValidPathInfo` defintions to `path-info.cc`John Ericson
Originally there was no `path-info.*`, then there was `path-info.hh`, then there was `path-info.cc`, but only for new things. Moving this stuff over makes everything consistent.
2023-01-13Move new `ValidPathInfo` methods to path-info.ccJohn Ericson
We'll move the old ones separately, so as not to clutter the diff.
2023-01-13Merge pull request #7430 from tweag/ca/fix-nix-logThéophane Hufschmitt
Ca/fix nix log
2023-01-06Do big rename to clean up codeJohn Ericson
- `PathReferences` -> `References` - `PathReferences<StorePath>` -> `StoreReference` - `references` -> `others` - `hasSelfReference` -> `self` And get rid of silly subclassing
2023-01-06Optimize `ValidPathInfo` construction a bit betterJohn Ericson
2023-01-06Use named field initialization for referencesJohn Ericson
2023-01-06Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-12-24libstore: Make sure that initNix has been calledRobert Hensing
Prevent bugs like https://github.com/cachix/cachix/pull/477
2022-12-08fix missing function after rebaseTaeer Bar-Yam
2022-12-08Fix `nix log` with CA derivationsregnat
Fix #6209 When trying to run `nix log <installable>`, try first to resolve the derivation pointed to by `<installable>` as it is the resolved one that holds the build log. This has a couple of shortcomings: 1. It’s expensive as it requires re-reading the derivation 2. It’s brittle because if the derivation doesn’t exist anymore or can’t be resolved (which is the case if any one of its build inputs is missing), then we can’t access the log anymore However, I don’t think we can do better (at least not right now). The alternatives I see are: 1. Copy the build log for the un-resolved derivation. But that means a lot of duplication 2. Store the results of the resolving in the db. Which might be the best long-term solution, but leads to a whole new class of potential issues.
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-11-16Replace src/libutil/json.cc with nlohmann json generationYorick van Pelt
2022-10-12Make warning about chroot store location more accurateSteam Deck User
While trying to use an alternate directory for my Nix installation, I noticed that nix's output didn't reflect the updated state directory. This patch corrects that and now prints the warning before attempting to create the directory (if the directory creation fails, it wouldn't have been obvious why nix was attempting to create the directory in the first place). With this patch, I now get the following warning: warning: '/home/deck/.var/app/org.nixos.nix/var/nix' does not exist, so Nix will use '/home/deck/.local/share/nix/root' as a chroot store
2022-08-24Remove redundant FinallyEelco Dolstra
2022-08-24Fix macOS buildEelco Dolstra
2022-08-23Fix a hang in nix-copy-ssh.shEelco Dolstra
This hang for some reason didn't trigger in the Nix build, but did running 'make installcheck' interactively. What happened: * Store::addMultipleToStore() calls a SinkToSource object to copy a path, which in turn calls LegacySSHStore::narFromPath(), which acquires a connection. * The SinkToSource object is not destroyed after the last bytes has been read, so the coroutine's stack is still alive and its destructors are not run. So the connection is not released. * Then when the next path is copied, because max-connections = 1, LegacySSHStore::narFromPath() hangs forever waiting for a connection to be released. The fix is to make sure that the source object is destroyed when we're done with it.