This allows editors to parse warnings correctly.
* guix/scripts/lint.scm (emit-warning): Use 'format' instead of
'warning', to avoid the "guix lint: " prefix in messages.
* tests/lint.scm (call-with-warnings): Indent.
* guix/profiles.scm (manifest-lookup): New procedure.
(manifest-installed?): Use it.
(manifest-transaction-effects): Return a pair of entries for upgrades.
(right-arrow): New procedure.
(manifest-show-transaction)[upgrade-string, →]: New variables.
Report upgrades using 'upgrade-string'.
* tests/profiles.scm ("manifest-show-transaction"): New test.
("manifest-transaction-effects"): Match UPGRADE against a pair.
* nix/nix-daemon/guix-daemon.cc (main): Set 'autoStoreOptimise' to
true. Add 'printMsg' call.
* tests/derivations.scm ("identical files are deduplicated"): New test.
* guix/profiles.scm (manifest-transaction-effects): New procedure.
(manifest-show-transaction): Use it instead of locally computing it.
* tests/profiles.scm (glibc): New variable.
("manifest-transaction-effects"): New test.
Fixes <http://bugs.gnu.org/18305>.
Reported by Brandon Invergo <brandon@gnu.org>.
* guix/profiles.scm (manifest-inputs, info-dir-file): New procedures.
(profile-derivation): Use them. Add #:info-dir? parameter and honor
it.
* guix/scripts/package.scm (guix-package): Call 'profile-derivation'
with #:info-dir? #f when the 'bootstrap? option is set.
* tests/profiles.scm ("profile-derivation"): Pass #:info-dir? #f.
* guix/profiles.scm (<manifest-transaction>): New record-type.
(manifest-perform-transaction): New procedure.
(manifest-show-transaction): New procedure.
* tests/profiles.scm ("manifest-perform-transaction"): New test.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* guix/gexp.scm (<gexp>)[natives]: New field.
(write-gexp): Use both 'gexp-references' and
'gexp-native-references'.
(gexp->derivation): Use both 'gexp-inputs' and 'gexp-native-inputs',
and append them.
(gexp-inputs): Add 'references' parameter and honor it.
(gexp-native-inputs): New procedure.
(gexp->sexp)[reference->sexp]: Add 'native?' parameter and honor it.
Use it, and use 'gexp-native-references'.
(gexp)[collect-native-escapes]: New procedure.
[escape->ref]: Handle 'ungexp-native' and 'ungexp-native-splicing'.
[substitute-ungexp, substitute-ungexp-splicing]: New procedures.
[substitute-references]: Use them, and handle 'ungexp-native' and
'ungexp-native-splicing'.
Adjust generated 'make-gexp' call to provide both normal references
and native references.
[read-ungexp]: Support 'ungexp-native' and
'ungexp-native-splicing'.
Add reader extension for #+.
* tests/gexp.scm (gexp-native-inputs): New procedure.
(gexp->sexp*): Add 'target' parameter.
("ungexp + ungexp-native",
"input list + ungexp-native",
"input list splicing + ungexp-native-splicing",
"gexp->derivation, ungexp-native",
"gexp->derivation, ungexp + ungexp-native"): New tests.
("sugar"): Add tests for #+ and #+@.
* doc/guix.texi (G-Expressions): Document 'ungexp-native' et al.
* guix/gexp.scm (lower-inputs): Add #:system and #:target. Use
'package->cross-derivation' when TARGET is true. Honor SYSTEM.
(gexp->derivation): Add #:target argument. Pass SYSTEM and TARGET to
'lower-inputs' and 'gexp->sexp'.
(gexp->sexp): Add #:system and #:target. Pass them in recursive call
and to 'package-file'.
* tests/gexp.scm (gexp->sexp*): Add 'system' and 'target' parameters.
("gexp->derivation, cross-compilation"): New test.
* guix/monads.scm (package-file): Add #:target keyword parameter and
honor it.
(package->cross-derivation): New procedure.
* tests/monads.scm ("package-file + package->cross-derivation"): New test.
* doc/guix.texi (The Store Monad): Update 'package-file' documentation.
Add 'package->cross-derivation'.
Fixes <http://bugs.gnu.org/17468>.
* guix/ui.scm (fill-paragraph): Two spaces after period and no spaces before newline.
* tests/ui.scm: New test case.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Suggested by Alex Kost <alezost@gmail.com>.
* guix/scripts/package.scm (options->installable)[package->manifest-entry]:
Move to (guix profiles).
[package->manifest-entry*]: New procedure.
Use it.
* guix/profiles.scm (package->manifest-entry): New procedure.
* tests/profiles.scm (guile-for-build): New variable.
Call '%guile-for-build'.
("profile-derivation"): New test.
* guix/profiles.scm (<manifest-entry>)[path]: Rename to...
[item]: ... this. Update users.
(manifest->sexp): Rename to...
(manifest->gexp): ... this. Return a gexp.
(lower-input): Remove.
(profile-derivation): Remove 'store' parameter, and turn into a
monadic procedure.
[inputs]: New variable.
[builder]: Turn into a gexp.
Replace call to 'build-expression->derivation' with call to
'gexp->derivation'.
* guix/scripts/package.scm (link-to-empty-profile): Adjust call to
'profile-derivation', and wrap it in 'run-with-store'.
(show-what-to-remove/install): Rename 'path' to 'item'. Check whether
ITEM is a package, and return its output path if it is.
(input->name+path): Remove.
(options->installable): Set 'item' to P.
(guix-package): Adjust call to 'profile-derivation'.
* tests/profiles.scm (guile-2.0.9): Change 'path' to 'item'.
* tests/guix-register.sh: Remove redundant $new_store in $NIX_STATE_DIR,
introduced in 689142cd ("guix-register: Add '--state-directory'
parameter.") Reported by Eric Bavier <ericbavier@gmail.com> and
Alen Skondro <askondro@gmail.com>.
* nix/guix-register/guix-register.cc (GUIX_OPT_STATE_DIRECTORY): New
macro.
(parse_opt): Honor it.
* tests/guix-register.sh: Add test with '--state-directory'.
* guix/store.scm (register-path): Add #:state-directory parameter.
* guix/records.scm (define-record-type*)[record-inheritance]: Check for
unexpected field names.
* tests/records.scm ("define-record-type* with let* behavior"): Return
#t, not *unspecified*.
("define-record-type* & inherit & extra initializers"): New test.
* tests/records.scm (test-module): New procedure.
("define-record-type* & missing initializers",
"define-record-type* & extra initializers"): New tests.
Partly fixes <http://bugs.gnu.org/18002>.
Reported by David Thompson <dthompson2@worcester.edu>.
* guix/gexp.scm (gexp->derivation): Change #:system to default #f.
Use (%current-system) from within the 'mlet*'.
* tests/gexp.scm ("gexp->derivation, default system"): New test.
* guix/monads.scm (mapm): Don't reverse LST, so that items are processed
from left to right. Bind the result of 'foldm' and reverse it.
* tests/monads.scm ("sequence"): Change 'frob' so it performs its side
effect within an 'mlet' body. Adjust call accordingly.
Fixes <http://bugs.gnu.org/17939>.
Reported by Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>.
* guix/scripts/package.scm (canonicalize-profile): New procedure.
(%options): Use it for --profile.
* tests/guix-package.sh: Add test.
* guix/scripts/system.scm (read-operating-system) <catch handler>: Add
case for 'syntax-error'. Correct message for default case.
* guix/scripts/offload.scm (build-machines) <catch handler>: Add case
for 'syntax-error'.
* tests/guix-system.sh: New file.
* Makefile.am (SH_TESTS): Add it.
* guix/ui.scm (%guix-user-module): New variable.
(read/eval): Pass it as the second argument to 'eval'.
* guix/scripts/build.scm (options/resolve-packages): Add case for
'gexp?'.
* tests/guix-build.sh: Add tests.
* doc/guix.texi (Invoking guix build): Document '-e gexp'.
guxi build: Allow gexps to be passed to '-e'.
* guix/ui.scm (%guix-user-module): New variable.
(read/eval): Pass it as the second argument to 'eval'.
* guix/scripts/build.scm (options/resolve-packages): Add case for
'gexp?'.
* tests/guix-build.sh: Add tests.
* doc/guix.texi (Invoking guix build): Document '-e gexp'.
* tests/gexp.scm (shebang): New variable.
Skip "gexp->script" when SHEBANG is longer than 127 chars.
* guix/gexp.scm (gexp->script): Add comment on the issue.
* guix/ui.scm (show-what-to-build)[built-or-substitutable?]: New
procedure. Check whether OUT is #f.
Use it.
* tests/ui.scm ("show-what-to-build, zero outputs"): New test.
* guix/monads.scm: Unexport 'lower-inputs' and 'derivation-expression'.
(text-file*): Add comment about the switch to 'gexp->derivation'.
(lower-inputs): Add comment about its doom.
(derivation-expression): Likewise.
* guix/gexp.scm (lower-inputs*): Rename to...
(lower-inputs): ... this. Update callers.
* tests/monads.scm (derivation-expression): New procedure.
* doc/guix.texi (The Store Monad): Use 'gexp->derivation' instead of
'derivation-expression'. Remove documentation of
'derivation-expression'.
* guix/ui.scm (read/eval): Use THE-ROOT-MODULE so that macros are
properly expanded.
* tests/guix-build.sh: Use 'gexp->derivation' instead of
'derivation-expression'.monads: Hide 'derivation-expression' and 'lower-inputs'.
* guix/gexp.scm: New file.
* tests/gexp.scm: New file.
* Makefile.am (MODULES): Add guix/gexp.scm.
(SCM_TESTS): Add tests/gexp.scm.
* doc/guix.texi (Derivations): Add #:inputs in 'derivation' example.
Mark 'build-expression->derivation' as deprecated, refer to
"G-Expressions". Remove paragraph about code strata.
(G-Expressions): New node.
Fixes <http://bugs.gnu.org/17312>.
* guix/scripts/authenticate.scm (guix-authenticate): Add calls to
'set-port-encoding!' and 'set-port-conversion-strategy!'. Wrap body
in 'with-fluids' form that sets '%default-port-encoding' and
'%default-port-conversion-strategy'.
* tests/guix-authenticate.sh: Add test.
* tests/pk-crypto.scm ("hash corrupt due to restrictive locale
encoding"): Add reference to bug.
* guix/pk-crypto.scm (string->canonical-sexp): Pass "ISO-8859-1" as the
2nd argument to 'string->pointer'.
* tests/pk-crypto.scm ("version"): New test.
("hash corrupt due to restrictive locale encoding"): New test.