* guix/derivations.scm (read-derivation): Rename to...
(%read-derivation): ... this.
(read-derivation): New procedure.
This reduces the execution of "guix-build gdb" from 2.5s to 1.7s.
* 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.
* 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.
* 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.
* 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".
* guix/ui.scm (install-locale): New procedure.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Use it instead of (setlocale LC_ALL "").
* 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.
* 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.
* 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.
Suggested by Andreas Enge <andreas@enge.fr> at
<http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00325.html>.
* guix-package.in (latest-profile-number): Remove.
(switch-symlinks): New procedure.
(roll-back)[switch-link]: Use it.
(guix-package)[process-actions]: Always choose NUMBER + 1 for the new
profile. Use `switch-symlinks' instead of `symlink'. Remove code to
delete PROFILE when it exists since `switch-symlinks' has the same
effect.
* tests/guix-package.sh: Adjust existing `--roll-back' tests.
* doc/guix.texi (Invoking guix-package): Document this `--roll-back'
behavior.
Suggested by Andreas Enge <andreas@enge.fr> at
<http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00316.html>.
* guix-package.in (roll-back): Check whether PROFILE is valid using
`file-exists?'. When NUMBER is zero, just emit a notice. When
PREVIOUS-NUMBER is zero and PREVIOUS-PROFILE does not exist, build the
empty profile, and link to it.
* tests/guix-package.sh: Add tests.
* doc/guix.texi (Invoking guix-package): Document the new behavior.
* guix/packages.scm (<package>)[inputs]: Mark as thunked.
(package-derivation)[expand-input]: Remove case where the input is a
procedure.
* tests/packages.scm ("trivial with system-dependent input"): Remove
`lambda', and use (%current-system).
* gnu/packages/bootstrap.scm (package-from-tarball): Likewise for `inputs'.
(%bootstrap-glibc, %bootstrap-gcc): Likewise.
* gnu/packages/scheme.scm (mit-scheme): Likewise.
* guix-package.in (guix-package)[parse-options]: Call `leave' when
passed a non-option argument.
Reported by Andreas Enge <andreas@enge.fr>.
* tests/guix-package.sh: Add test.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
* guix/utils.scm (define-record-type*)[make-syntactic-constructor]: Add
a `thunked' parameter.
(thunked-field?, field-bindings): New procedures. Use the latter when
generating `letrec*' bindings.
[thunked-field?, thunked-field-accessor-name, field-spec->srfi-9,
thunked-field-accessor-name]: New procedures.
Use them when generating the `define-record-type' form, and to
generated thunk field accessors, along call to
`make-syntactic-constructor' with the new argument.
* tests/utils.scm ("define-record-type* & thunked",
"define-record-type* & thunked & default",
"define-record-type* & thunked & inherited"): New tests.
* doc/guix.texi (Invoking guix-build): Make it clear that `guix-build'
doesn't access the user's profile, and add cross-ref to `guix-package'.
Suggested by Nikita Karetnikov <nikita@karetnikov.org>.