Commit Graph

30 Commits

Author SHA1 Message Date
Ludovic Courtès c63d94035f store: Add 'verify-store' RPC.
* guix/store.scm (operation-id): Add 'verify-store'.
  (verify-store): New procedure.
  (set-build-options): Adjust comment.
* tests/store.scm ("verify-store", "verify-store + check-contents"): New
  tests.
2015-06-06 19:05:25 +02:00
Ludovic Courtès 2abcc97fd1 ui: Auto-compile user code, and improve error reporting.
Reported by Christian Grothoff.

* guix/ui.scm (load*): Add 'frame-with-source'.  Set
  %load-should-auto-compile.  Change error handle to just (exit 1).  Add
  pre-unwind handler to capture the stack and call 'report-load-error'.
  (report-load-error): Add optional 'frame' parameter and pass it to
  'display-error'.
* tests/guix-system.sh: Add "unbound variable" test.
2015-05-25 21:34:23 +02:00
Ludovic Courtès d664f1b431 profiles: Generate an 'etc/profile' file.
Suggested by 宋文武 <iyzsong@gmail.com>
in <http://bugs.gnu.org/20255>.

* guix/build/profiles.scm (abstract-profile,
  write-environment-variable-definition): New procedures.
  (build-profile): Add #:search-paths parameter.  Create
  OUTPUT/etc/profile.
* guix/profiles.scm (profile-derivation)[builder]: Add 'search-paths'
  variable and pass it to 'build-profile'.  Adjust #:modules argument.
* tests/profiles.scm ("etc/profile"): New test.
* doc/guix.texi (Invoking guix package): Mention etc/profile.
2015-05-06 18:26:54 +02:00
Ludovic Courtès 8ddc41e1f2 utils: Add 'modify-phases'.
* guix/build/utils.scm (modify-phases): New macro.
2015-02-26 22:48:39 +01:00
Taylan Ulrich B b1ec2233a1 Set Emacs indentation for `wrap-program'.
* .dir-locals.el (scheme-mode): Set `scheme-indent-function' of `wrap-program'
  to 1.
2015-02-02 17:22:36 -05:00
Ludovic Courtès e6c8839c18 tests: Add 'with-derivation-substitute' and use it.
* guix/tests.scm (%substitute-directory): New variable.
  (call-with-derivation-narinfo): Use it.
  (call-with-derivation-substitute): New procedure.
  (with-derivation-substitute): New macro.
* tests/store.scm ("substitute"): Use 'with-derivation-substitute'.
  ("substitute, corrupt output hash"): Likewise.
2015-02-02 12:46:35 +01:00
Ludovic Courtès 6eebbab562 tests: Further factorize substitute mocks.
* guix/tests.scm (derivation-narinfo): Turn 'nar' into a keyword
  parameter.  Add #:sha256 parameter, and honor it.
  (call-with-derivation-narinfo): Add #:sha256 and pass it to
  'derivation-narinfo'.
  (with-derivation-narinfo): Extend with support for (sha256 => value).
* tests/store.scm ("substitute query"): Use 'with-derivation-narinfo'.
  ("substitute"): Likewise.
  ("substitute, corrupt output hash"): Likewise.
  ("substitute --fallback"): Likewise.
* tests/derivations.scm: Remove Emacs local variable.
2015-02-02 12:46:35 +01:00
Ludovic Courtès 81a97734e0 monads: Add the state monad.
* guix/monads.scm (state-return, state-bind, run-with-state,
  current-state, set-current-state, state-push, state-pop): New
  procedures.
  (%state-monad): New variable.
* tests/monads.scm (%monads): Add %STATE-MONAD.
  (%monad-run): Add 'run-with-state'.
  (values->list): New macro.
  ("set-current-state", "state-push etc."): New tests.
2015-01-17 23:45:48 +01:00
Ludovic Courtès 21caa6deeb monads: Add 'mwhen' and 'munless'.
* guix/monads.scm (mbegin): Add special '%current-monad' syntactic
  keyword.
  (mwhen, munless): New macros.
2014-12-02 16:51:43 +01:00
Ludovic Courtès 969df97487 derivations: Introduce 'graft' record type.
* guix/derivations.scm (<graft>): New record type.
  (graft-derivation): Rename 'replacements' to 'grafts', and expect it
  to be a list of <graft> records.  Adjust accordingly.
* tests/derivations.scm ("graft-derivation"): Use 'graft' instead of
  pairs in argument to 'graft-derivation'.
2014-10-17 23:23:20 +02:00
Ludovic Courtès d53e8ba6b5 Augment '.dir-locals.el' with bug-reference-mode settings. 2014-10-12 00:14:09 +02:00
Ludovic Courtès 405a9d4ec9 monads: Add 'mbegin'.
* guix/monads.scm (mbegin): New macro.
* tests/monads.scm ("mbegin"): New test.
* doc/guix.texi (The Store Monad): Document it.
2014-10-08 23:35:20 +02:00
Ludovic Courtès 0d5a559f0f build-system: Introduce "bags" as an intermediate representation.
* guix/build-system.scm (<build-system>)[build, cross-build]: Remove.
  [lower]: New field.
  (<bag>): New record type.
  (make-bag): New procedure.
* guix/packages.scm (bag-transitive-inputs, bag-transitive-build-inputs,
  bag-transitive-host-inputs, bag-transitive-target-inputs,
  package->bag): New procedures.
  (package-derivation): Use it; use the bag, apply its build procedure,
  etc.
  (package-cross-derivation): Likewise.
* gnu/packages/bootstrap.scm (raw-build, make-raw-bag): New procedure.
  (%bootstrap-guile): Use them.
* guix/build-system/trivial.scm (lower): New procedure.
  (trivial-build, trivial-cross-build): Remove 'source' parameter.  Pass
  INPUTS as is.
  (trivial-build-system): Adjust accordingly.
* guix/build-system/gnu.scm (%store, inputs-search-paths,
  standard-search-paths, expand-inputs, standard-inputs): Remove.
  (gnu-lower): New procedure.
  (gnu-build): Remove 'source' and #:implicit-inputs? parameters.
  Remove 'implicit-inputs' and 'implicit-search-paths' variables.  Get
  the source from INPUT-DRVS.
  (gnu-cross-build): Likewise.
  (standard-cross-packages): Remove call to 'standard-packages'.
  (standard-cross-inputs, standard-cross-search-paths): Remove.
  (gnu-build-system): Remove 'build' and 'cross-build'; add 'lower'.
* guix/build-system/cmake.scm (lower): New procedure.
  (cmake-build): Remove 'source' and #:cmake parameters.  Use INPUTS and
  SEARCH-PATHS as is.  Get the source from INPUTS.
* guix/build-system/perl.scm: Likewise.
* guix/build-system/python.scm: Likewise.
* guix/build-system/ruby.scm: Likewise.
* gnu/packages/cross-base.scm (cross-gcc): Change "cross-linux-headers"
  to "linux-headers".
  (cross-libc)[xlinux-headers]: Pass #:implicit-cross-inputs? #f.
  Likewise.  In 'propagated-inputs', change "cross-linux-headers" to
  "linux-headers".
* guix/git-download.scm (git-fetch): Use 'standard-packages' instead of
  'standard-inputs'.
* tests/builders.scm ("gnu-build-system"): Remove use of
  'build-system-builder'.
  ("gnu-build"): Remove 'source' and #:implicit-inputs? arguments to
  'gnu-build'.
* tests/packages.scm ("search paths"): Adjust to new build system API.
  ("package-cross-derivation, no cross builder"): Likewise.
* doc/guix.texi (Build Systems): Add paragraph on bags.
2014-10-05 21:58:42 +02:00
Ludovic Courtès 667b250846 gexp: Add 'ungexp-native' and 'ungexp-native-splicing'.
* 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.
2014-08-18 15:01:58 +02:00
Mark H Weaver 75f3b1a12d Add (guix build emacs-utils).
* guix/build/emacs-utils.scm: New file.
* Makefile.am (MODULES): Add it.
* .dir-locals.el: Add indentation rules.
2014-08-14 23:53:04 -04:00
Ludovic Courtès 83bcd0b895 system: Add first-class file system declarations.
* gnu/system.scm (<operating-system>)[initrd]: Default to
  'qemu-initrd'.
  (<file-system>): New record type.
  (operating-system-root-file-system): New procedure.
  (operating-system-derivation): Take the device name for GRUB from
  'operating-system-root-file-system'.  Pass the
  'operating-system-initrd' procedure the list of boot file systems.
* gnu/system/linux-initrd.scm (file-system->spec): New procedure.
  (qemu-initrd): Add 'file-systems' parameter, and remove #:mounts
  parameter.
  [file-system-type-predicate]: New procedure.
  [linux-modules]: Use it.
  Adjust #:mounts argument in 'boot-system' call.
  (gnu-system-initrd): Remove.
* gnu/system/vm.scm (%linux-vm-file-systems): New variable.
  (expression->derivation-in-linux-vm): Adjust call to 'qemu-initrd'.
  (virtualized-operating-system): New procedure.
  (system-qemu-image/shared-store-script)[initrd]: Remove.  Use
  'virtualized-operating-system'.  Get the 'initrd' file from OS-DRV.
* guix/build/linux-initrd.scm (mount-qemu-smb-share, mount-qemu-9p):
  Remove.
  (MS_RDONLY, MS_BIND): New global variables.
  (bind-mount): Remove local 'MS_BIND' definition.
  (mount-root-file-system): New procedure, with code formerly in
  'boot-system'.
  (mount-file-system): New procedure.
  (boot-system): Add #:root-fs-type parameter.  Remove 'MS_RDONLY' local
  variable.  Use 'mount-root-file-system' and 'mount-file-system'.
* doc/guix.texi (Using the Configuration System): Add 'file-system'
  declaration.
2014-05-03 00:46:51 +02:00
Ludovic Courtès 21b679f694 Add (guix gexp).
* 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.
2014-04-28 23:24:17 +02:00
Ludovic Courtès 81deef270d pki: Add 'signature-case' macro.
* guix/pki.scm (%signature-status): New procedure.
  (signature-case): New macro.
* tests/pki.scm (%secret-key, %alternate-secret-key): New variables.
  ("signature-case valid-signature", "signature-case invalid-signature",
  "signature-case hash-mismatch", "signature-case unauthorized-key",
  "signature-case corrupt-signature"): New tests.
2014-03-31 23:34:20 +02:00
Ludovic Courtès 01ac19dca4 utils: Add 'call-with-decompressed-port' and 'call-with-compressed-output-port'.
* guix/utils.scm (call-with-decompressed-port,
  call-with-compressed-output-port): New procedures.
* tests/utils.scm ("compressed-output-port + decompressed-port"):
  Rewrite to use them.
2014-03-24 22:15:29 +01:00
Ludovic Courtès ce4a482983 store: Add 'with-store' convenience macro.
* guix/store.scm (with-store): New macro.
2014-01-24 00:01:49 +01:00
Ludovic Courtès 04d4c8a439 Move 'with-atomic-file-output' to (guix utils).
* guix/scripts/substitute-binary.scm (with-atomic-file-output): Move to...
* guix/utils.scm (with-atomic-file-output): ... here.
2013-12-29 15:57:24 +01:00
Ludovic Courtès 35ef363300 Add indentation rule for 'origin'. 2013-11-07 00:18:20 +01:00
Ludovic Courtès a20787706c guix package: Allow removal of a specific package output.
Fixes <http://bugs.gnu.org/15756>.

* guix/profiles.scm (<manifest-pattern>): New record type.
  (remove-manifest-entry): Remove.
  (entry-predicate, manifest-matching-entries): New procedures.
  (manifest-remove): Accept a list of <manifest-pattern>.
  (manifest-installed?): Replace 'name' parameter by 'pattern', a
  <manifest-pattern>.
* guix/scripts/package.scm (options->removable): Return a list of
  <manifest-pattern>.
  (guix-package)[process-action]: Use 'manifest-matching-entries' to
  compute the list of packages to remove.
* tests/profiles.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
2013-11-01 23:21:01 +01:00
Mark H Weaver 2a8417ac44 Change indentation rule for 'package' for the common case.
* .dir-locals.el: Change the indentation rule for 'package' to do the right
  thing for packages without an inherit clause.
2013-10-29 12:19:44 -04:00
Ludovic Courtès b860f38244 Add (guix monads).
* guix/monads.scm: New file.
* tests/monads.scm: New file.
* Makefile.am (MODULES): Add guix/monads.scm.
  (SCM_TESTS): Add tests/monads.scm.
* doc/guix.texi (The Store Monad): New node.
  (The Store): Reference it.
2013-10-03 23:12:20 +02:00
Ludovic Courtès 0332386251 substitute-binary: Work around thread-unsafe `regexp-exec'.
* guix/scripts/substitute-binary.scm (%regexp-exec-mutex): New variable.
  (string->uri): New procedure.
  (fields->alist): Wrap `regexp-exec' call in `with-mutex'.
2013-05-14 23:53:38 +02:00
Ludovic Courtès 0bdba772ca Augment `.dir-locals.el'.
* .dir-locals.el: Add more Scheme settings.
* guix-build.in, tests/base32.scm, tests/build-utils.scm,
  tests/builders.scm, tests/derivations.scm, tests/packages.scm,
  tests/snix.scm, tests/store.scm, tests/union.scm, tests/utils.scm:
  Remove redundant Emacs local variable settings.
2013-02-01 13:16:45 +01:00
Ludovic Courtès 5cfdcd6a26 .dir-locals.el: Fill at 78 columns. 2013-01-30 18:59:12 +01:00
Ludovic Courtès 073c34d72f Add (guix ui).
* guix/ui.scm: New file.
* Makefile.am (MODULES): Add it.
* po/POTFILES.in: Add it.

* guix-build.in: Use it.
  (_, N_, leave): Remove.
  (guix-build): Use `with-error-handling' instead of the `guard' form.
* guix-download.in: Use it.
  (_, N_, leave): Remove.
2012-11-01 00:52:44 +01:00
Ludovic Courtès 1722d6800f distro: Add the `guile', `typesetting', and `databases' package modules.
* distro.scm (package-files): Adjust PREFIX-LEN to use the top-level
  directory, not %DISTRO-MODULE-DIRECTORY.
* distro/packages/base.scm (guile-reader, guile-reader/guile-1.8,
  guile-reader/guile-2.0, lout, recutils): Move to...
* distro/packages/guile.scm, distro/packages/typesetting.scm,
  distro/packages/databases.scm: ... here.  New files.
* Makefile.am (MODULES): Add them.
  (EXTRA_DIST): Add `.dir-locals.el'.

* .dir-locals.el: New file, with settings formerly in `base.scm'.
2012-09-26 23:00:36 +02:00