summaryrefslogtreecommitdiff
path: root/guix/store.scm
Commit message (Collapse)AuthorAge
* deprecation: Refine the old daemon deprecation warning message.Maxim Cournoyer2022-02-08
| | | | | | | | | * guix/deprecation.scm (warn-about-old-daemon): Mention a direct consequence of failing to upgrade the daemon. * guix/store.scm (build-things): Add a comment explaining the rationale to emit a deprecation warning for a daemon older than version 0x163. Suggested-by: Ricardo Wurmus <rekado@elephly.net>
* store: Warn about daemon deprecation.Mathieu Othacehe2022-02-08
| | | | | * guix/deprecation.scm (warn-about-old-daemon): New procedure. * guix/store.scm (build-things): Use it to warn about old daemons.
* store: 'mapm/accumulate-builds' does not compare stores with 'eq?'.Ludovic Courtès2021-11-10
| | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/51732>. Regression introduced in 2015d3f042870860efef10e801b93eacc0742d38. The (eq? store expected-store) comparison doesn't work on this branch where the functional cache, with 'cache-object-mapping', is used extensively, thereby changing the store's object identity. * guix/store.scm (build-accumulator): Compare the socket of STORE and EXPECTED-STORE rather than the store themselves.
* store: 'map/accumulate-builds' handler checks the store received.Ludovic Courtès2021-10-28
| | | | | | | | | | | This is a followup to b19250eec6f92308f237a09a43e8e3e2355345b9, providing a proper fix for <https://issues.guix.gnu.org/46756>. * guix/remote.scm (remote-eval): Revert b19250eec6f92308f237a09a43e8e3e2355345b9. * guix/store.scm (build-accumulator): Turn into a procedure. Call CONTINUE when the store is not eq? to the initial store. (map/accumulate-builds): Adjust accordingly. * tests/store.scm ("map/accumulate-builds and different store"): New test.
* store: 'map/accumulate-builds' processes the whole list in case of cutoff.Ludovic Courtès2021-09-15
| | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/50264>. Reported by Lars-Dominik Braun <lars@6xq.net>. This fixes a regression introduced in fa81971cbae85b39183ccf8f51e8d96ac88fb4ac whereby 'map/accumulate-builds' would return REST (the tail of LST) without applying PROC on it. The effect would be that 'lower-inputs' in (guix gexp) would dismiss those elements, leading to derivations with correct builders but only a subset of the inputs they should have had. * guix/store.scm (map/accumulate-builds): Add #:cutoff parameter and remove 'accumulation-cutoff' variable. Call PROC on the elements of REST. * tests/store.scm ("map/accumulate-builds cutoff"): New test.
* store: Add 'map/accumulate-builds' cutoff to address pathological cases.Ludovic Courtès2021-08-10
| | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/49439>. Reported by Ricardo Wurmus <rekado@elephly.net>. Previously, a command such as: guix environment pigx-scrnaseq could lead to unbounded memory growth and could even fail to complete when some items are missing from the store. This was because 'map/accumulate-builds' callees would keep making .drv build requests that were turned into <unresolved> nodes; in this case, there are often many identical build requests. Stopping accumulation earlier allows us to unlock the situation by proceeding with the first few build requests instead of spinning until we've accumulated all the build requests. * guix/store.scm (map/accumulate-builds): Define 'accumulation-cutoff'. Use a loop when iterating over LST and maintain a counter of unresolved nodes met so far; return when the counter exceeds ACCUMULATION-CUTOFF.
* Start enabling substitutes from bordeaux.guix.gnu.org.Christopher Baines2021-06-18
| | | | | | | | | | | | In addition to substitutes from ci.guix.gnu.org. There are more changes that can be made in the future, but these changes seem like a good start. * config-daemon.ac (guix_substitute_urls): Add https://bordeaux.guix.gnu.org. * guix/scripts/substitute.scm (%default-substitute-urls): Add http://bordeaux.guix.gnu.org. * guix/store.scm (%default-substitute-urls): Add bordeaux.guix.gnu.org. * doc/guix.texi: Adjust accordingly. * doc/contributing.texi: Adjust accordingly.
* store: 'references/cached' now uses a per-session cache.Ludovic Courtès2021-06-08
| | | | | | * guix/store.scm (%reference-cache): Remove. (%reference-cache-id): New variable. (references/cached): Rewrite in terms of it.
* store: Remove 'references/substitutes'.Ludovic Courtès2021-06-08
| | | | | | | | | This procedure lost its only user in commit 710854304b1ab29332edcb76f3de532e0724c197. * guix/store.scm (references/substitutes): Remove. * tests/store.scm ("references/substitutes missing reference info") ("references/substitutes with substitute info"): Remove.
* store: Generalize cache lookup recording.Ludovic Courtès2021-06-08
| | | | | * guix/store.scm (cache-lookup-recorder): New procedure. (record-cache-lookup!): Define in terms of it.
* store: Support dynamic allocation of per-connection caches.Ludovic Courtès2021-06-08
| | | | | | | | | | | | | | | | | * guix/store.scm (<store-connection>)[object-cache]: Remove. [caches]: New field. (open-connection, port->connection): Adjust '%make-store-connection' calls accordingly. (%store-connection-caches, %object-cache-id): New variables. (allocate-store-connection-cache, vector-set) (store-connection-cache, set-store-connection-cache) (set-store-connection-caches!, set-store-connection-cache!): New procedures. (cache-object-mapping): Add #:cache parameter. (set-store-connection-object-cache!): Remove. (lookup-cached-object): Use 'store-connection-cache'. (run-with-store): Use 'store-connection-caches' and 'set-store-connection-caches!'.
* maint: Require Guile 3.0.Ludovic Courtès2021-06-01
| | | | | | | | | | | | * configure.ac: Require Guile 3.0. * doc/guix.texi (Requirements): Adjust accordingly. * gnu/packages/package-management.scm (guile2.2-guix): Remove. * guix/lint.scm (exception-with-kind-and-args?): Remove 'cond-expand'. * guix/scripts/deploy.scm (deploy-machine*): Likewise. * guix/store.scm (call-with-store): Likewise. * guix/swh.scm (http-get*, http-post*): Likewise. * guix/ui.scm (without-compiler-optimizations, guard*) (call-with-error-handling): Likewise.
* store: Export 'connect-to-daemon'.Ludovic Courtès2021-05-08
| | | | * guix/store.scm (connect-to-daemon): Make public. Improve docstring.
* store: 'open-connection' never returns #f.Ludovic Courtès2021-05-08
| | | | | * guix/store.scm (open-connection)[handshake-error]: New procedure. Call it in code paths that would previously return #f.
* store: Micro-optimize object cache lookup.Ludovic Courtès2021-02-23
| | | | | | | | This avoids a closure allocation when 'lookup-cached-object' is called. * guix/store.scm (lookup-cached-object): Avoid optional/keyword arguments and inline. (%mcached): Adjust accordingly.
* store: Object cache profiling shows the number of entries.Ludovic Courtès2021-02-23
| | | | | * guix/store.scm (record-cache-lookup!): Add 'size' variable; keep it up-to-date and display it.
* store: 'store-path-hash-part' really returns false for invalid file names.Ludovic Courtès2021-02-04
| | | | | | | The "store-path-hash-part #f", due to a SRFI-64 bug, was marked as successful even though 'store-path-hash-part' was throwing an exception. * guix/store.scm (store-path-hash-part): Really return #f.
* store: Add 'find-roots' RPC.Ludovic Courtès2021-01-22
| | | | | | | * guix/serialization.scm (read-string-pairs): New procedure. * guix/store.scm (read-arg): Add support for 'string-pairs'. (find-roots): New procedure. * tests/store.scm ("add-indirect-root and find-roots"): New test.
* store: Fix ensure-path docstring.Mathieu Othacehe2020-11-23
| | | | | | Suggested by Ludovic Courtès. * guix/store.scm (ensure-path): Fix the docstring.
* guix: store: Add ensure-path.Mathieu Othacehe2020-11-22
| | | | * guix/store.scm (ensure-path): New procedure.
* store: 'set-build-options' sends LC_MESSAGES, not LC_ALL.Ludovic Courtès2020-09-02
| | | | | * guix/store.scm (set-build-options): Change #:locale default value to (setlocale LC_MESSAGES).
* ssh: 'send-files' displays a progress bar.Ludovic Courtès2020-08-31
| | | | | | | | * guix/store.scm (export-paths): Add #:start, #:progress, and #:finish parameters and honor them. * guix/ssh.scm (prepare-to-send, notify-transfer-progress) (notify-transfer-completion): New procedures. (send-files): Pass #:start, #:progress, and #:finish to 'export-paths'.
* store: 'with-store' returns as many values as its body.Ludovic Courtès2020-08-28
| | | | | | | | | Fixes <https://bugs.gnu.org/42912>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/store.scm (call-with-store)[thunk]: Wrap call to PROC in 'call-with-values'. * tests/store.scm ("with-store, multiple values"): New test.
* store: Use '=' instead of 'eqv?'.Ludovic Courtès2020-06-26
| | | | | | | | | Fixes <https://bugs.gnu.org/42047>. Reported by Jan Nieuwenhuizen <janneke@gnu.org>. * guix/store.scm (open-connection): Use '=' instead of 'eqv?'. This works around <https://bugs.gnu.org/42060> while also being more accurate since the arguments are known to be integers.
* store: Use buffered I/O for all protocol writesLars-Dominik Braun2020-06-09
| | | | | | | | | * guix/store.scm (run-gc) Use buffered output port. (export-path) Same. (add-file-tree-to-store) Same. (set-build-options): Same. Add explicit flush. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* store: 'mapm/accumulate-builds' preserves '%current-target-system'.Ludovic Courtès2020-05-14
| | | | | | | | | | Fixes <https://bugs.gnu.org/41182>. * guix/store.scm (mapm/accumulate-builds): Pass #:system and #:target to 'run-with-store'. * tests/store.scm ("mapm/accumulate-builds, %current-target-system"): New test. * tests/guix-pack.sh: Add 'guix pack -d --target' test.
* Merge branch 'master' into core-updatesMarius Bakke2020-04-08
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: etc/news.scm gnu/local.mk gnu/packages/check.scm gnu/packages/cross-base.scm gnu/packages/gimp.scm gnu/packages/java.scm gnu/packages/mail.scm gnu/packages/sdl.scm gnu/packages/texinfo.scm gnu/packages/tls.scm gnu/packages/version-control.scm
| * store: 'with-store' uses 'with-exception-handler'.Ludovic Courtès2020-04-05
| | | | | | | | | | | | | | | | | | | | This ensures the stack is not unwound before the exception is re-thrown, as was the case since 8ed597f4a261fe188de82cd1f5daed83dba948eb, leading to '&store-protocol-error' being uncaught by 'with-error-handling' in (guix scripts build) & co. * guix/store.scm (call-with-store): Define 'thunk'. Add 'cond-expand' to use 'with-exception-handler' on 'guile-3' and 'catch' otherwise.
| * store: 'with-store' doesn't close the store upon abort.Ludovic Courtès2020-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/40428>. Reported by Marius Bakke <mbakke@fastmail.com> and 白い熊. Regression introduced with the first uses of 'with-build-handler' in commit 62195b9a8fd6846117c5d7698842748300d13e31 and subsequent. * guix/store.scm (call-with-store): Use 'catch #t' instead of 'dynamic-wind'. This ensures STORE remains open when a non-local exit other than an exception occurs, such as an abort to the build handler prompt. * tests/store.scm ("with-build-handler + with-store"): New test.
* | Merge branch 'master' into core-updatesMarius Bakke2020-03-30
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: gnu/packages/admin.scm gnu/packages/commencement.scm gnu/packages/guile.scm gnu/packages/linux.scm gnu/packages/package-management.scm gnu/packages/pulseaudio.scm gnu/packages/web.scm
| * store: Add 'references/cached'.Ludovic Courtès2020-03-29
| | | | | | | | * guix/store.scm (references/cached): New procedure.
| * store: Add 'map/accumulate-builds'.Ludovic Courtès2020-03-29
| | | | | | | | | | | | | | | | * guix/store.scm (<unresolved>): New record type. (build-accumulator, map/accumulate-builds, mapm/accumulate-builds): New procedures. * tests/store.scm ("map/accumulate-builds", "mapm/accumulate-builds"): New tests.
* | Merge branch 'master' into core-updatesMarius Bakke2020-03-27
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: gnu/packages/icu4c.scm gnu/packages/man.scm gnu/packages/python-xyz.scm guix/scripts/environment.scm guix/scripts/pack.scm guix/scripts/package.scm guix/scripts/pull.scm guix/store.scm
| * store: Add 'with-build-handler'.Ludovic Courtès2020-03-22
| | | | | | | | | | | | | | * guix/store.scm (current-build-prompt): New variable. (call-with-build-handler, invoke-build-handler): New procedures. (with-build-handler): New macro. * tests/store.scm ("with-build-handler"): New test.
* | Merge branch 'master' into core-updatesMarius Bakke2020-03-18
|\|
| * store: Fix many guix commands failing on some locales.Florian Pelz2020-03-14
| | | | | | | | | | | | | | | | | | | | | | | | Partly fixes <https://bugs.gnu.org/39970>. At least 'guix environment', 'guix install' and 'guix pull' on 'az_AZ.utf8' and 'tr_TR.utf8' were affected. * guix/store.scm (store-path-hash-part): Move base path detection to ... (store-path-base): ... this new exported procedure. (store-path-package-name): Use it instead of locale-dependent regexps. (store-regexp*): Remove.
| * store: Add set-current-target procedure.Mathieu Othacehe2020-03-08
| | | | | | | | * guix/store.scm (set-current-target): New exported procedure.
| * profiles: Fix profile-derivation cross-compilation.Mathieu Othacehe2019-12-29
| | | | | | | | | | | | * guix/store.scm (current-target-system): New exported monadic procedure. * guix/profiles.scm (profile-derivation): Set target at bind time using the above procedure.
* | store: Add set-current-target procedure.Mathieu Othacehe2020-03-06
| | | | | | | | * guix/store.scm (set-current-target): New exported procedure.
* | gexp: Move 'file-mapping->tree' to (guix store).Ludovic Courtès2020-01-30
| | | | | | | | | | | | * guix/gexp.scm (%not-slash): Remove. (file-mapping->tree): Move to... * guix/store.scm (file-mapping->tree): ... here.
* | profiles: Fix profile-derivation cross-compilation.Mathieu Othacehe2019-12-26
|/ | | | | | * guix/store.scm (current-target-system): New exported monadic procedure. * guix/profiles.scm (profile-derivation): Set target at bind time using the above procedure.
* Use 'offload?' instead of 'build-hook?' internally.Ludovic Courtès2019-11-26
| | | | | | | | | | | | | | | | | | | | * guix/scripts/archive.scm (%default-options): Replace 'build-hook?' with 'offload?'. * guix/scripts/build.scm (set-build-options-from-command-line): Pass #:offload? instead of #:use-build-hook?. (%standard-build-options): Use the 'offload? key instead of 'build-hook?. (%default-options): Replace 'build-hook?' with 'offload?'. * guix/scripts/copy.scm (%default-options): Likewise. * guix/scripts/deploy.scm (%default-options): Likewise. * guix/scripts/environment.scm (%default-options): Likewise. * guix/scripts/pack.scm (%default-options): Likewise. * guix/scripts/package.scm (%default-options): Likewise. * guix/scripts/pull.scm (%default-options): Likewise. * guix/scripts/system.scm (%default-options): Likewise. * guix/scripts/time-machine.scm (%default-options): Likewise. * guix/store.scm (set-build-options): Have #:use-build-hook? default to *unspecified*. Add #:offload?. Add call to 'warn-about-deprecation' when #:use-build-hook? is specified.
* store: Allow objects in the cache to be inserted and search for with 'equal?'.Ludovic Courtès2019-10-27
| | | | | | | | * guix/store.scm (cache-object-mapping): Add #:vhash-cons parameter and honor it. (lookup-cached-object): Add #:vhash-fold* parameter and honor it. (%mcached): Add #:vhash-fold* and #:vhash-cons and honor them. (mcached): Add clauses with 'eq?' and 'equal?' as the first argument.
* daemon: Make 'profiles/per-user' non-world-writable.Ludovic Courtès2019-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/37744>. Reported at <https://www.openwall.com/lists/oss-security/2019/10/09/4>. Based on Nix commit 5a303093dcae1e5ce9212616ef18f2ca51020b0d by Eelco Dolstra <edolstra@gmail.com>. * nix/libstore/local-store.cc (LocalStore::LocalStore): Set 'perUserDir' to #o755 instead of #o1777. (LocalStore::createUser): New function. * nix/libstore/local-store.hh (LocalStore): Add it. * nix/libstore/store-api.hh (StoreAPI): Add it. * nix/nix-daemon/nix-daemon.cc (performOp): In 'wopSetOptions', add condition to handle "user-name" property and honor it. (processConnection): Add 'userId' parameter. Call 'store->createUser' when userId is not -1. * guix/profiles.scm (ensure-profile-directory): Note that this is now handled by the daemon. * guix/store.scm (current-user-name): New procedure. (set-build-options): Add #:user-name parameter and pass it to the daemon. * tests/guix-daemon.sh: Test the creation of 'profiles/per-user' when listening on a TCP socket. * tests/store.scm ("profiles/per-user exists and is not writable") ("profiles/per-user/$USER exists"): New tests.
* store: 'run-with-store' gracefully deals with #f store.Ludovic Courtès2019-07-05
| | | | | | | | | | This is a followup to dd0ee954c4fa965023fd887452927c02edb8b52f, which introduced a failure in tests/graph.scm. * guix/store.scm (run-with-store): Check whether STORE and NEW-STORE are true before calling 'store-connection-object-cache' etc. Fixes a failure in tests/graph.scm related to %REVERSE-PACKAGE-NODE-TYPE, which uses #f as the store.
* store: 'run-with-store' preserves the functional object cache.Ludovic Courtès2019-07-03
| | | | | | | | | This increases the hit rate of the object cache from 56% to 85% when running something like 'guix build libreoffice -nd'. * guix/store.scm (set-store-connection-object-cache!): New procedure. (run-with-store): Copy 'object-cache' field of the new store into the original one.
* store: 'build-things' accepts derivation/output pairs.Ludovic Courtès2019-06-10
| | | | | | | | | | | | | | This allows callers to request the substitution of a single derivation output. * guix/store.scm (build-things): Accept derivation/output pairs among THINGS. * guix/derivations.scm (build-derivations): Likewise. * tests/store.scm ("substitute + build-things with specific output"): New test. * tests/derivations.scm ("build-derivations with specific output"): New test. * doc/guix.texi (The Store): Adjust accordingly.
* store: Fix 'hash-part->path' docstring.Ludovic Courtès2019-05-26
| | | | * guix/store.scm (hash-part->path): Adjust docstring to match reality.
* build: Change default substitute server to "ci.guix.gnu.org".Ludovic Courtès2019-05-01
| | | | | | | | | | | * config-daemon.ac: Replace "ci.guix.info" with "ci.guix.gnu.org". * doc/guix.texi (SUBSTITUTE-SERVER): Likewise. * etc/substitutes/ci.guix.gnu.org.pub: New file. * Makefile.am (dist_pkgdata_DATA): Add it. * guix/scripts/build.scm (%default-log-urls): Update. * guix/scripts/substitute.scm (%default-substitute-urls): Likewise. * guix/store.scm (%default-substitute-urls): Likewise. * guix/self.scm (miscellaneous-files): Add "ci.guix.gnu.org".
* store: Add "add-data-to-store-cache" profiling component.Ludovic Courtès2019-04-16
| | | | | * guix/store.scm (add-data-to-store): Define 'lookup' and use it instead of 'hash-ref'.