summaryrefslogtreecommitdiff
path: root/guix/store.scm
Commit message (Collapse)AuthorAge
* store: The 'references' parameter of 'add-text-to-store' is now optional.Ludovic Courtès2013-09-11
| | | | | | | * guix/store.scm (add-text-to-store): Make 'references' optional. * tests/store.scm ("dead-paths", "references"): Use 'add-text-to-store' with no optional argument. * doc/guix.texi (The Store): Adjust accordingly.
* store: Add a printer for <nix-server>.Ludovic Courtès2013-09-02
| | | | * guix/store.scm (<nix-server>): Set a printer.
* store: Deal with unsupported `setsockopt' operation on GNU/Hurd.Ludovic Courtès2013-07-04
| | | | | | | * guix/store.scm (open-connection): Silently ignore ENOPROTOOPT on `setsockopt' calls, for the sake of GNU/Hurd. Reported by Matthew Lien <bluet@bluet.org> at <http://lists.gnu.org/archive/html/bug-guix/2013-07/msg00020.html>.
* store: Add `requisites'.Ludovic Courtès2013-06-13
| | | | | * guix/store.scm (fold-path, requisites): New procedures. * tests/store.scm ("requisites"): New test.
* store: Test the `fallback?' store option.Ludovic Courtès2013-05-29
| | | | | * guix/store.scm (set-build-options): Rename #:try-fallback? to #:fallback?. * tests/store.scm ("substitute --fallback"): New test.
* daemon: Gracefully handle cases where the daemon does not return a status code.Ludovic Courtès2013-04-20
| | | | * guix/store.scm (process-stderr): Check for EOF before doing (read-int p).
* store: Remove unneeded and conflicting import.Ludovic Courtès2013-04-12
| | | | | | * guix/store.scm: Remove unneeded (ice-9 rdelim) import. In Guile 2.0.9 that module exports `read-string', which conflicts with that of (guix serialization).
* Add (guix nar) and (guix serialization).Ludovic Courtès2013-04-04
| | | | | | | | | | | * guix/store.scm (write-int, read-int, write-long-long, read-long-long, write-padding, write-string, read-string, read-latin1-string, write-string-list, read-string-list, write-store-path, read-store-path, write-store-path-list, read-store-path-list): Move to serialization.scm. (write-contents, write-file): Move to nar.scm. * guix/nar.scm, guix/serialization.scm: New files. * Makefile.am (MODULES): Add them.
* Add preliminary binary substituter.Ludovic Courtès2013-04-03
| | | | | | | | | | | | | | | | | | * guix/scripts/substitute-binary.scm: New file. * Makefile.am (MODULES): Add it. * nix/scripts/substitute-binary.in: New file. * config-daemon.ac: Produce nix/scripts/substitute-binary. * daemon.am (nodist_pkglibexec_SCRIPTS): Add nix/scripts/substitute-binary. * guix/store.scm (substitutable-path-info): Use the `query-substitutable-path-infos' RPC. * nix/nix-daemon/guix-daemon.cc (main): Honor `NIX_SUBSTITUTERS'. * pre-inst-env.in: Set `NIX_SUBSTITUTERS'. * test-env.in: Leave `NIX_SUBSTITUTERS' unchanged. Set `GUIX_BINARY_SUBSTITUTE_URL, and create $NIX_STATE_DIR/substituter-data. Run `guix-daemon' within `./pre-inst-env'. * tests/store.scm ("substitute query"): New test.
* store: Add `store-path-hash-part'.Ludovic Courtès2013-04-01
| | | | | | * guix/store.scm (store-path-hash-part): New procedure. * tests/store.scm ("store-path-hash-part", "store-path-hash-part #f"): New tests.
* store: Really disable file name canonicalization for derivation inputs.Ludovic Courtès2013-03-22
| | | | | | | * guix/store.scm (write-contents)[call-with-binary-input-file]: Set %FILE-PORT-NAME-CANONICALIZATION to #f. * gnu/packages.scm (search-patch, search-bootstrap-binary): Leave %FILE-PORT-NAME-CANONICALIZATION unchanged. This reverts 9776ebb.
* store: Use `sendfile' when available.Ludovic Courtès2013-03-22
| | | | | | | | * guix/store.scm (write-contents)[call-with-binary-input-file]: New procedure. Use `sendfile' instead of `dump' when available. Add `size' parameter. (write-file): Update caller.
* ui: Gracefully report failures to connect to the daemon.Ludovic Courtès2013-03-07
| | | | | | | | | | | | * guix/store.scm (&nix-connection-error): New condition type. (open-connection): Translate `system-error' during the `connect' call into `&nix-connection-error'. * guix/ui.scm (call-with-error-handling): Add case for `nix-connection-error?'. * guix/scripts/package.scm (guix-package): Move `open-connection' call within `with-error-handling'. * guix/scripts/pull.scm (guix-pull): Likewise. * guix/scripts/download.scm (guix-download): Move body within `with-error-handling'.
* store: Add queries for references & co.Ludovic Courtès2013-02-27
| | | | | | | * guix/store.scm (operation-id)[query-valid-derivers]: New value. (references, referrers, valid-derivers, query-derivation-outputs): New procedures. * tests/store.scm ("references", "derivers"): New tests.
* store: Add the `%daemon-socket-file' parameter.Ludovic Courtès2013-02-18
| | | | | * guix/store.scm (%daemon-socket-file): New variable. (open-connection): Use it as the default value for FILE.
* store: Add substitute-related procedures.Ludovic Courtès2013-02-04
| | | | | | | | | | * guix/store.scm (has-substitutes?, substitutable-paths, read-substitutable-path-list, substitutable-path-info): New procedures. (<substitutable>): New record type. (read-arg): Add `substitutable-path-info'. Change `hash' pattern variable to `base16' literal. * tests/store.scm ("no substitutes"): New test.
* store: Update to protocol 1.12.Ludovic Courtès2013-02-04
| | | | | | | | | | | * guix/store.scm (%protocol-version): Bump. (operation-id): Comment out `query-substitutable-path-info'. Rename `query-valid-paths' to `query-all-valid-paths'. Add `query-path-from-hash-part', `query-substitutable-path-infos', `query-valid-paths', and `query-substitutable-paths'. (set-build-options): Add `binary-caches' keyword parameter. When using a server >= 1.12, send the list of binary caches. (query-path-hash): Use the `store-path' type, for clarity.
* store: Write string length as a 32-bit integer.Ludovic Courtès2013-02-04
| | | | | | * guix/store.scm (write-string): Write L as a 32-bit integer. Bug introduced in 82c38fe64c84fc3febcc5c5aa7fe86454ccaf456 ("store: Micro-optimize `write-string'.")
* store: Don't expect build logs to be UTF-8-encoded.Ludovic Courtès2013-01-31
| | | | | | * guix/store.scm (read-latin1-string): New procedure. (process-stderr): Use it instead of `read-string'. Reported by Andreas Enge <andreas@enge.fr>.
* store: Slightly improve memoization hashing.Ludovic Courtès2013-01-30
| | | | | | | * guix/store.scm (open-connection): Call `make-hash-table' with 100. (add-text-to-store): Move TEXT first in ARGS, for better `hash' results. (add-to-store): Likewise, move ST first.
* store: Remove the `fixed?' parameter from `add-to-store'.Ludovic Courtès2013-01-30
| | | | | | | | * guix/store.scm (add-to-store): Remove the `fixed?' parameter from the public interface. * gnu/packages/bootstrap.scm, guix-download.in, guix/derivations.scm, guix/packages.scm, tests/derivations.scm: Update all callers accordingly.
* store: Avoid use of `set!'.Ludovic Courtès2013-01-30
| | | | | | | | | * guix/store.scm (operation): New macro. (define-operation): Define in terms of `operation'. (add-text-to-store): Define using `operation', and remove now unnecessary `set!'. (add-to-store): Likewise. (add-text-to-store/cached, add-to-store/cached): Remove.
* store: Micro-optimize `write-string'.Ludovic Courtès2013-01-30
| | | | | | * guix/store.scm (write-string): Optimize to write the length, contents, and padding all at once. This yields a 2% improvement on the execution time of "guix-build gdb".
* store: Cache `add-text-to-store' results.Ludovic Courtès2013-01-30
| | | | | | | | * guix/store.scm (<nix-server>)[atts-cache]: New field. (add-text-to-store/cached): New procedure. Use it as a wrapper around `add-text-to-store'. When running "guix-build gdb", this reduces the number of RPCs from 3048 to 289, and execution time from 4.7s to 2.6s.
* store: Make the `add-to-store' cache per-connection.Ludovic Courtès2013-01-30
| | | | | | | * guix/store.scm (<nix-server>)[ats-cache]: New field. (open-connection): Update accordingly. (add-to-store/cached): Use (nix-server-add-to-store-cache SERVER) instead of a weak hash table.
* store: Make `add-to-store' memoizing.Ludovic Courtès2013-01-29
| | | | | | | * guix/store.scm (add-to-store/cached): New variable. Use it as the new `add-to-store'. This reduces the number of RPCs when doing "guix-build gdb" from 5009 to 3053, and the execution time from 7s to 3.9s.
* doc: Start documenting (guix store).Ludovic Courtès2013-01-15
| | | | | | * doc/guix.texi (The Store): Populate. (Introduction): Add cross-reference. Change "package store" to "the store".
* store: In `open-connection', process all the server's stderr.Ludovic Courtès2013-01-13
| | | | * guix/store.scm (open-connection): Loop until `process-stderr' returns #t.
* Update license headers.Ludovic Courtès2013-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all license headers, except guix/build/* and ld-wrapper.scm, with this code: (use-modules (guix build utils) (srfi srfi-1)) (fluid-set! %default-port-encoding "UTF-8") (substitute* (remove (lambda (f) (or (string-contains f ".tar.") (string-contains f ".git/") (string-contains f ".so") (string-suffix? ".o" f) (string-suffix? ".a" f) (string-suffix? ".go" f) (string-suffix? ".pdf" f) (string-suffix? ".png" f) (string-suffix? ".info" f) (equal? (basename f) "guix-daemon") (equal? (basename f) "nix-setuid-helper") (string-contains f "nix-upstream/") (string-contains f "distro/packages/bootstrap/"))) (find-files "." "\\.[a-z]+$")) (("^([[:graph:]]+) This file is part of Guix." _ comment-start) (string-append comment-start " This file is part of GNU Guix.")) (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start) (string-append comment-start " GNU Guix --- Functional package management for GNU\n")) (("^([[:graph:]]+) Guix is " _ comment-start) (string-append comment-start " GNU Guix is ")) (("^([[:graph:]]+) along with Guix." _ comment-start) (string-append comment-start " along with GNU Guix.")) (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start) (string-append comment-start " Copyright ©"))) Change headers using C-style comments manually.
* Merge branch 'master' into nix-integrationLudovic Courtès2012-12-09
|\ | | | | | | | | Conflicts: guix/store.scm
| * store: Add GC-related operations.Ludovic Courtès2012-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/store.scm (gc-action): New enumerate type. (read-long-long, read-string-list, write-store-path, write-store-path-list, read-store-path-list): New procedures. (write-arg): Add support for `store-path' and `store-path-list'. (read-arg): Add support for `store-path-list'. (define-operation): Add support for multiple-value returns. (run-gc, live-paths, dead-paths, collect-garbage, delete-paths): New procedures. (%long-long-max): New macro. * tests/store.scm: New file. * Makefile.am (TESTS): Add it.
| * store: Add `add-temp-root'.Ludovic Courtès2012-12-09
| | | | | | | | * guix/store.scm (add-temp-root): New procedure.
* | build: Capture configure-time settings in (guix config).Ludovic Courtès2012-12-06
|/ | | | | | | | | | | * configure.ac: Compute and substitute `guix_localstatedir'. * m4/guix.m4: Substitute `guix_system'. * guix/config.scm.in (%store-directory, %store-directory, %system): New variables. * guix/store.scm (%nix-state-dir): Remove. (%default-socket-path): Use %STATE-DIRECTORY as the default. (%store-prefix): Use %STORE-DIRECTORY as the default. * guix/utils.scm (%current-system): Default to %SYSTEM.
* store: Honor $NIX_STORE_DIR and $NIX_STATE_DIR.Ludovic Courtès2012-12-04
| | | | | * guix/store.scm (%nix-state-dir): Honor $NIX_STATE_DIR. (%store-prefix): Honor $NIX_STORE_DIR.
* store: Document `add-to-store' hack for `fixed?'.Ludovic Courtès2012-11-08
| | | | * guix/store.scm (add-to-store): Document that `fixed?' must be #t.
* store: Add `store-path-package-name'.Ludovic Courtès2012-11-01
| | | | | * guix/store.scm (store-path-package-name): New procedure. * tests/utils.scm ("store-path-package-name"): New test.
* guix-build: Add `--root'.Ludovic Courtès2012-10-30
| | | | | | | | * guix/store.scm (add-indirect-root): New operation. * guix-build.in (show-help): Document `--root'. (%options): Add `--root'. (guix-build)[register-root]: New procedure. Call it when `--root' is passed.
* store: Add `query-path-hash'.Ludovic Courtès2012-10-24
| | | | | | | | | * guix/store.scm (write-arg, read-arg): Add `base16' literal and corresponding rule. (query-path-hash): New operation. * tests/derivations.scm ("fixed-output derivation"): Check whether `query-path-hash' returns a bytevector.
* distro: Add a statically-linked, relocatable Guile 2.0 package.Ludovic Courtès2012-10-13
| | | | | | | | * distro/packages/base.scm (%guile-static, %guile-static-stripped): New variables. * distro/patches/guile-relocatable.patch: New file. * Makefile.am (dist_patch_DATA): Add it.
* Optimize `store-path?'.Ludovic Courtès2012-09-01
| | | | | * guix/store.scm (store-path?): Check with `string-prefix?' instead of a regexp.
* Add `close-connection'.Ludovic Courtès2012-08-22
| | | | * guix/store.scm (close-connection): New procedure.
* Upgrade Nix worker protocol.Ludovic Courtès2012-07-02
| | | | | | | | | We were already relying on the new version in `set-build-options', so this patch fixes that. * guix/store.scm (%protocol-version): Increase. (open-connection)[reserve-space?]: New argument. Pass it to the server when it's recent enough.
* Add the `valid-path?' RPC.Ludovic Courtès2012-07-01
| | | | | | | | | | | * guix/store.scm (valid-path?): New procedure. * tests/builders.scm ("http-fetch", "gnu-build"): Use it. * tests/derivations.scm ("add-to-store, flat", "add-to-store, recursive", "derivation with no inputs", "build derivation with 1 source", "build derivation with coreutils", "build-expression->derivation with expression returning #f"): Likewise.
* Add missing `set-build-options' parameters.Ludovic Courtès2012-07-01
| | | | | | | | * guix/store.scm (set-build-options)[build-cores, use-substitutes?]: New keyword parameters. [send]: Change to expect a type, and use `write-arg'. Send settings for BUILD-CORES and USE-SUBSTITUTES? when the server supports it.
* store: Wait for the server to be done sending output.Ludovic Courtès2012-06-16
| | | | | | | | | | | * guix/store.scm (current-build-output-port): New variable. (process-stderr): Add docstring. Always return #f, except upon %STDERR-LAST. Upon %STDERR-NEXT, write to `current-build-output-port', not `current-error-port'. (set-build-options): Loop until `process-stderr' returns true. (define-operation): Likewise. (build-derivations): Update docstring to mention that it's synchronous.
* Add `add-to-store' with recursive directory storage.Ludovic Courtès2012-06-10
| | | | | | | | * guix/store.scm (write-file): Implement directory recursive dump. (add-to-store): Fix the parameter list. * tests/derivations.scm (directory-contents): New procedure. ("add-to-store, recursive"): New test.
* First stab at the `derivation' primitive.Ludovic Courtès2012-06-03
| | | | | | | | | | | | | * guix/store.scm (%store-prefix): New parameter. (store-path?, derivation-path?): New procedures. * guix/derivations.scm (write-derivation): Pass SOURCES through `object->string'. (compressed-hash, store-path, output-path, derivation): New procedures. * tests/derivations.scm (%store): New global variable. ("derivation with no inputs"): New test.
* store: Raise error conditions upon protocol errors.Ludovic Courtès2012-06-02
| | | | | | | | * guix/store.scm (&nix-error, &nix-protocol-error): New SRFI-35 condition types. (process-stderr): Raise an error condition upon protocol errors instead of returning to the caller. This allows the connection to be reused for further interactions.
* Split (guix) in (guix store) and (guix derivations).Ludovic Courtès2012-04-18
* guix.scm: Move contents to other files. Just aggregate these. * guix/derivations.scm, guix/store.scm: New files.