summaryrefslogtreecommitdiff
path: root/guix/store.scm
Commit message (Collapse)AuthorAge
* 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'.
* store: Memoize 'built-in-builders' call directly in <store-connection>.Ludovic Courtès2019-04-16
| | | | | | | | | | | | | | | The caching strategy introduced in 40cc850aebb497faed0a11d867d8fcee729023df was ineffective since we regularly start from an empty object cache. For example, "guix build inkscape -n" would make 241 'built-in-builders' RPCs. * guix/store.scm (<store-connection>)[built-in-builders]: New field. (open-connection): Adjust '%make-store-connection' call accordingly. (port->connection): Likewise. (built-in-builders): Rename to... (%built-in-builders): ... this. (built-in-builders): New procedure. * guix/download.scm (built-in-builders*): Remove 'mcached' call.
* store: 'with-store' expands to a single procedure call.Ludovic Courtès2019-04-10
| | | | | * guix/store.scm (call-with-store): New procedure. (with-store): Write in terms of 'call-with-store'.
* store: 'log-file' honors 'GUIX_LOG_DIRECTORY'.Ludovic Courtès2019-02-04
| | | | | * guix/store.scm (derivation-log-file): Use %LOCALSTATEDIR or "GUIX_LOG_DIRECTORY" instead of (dirname %STATE-DIRECTORY).
* store: Rename '&nix-error' to '&store-error'.Ludovic Courtès2019-01-21
| | | | | | | | | | | | | | | | | | | * guix/store.scm (&nix-error): Rename to... (&store-error): ... this, and adjust users. (&nix-connection-error): Rename to... (&store-connection-error): ... this, and adjust users. (&nix-protocol-error): Rename to... (&store-protocol-error): ... this, adjust users. (&nix-error, &nix-connection-error, &nix-protocol-error): Define these condition types and their getters as deprecrated aliases. * build-aux/run-system-tests.scm, guix/derivations.scm, guix/grafts.scm, guix/scripts/challenge.scm, guix/scripts/graph.scm, guix/scripts/lint.scm, guix/scripts/offload.scm, guix/serialization.scm, guix/ssh.scm, guix/tests.scm, guix/ui.scm, tests/derivations.scm, tests/gexp.scm, tests/guix-daemon.sh, tests/packages.scm, tests/store.scm, doc/guix.texi: Adjust to use the new names.
* store: Rename <nix-server> to <store-connection>.Ludovic Courtès2019-01-21
| | | | | | | | | | * guix/store.scm (<nix-server>): Rename to... (<store-connection>): ... this. Adjust users accordingly. (nix-server?, nix-server-major-version) (nix-server-minor-version, nix-server-socket) (nix-server-version): Define as deprecated aliases. * guix/inferior.scm: Adjust accordingly. * guix/ssh.scm: Likewise.
* Remove most uses of the _IO*F constants.Ludovic Courtès2019-01-09
| | | | | | | | | | | | | | | | | | | | | | | | These constants, for use with 'setvbuf', were deprecated in Guile 2.2 and disappeared in Guile 3.0. Here we keep these constants in build-side code where removing them is not feasible. * guix/build/download-nar.scm (download-nar): Adjust 'setvbuf' calls to the Guile 2.2+ API. * guix/build/download.scm (open-socket-for-uri): Likewise. (open-connection-for-uri, url-fetch): Likewise. * guix/build/make-bootstrap.scm (make-stripped-libc): Likewise. * guix/build/union.scm (setvbuf) [guile-2.0]: New conditional wrapper. (union-build): Adjust to new API. * guix/ftp-client.scm (ftp-open, ftp-list, ftp-retr): Likewise. * guix/http-client.scm (http-fetch): Likewise. * guix/inferior.scm (proxy): Likewise. * guix/scripts/substitute.scm (fetch, http-multiple-get): Likewise. * guix/self.scm (compiled-modules): Likewise. * guix/ssh.scm (remote-daemon-channel, store-import-channel) (store-export-channel): Likewise. * guix/ui.scm (initialize-guix): Likewise. * tests/publish.scm (http-get-port): Likewise. * guix/store.scm (%newlines): Adjust comment.
* maint: Remove 'cond-expand' forms for Guile 2.0.Ludovic Courtès2019-01-09
| | | | | | | | | | | | | | | | | | | | | | Note: Leave 'cond-expand' forms used in the build-side modules that can run on %BOOTSTRAP-GUILE, which is currently Guile 2.0. * guix/build/compile.scm: Move 'use-modules' clause from 'cond-expand' to 'define-module' form. (%default-optimizations): Remove 'cond-expand'. * guix/build/download.scm (tls-wrap): Remove 'cond-expand'. * guix/build/syscalls.scm: Remove 'cond-expand' form around '%set-automatic-finalization-enabled?!' and 'without-automatic-finalization'. * guix/inferior.scm (port->inferior): Remove 'cond-expand'. * guix/scripts/pack.scm (wrapped-package)[build]: Remove 'cond-expand'. * guix/status.scm (build-event-output-port): Remove 'cond-expand'. * guix/store.scm (open-inet-socket): Remove 'cond-expand'. * guix/ui.scm (install-locale): Remove 'cond-expand'. * tests/status.scm ("current-build-output-port, UTF-8 + garbage"): Remove 'cond-expand'. * tests/store.scm ("current-build-output-port, UTF-8 + garbage"): Remove 'cond-expand'.