Commit Graph

948 Commits (2f4640e320a8834f618c7be5a7e8dba62da91190)

Author SHA1 Message Date
Ludovic Courtès 07254feb24 ui: Avoid circularity with (guix gexp).
Fixes a regression introduced in 56b8210 ("guix build: Allow gexps to be
passed to '-e'.")

* guix/ui.scm (%guix-user-module): Wrap in 'delay'.
  (read/eval): Adjust accordingly.
2014-06-14 23:23:56 +02:00
Ludovic Courtès 56b8210697 guix 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'.
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'.
2014-06-14 22:55:59 +02:00
Ludovic Courtès ee76417972 Separate package description translations from string translations.
* po/packages/LINGUAS, po/packages/Makevars, po/packages/POTFILES.in:
  New files.
* po/guix/Makevars (DOMAIN): Change to "guix".
  (XGETTEXT_OPTIONS): Remove "--keyword=synopsis --keyword=description".
* po/guix/POTFILES.in: Remove gnu/packages/*.scm.
* configure.ac: Change to gettext 0.18.3.  Produce
  po/packages/Makefile.in.
* Makefile.am (SUBDIRS): Add po/packages.
* guix/ui.scm (%package-text-domain): New variable.
  (P_): New procedure.
  (package->recutils): Use 'P_' instead of '_'.
* guix/scripts/package.scm (find-packages-by-description): Use 'P_'
  instead of 'gettext'.
2014-06-13 17:30:40 +02:00
Ludovic Courtès 9d0b8fbd78 pull: Copy and compile gnu.scm.
* guix/build/pull.scm (build-guix): Copy gnu.scm to OUT.
2014-06-13 11:42:33 +02:00
Ludovic Courtès b6b097ac81 guix build: Only 'guix build' sets #:print-build-trace.
This makes 'guix package' et al. slightly less verbose, by not emitting
"@ substituter-started" lines and similar.

* guix/scripts/build.scm (set-build-options-from-command-line): Pass
  #:print-build-trace.
  (%default-options): Add 'print-build-trace?'.
2014-06-09 18:55:48 +02:00
Ludovic Courtès f986c264b2 build-system/gnu: Add 'package-with-restricted-references'.
* guix/build-system/gnu.scm (package-with-restricted-references): New
  procedure.
2014-06-07 19:35:20 +02:00
Ludovic Courtès 872c69d00e Merge branch 'master' into core-updates 2014-06-06 17:23:14 +02:00
Ludovic Courtès b15d79dfe6 build-system/gnu: Add #:allowed-references.
* guix/build-system/gnu.scm (gnu-build): Add #:allowed-references.
  [canonicalize-reference]: New procedure.
  Pass #:allowed-references to 'build-expression->derivation'.
  (gnu-cross-build): Likewise.
2014-06-06 17:18:17 +02:00
Ludovic Courtès 63a4282468 derivations: 'build-expression->derivation' supports #:allowed-references.
* guix/derivations.scm (build-expression->derivation): Add
  #:allowed-references and pass it to 'derivation.
* doc/guix.texi (Derivations): Adjust accordingly.
2014-06-06 17:07:26 +02:00
Ludovic Courtès e97c5be914 services: Use a fixed GID for the build group and use that for the store.
This partly reverts commit 185f669 ("services: Make sure the store's
group is the build group.")

* gnu/services/base.scm (guix-service)[activate]: Remove 'chown' call.
  Add 'id' field to 'user-group' form.
* guix/build/install.scm (directives): Set the store's GID to 30000.
2014-06-06 00:28:21 +02:00
Ludovic Courtès e2fcc23a3a activation: Only create groups that do not exist yet.
Before that the effect would be to re-create groups at each boot, and
thus remove any members of the groups.

* guix/build/activation.scm (activate-users+groups): Call 'add-group'
  only when (getgrname name) fails.
2014-06-04 23:08:09 +02:00
Ludovic Courtès 185f669109 services: Make sure the store's group is the build group.
* gnu/services/base.scm (guix-service)[activate]: New variable.  Add
  'chown' call for (%store-prefix).  Set the 'activate' field to
  ACTIVATE.
* guix/build/install.scm (directives): Add comment about STORE's group.
2014-06-04 22:19:30 +02:00
Ludovic Courtès c17b5ab4db tests: Skip tests that would hit the shebang length limitation.
* 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.
2014-06-04 18:15:50 +02:00
Ludovic Courtès d4c87617e5 system: File system sources can be marked as labels or devices.
* gnu/system/file-systems.scm (<file-system>)[title]: New field.
* gnu/services/base.scm (file-system-service): Add #:title parameter.
  In 'start' gexp, use 'canonicalize-device-spec' and honor TITLE.
* gnu/system.scm (other-file-system-services,
  operating-system-root-file-system, operating-system-initrd-file):
  Adjust accordingly.
* gnu/system/linux-initrd.scm (file-system->spec): Likewise.
* gnu/system/vm.scm (system-disk-image): Add 'title' field for the root
  file system.
* guix/build/linux-initrd.scm (mount-file-system): Expect the second
  element of SPEC to be the title.
  (boot-system)[root-mount-point?, root-fs-type]: Likewise.
* gnu/services/dmd.scm (dmd-configuration-file): Select
  'canonicalize-device-spec'.
2014-06-03 00:14:58 +02:00
Ludovic Courtès 2405858a04 linux-initrd: Wait for devices to appear when resolving a label.
* guix/build/linux-initrd.scm (canonicalize-device-spec): Add #:title
  parameter.  When resolving a label, wait a little and try several
  times before bailing out.
2014-06-02 23:48:55 +02:00
Ludovic Courtès 9b4a163a87 linux-initrd: Actually create /dev/console.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Add
  "dev/console".
2014-06-01 23:51:12 +02:00
Ludovic Courtès b53be755e4 derivations: Add #:allowed-references 'derivation' parameter.
* guix/derivations.scm (derivation): Add #:allowed-references
  parameter.
  [user+system-env-vars]: Honor it.
* tests/derivations.scm ("derivation #:allowed-references, ok",
  "derivation #:allowed-references, not allowed",
  "derivation #:allowed-references, self allowed",
  "derivation #:allowed-references, self not allowed"): New tests.
* doc/guix.texi (Derivations): Document #:allowed-references.
2014-06-01 23:32:26 +02:00
Ludovic Courtès ac52e80b4e linux-initrd: Make more device nodes for SCSI disks and CD-ROM devices.
* guix/build/linux-initrd.scm (make-disk-device-nodes): New procedure.
  (make-essential-device-nodes): Use it.  Make more devices nodes for
  SCSI disks and CD-ROM devices.
2014-06-01 21:48:57 +02:00
Ludovic Courtès 009d831167 linux-initrd: Gracefully handle missing /dev nodes.
* guix/build/linux-initrd.scm (partition-label-predicate): Catch
  'system-error' around 'read-ext2-superblock'; return #f upon ENOENT.
2014-06-01 21:20:54 +02:00
Ludovic Courtès 1bb784ea05 linux-initrd: Gracefully deal with partitions with no label.
* guix/build/linux-initrd.scm (partition-label-predicate): Check whether
  'ext2-superblock-volume-name' returns #f, and return #f if it does.
2014-05-31 15:55:38 +02:00
Ludovic Courtès 85a83edb36 linux-initrd: Allow use of volume labels in 'file-system' declarations.
* guix/build/linux-initrd.scm (%ext2-endianness, %ext2-sblock-magic,
  %ext2-sblock-creator-os, %ext2-sblock-uuid, %ext2-sblock-volume-name):
  New macros.
  (read-ext2-superblock, ext2-superblock-uuid,
  ext2-superblock-volume-name, disk-partitions,
  partition-label-predicate, find-partition-by-label,
  canonicalize-device-spec): New procedures.
  (mount-file-system): Use 'canonicalize-device-spec' on SOURCE.
  (boot-system): Likewise for ROOT.
* doc/guix.texi (Using the Configuration System): Adjust 'file-system'
  declaration accordingly.
2014-05-30 23:46:17 +02:00
Ludovic Courtès ef9fc40dda vm: Allow a volume name to be specified for the root partition.
* guix/build/vm.scm (format-partition): Add #:label parameter, and honor
  it.
  (initialize-hard-disk): Add #:file-system-label parameter, and pass it
  to 'format-partition'.
* gnu/system/vm.scm (qemu-image): Add #:file-system-label parameter and
  pass it to 'initialize-hard-disk'.
2014-05-29 23:32:46 +02:00
Ludovic Courtès af018f5e0a Merge branch 'master' into core-updates 2014-05-27 23:19:49 +02:00
Ludovic Courtès 5895f24443 store: Work around 'get-bytevector-n' bug that affects 'import-paths'.
Fixes <http://bugs.gnu.org/17591>.

* guix/store.scm (process-stderr) <%stderr-read>: Use
  'get-bytevector-n!' instead of 'get-bytevector-n'.
2014-05-27 22:28:34 +02:00
Ludovic Courtès 884af1b4ec store: Remove misleading 'setsockopt' call.
* guix/store.scm (open-connection): Remove misleading 'setsockopt' call,
  erroneously introduced in df1fab58.  This would actually shrink the
  receive buffer from 124 KiB to 12 KiB, though it had little impact on
  performance.
2014-05-25 01:31:15 +02:00
Ludovic Courtès 4b2615e1ca services: nscd: Provide an 'activate' script to make /var/run/nscd.
* gnu/services/base.scm (nscd-service): Add 'activate' field.
* guix/build/install.scm (directives): Remove /var/run/nscd; add
  /var/run.
* doc/guix.texi (Defining Services): Add 'activate' field in example.
  Document it.
2014-05-24 18:10:05 +02:00
Ludovic Courtès 517830cc01 system: Always create /var/empty.
* guix/build/install.scm (directives): Add /var/empty.
2014-05-24 18:10:05 +02:00
Ludovic Courtès 484a2b3a5a system: Separate the activation script from the boot script.
* gnu/system.scm (operating-system-activation-script): New procedure,
  containing most of the former 'operating-system-boot-script'.
  (operating-system-boot-script): Call it, and 'primitive-load' its
  result.
* guix/build/activation.scm (%booted-system): Remove.
  (activate-current-system): Remove #:boot? parameter and related code.
2014-05-24 18:10:05 +02:00
Ludovic Courtès a68d976b66 download: Enlarge your receive buffer.
* guix/build/download.scm (open-connection-for-uri): Remove call to
  'setsockopt'.
* guix/http-client.scm (open-socket-for-uri)[rmem-max, buffer-size]: New
  variables.  Add call to 'setsockopt'.
2014-05-23 22:19:37 +02:00
Ludovic Courtès fb729425dc guix system: Add 'disk-image' action.
* guix/scripts/system.scm (show-help): Add 'disk-image'.
  (guix-system)[parse-options]: Support 'disk-image' action.
  [option-arguments]: Likewise.
  Handle the 'disk-image' action.
* doc/guix.texi (Invoking guix system): Document 'disk-image'.
2014-05-22 23:24:13 +02:00
Ludovic Courtès f19c6e5fe7 vm: Use a para-virtualized disk when creating an image.
* guix/build/vm.scm (load-in-linux-vm): When MAKE-DISK-IMAGE?, use
  '-drive ...,if=virtio' for better performance.
* gnu/system/vm.scm (qemu-image): Use /dev/vda instead of /dev/sda.
2014-05-22 23:24:13 +02:00
Ludovic Courtès c4a74364b9 vm: Make the image format a parameter.
* guix/build/vm.scm (load-in-linux-vm): Add #:disk-image-format
  parameter; add 'image-file' variable.  Honor DISK-IMAGE-FORMAT.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add
  #:disk-image-format parameter, and honor it.
  (qemu-image): Likewise.
2014-05-22 23:24:13 +02:00
Ludovic Courtès 3035b50f28 linux-initrd: Build /dev/loop* nodes.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Build
  /dev/loop[0-7].
2014-05-22 23:24:13 +02:00
Andreas Enge 6d763bdddb guix: download: Update imagemagick mirrors.
* guix/download.scm (%mirrors)[imagemagick]: Update and add the legacy
    subdirectory of the main site as a last resort.
2014-05-22 22:07:07 +02:00
Ludovic Courtès 641f9a2a1f vm: Modularize build-side code.
* guix/build/install.scm (install-grub): Call 'error' if 'system*'
  returns non-zero.
* guix/build/vm.scm (initialize-partition-table): Make 'partition-size'
  a positional parameter.  Call 'error' when 'system*' returns
  non-zero'.
  (format-partition, initialize-root-partition): New procedures.
  (initialize-hard-disk): Use them.
2014-05-21 23:31:46 +02:00
Ludovic Courtès d1f477199d vm: Remove misleading comment.
* guix/build/vm.scm (load-in-linux-vm): Remove misleading comment.
2014-05-21 23:19:13 +02:00
Ludovic Courtès d28869afad store: Flush the output when the build process emits '\r'.
This allows progress reports emitted by 'substitute-binary' to be
correctly displayed.

* guix/store.scm (%newlines): New variable.
  (process-stderr) <%stderr-next>: Flush (current-build-output-port)
  when S contains one of %NEWLINES.
2014-05-21 15:29:23 +02:00
Ludovic Courtès eb7ccb1afa linux-initrd: Display a backtrace when the initial program fails.
* guix/build/linux-initrd.scm (boot-system): Add pre-unwind handler in
  'catch' form around 'primitive-load', and call 'format' and
  'display-backtrace' from there.
2014-05-20 23:37:11 +02:00
Ludovic Courtès 9bea3b42b4 vm: Fix typo.
Regression introduced in e38e18f.

* guix/build/vm.scm (initialize-hard-disk)[partition]: Use a string.
2014-05-20 23:37:11 +02:00
Ludovic Courtès d84a7be667 utils: 'delete-file-recursively' doesn't follow mount points by default.
* guix/build/utils.scm (delete-file-recursively): Add #:follow-mounts?
  parameter and honor it.
2014-05-20 14:45:58 +02:00
Ludovic Courtès 52ddf2ae6f ui: Gracefully deal with zero-output derivations.
* 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.
2014-05-19 23:52:40 +02:00
Ludovic Courtès 79b0d4e104 guix system: Check whether we are installing to /.
* guix/scripts/system.scm (install): Check whether TARGET is / and warn.
2014-05-19 23:52:40 +02:00
Ludovic Courtès c56d19fb11 guix system: Factorize out closure copy.
* guix/scripts/system.scm (copy-closure): New procedure.
  (install): Use it.
2014-05-19 23:52:40 +02:00
Ludovic Courtès c79d54fe41 guix system: 'guix system init' installs GRUB by default.
* guix/scripts/system.scm (install): Add #:grub?, #:grub.cfg, and
  #:device parameters; honor them.
  (show-help): Document '--no-grub'.
  (%options): Add '--no-grub'.
  (%default-options): Add 'install-grub?'.
  (guix-system): Honor 'install-grub?' option from OPTS.  Adjust
  'install' call accordingly.
* doc/guix.texi (Invoking guix system): Document '--no-grub'.
2014-05-19 23:52:39 +02:00
Ludovic Courtès e38e18ff01 vm: Make the device name a parameter.
* guix/build/vm.scm (initialize-partition-table): Honor 'device'
  parameter.
  (initialize-hard-disk): Add 'device' parameter and honor it.
* gnu/system/vm.scm (qemu-image): Adjust accordingly.
2014-05-19 23:52:39 +02:00
Eric Bavier c711f07c3e guix: licenses: Add CeCILL-C license.
* guix/licenses.scm (cecill-c): New variable.
2014-05-19 00:15:11 -05:00
Ludovic Courtès 6ffd11f129 system: Prevent grub.cfg from being GC'd.
* guix/build/install.scm (install-grub): Use 'copy-file' instead of
  'symlink' for GRUB.CFG.
2014-05-18 22:27:23 +02:00
Ludovic Courtès 72b9d60df4 guix system: Add 'init' sub-command.
* guix/scripts/system.scm (install): New procedure.
  (guix-system)[parse-option]: Remove check for extraneous arguments.
  [match-pair, option-arguments]: New procedures.
  Use 'option-arguments'.  Honor 'init'.
  (show-help): Document 'init'.
* doc/guix.texi (Invoking guix system): Document 'init'.
2014-05-18 22:27:23 +02:00
Ludovic Courtès bb31e0a3ee store: Change #:store parameter to #:prefix.
* guix/store.scm (register-path): Change #:store to #:prefix.
2014-05-18 22:27:22 +02:00
Ludovic Courtès 15d299874c vm: Avoid resetting timestamps twice.
* guix/build/vm.scm (initialize-hard-disk): Don't call
  'reset-timestamps' when REGISTER-CLOSURES? is true.
* guix/build/install.scm (register-closure): Mention timestamps in
  docstring.
2014-05-18 22:27:22 +02:00
Ludovic Courtès b4140694ac system: Make /run/current-system at activation time.
* gnu/system.scm (etc-directory): Change default value of #:profile.
  Change contents of SHELLS.  Use /run/current-system/profile/{s,}bin in
  BASHRC.
  (operating-system-boot-script)[%modules]: Add (guix build
  linux-initrd).  Add call to 'activate-current-system' in gexp.
  (operating-system-initrd-file, operating-system-grub.cfg): New
  procedures.
  (operating-system-derivation): Don't build grub.cfg here and remove it
  from the file union.
* gnu/system/vm.scm (qemu-image): Remove #:populate.
  (operating-system-build-gid, operating-system-default-contents):
  Remove.
  (system-qemu-image): Remove call to
  'operating-system-default-contents'.  Use 'operating-system-grub.cfg'
  to get grub.cfg.  Add GRUB.CFG to #:inputs.
  (system-qemu-image/shared-store): Likewise, but don't add GRUB.CFG to
  #:inputs.
  (system-qemu-image/shared-store-script): Pass --system kernel option.
* guix/build/activation.scm (%booted-system, %current-system): New
  variables.
  (boot-time-system, activate-current-system): New procedures.
* guix/build/install.scm (evaluate-populate-directive): Add case
  for ('directory name uid gid mode).
  (directives, populate-root-file-system): New procedures.
* guix/build/vm.scm (initialize-hard-disk): Replace calls to
  'evaluate-populate-directive' by a call to
  'populate-root-file-system'.
* gnu/services/dmd.scm (dmd-configuration-file): Use
  /run/current-system/profile/bin.
* gnu/services/xorg.scm (slim-service): Likewise.
2014-05-18 00:04:01 +02:00
Ludovic Courtès e901ef297d store: Add #:store parameter to 'register-path'.
* guix/store.scm (register-path): Add #:store and honor it.
2014-05-17 00:08:39 +02:00
Ludovic Courtès 87a52da7d0 linux-initrd: Factorize kernel command-line option parsing.
* guix/build/linux-initrd.scm (find-long-option): New procedure.
  (boot-system): Use it instead of the local 'option'.
2014-05-16 23:31:48 +02:00
Ludovic Courtès 7889394e05 guix system: Add 'build' action.
* guix/scripts/system.scm (show-help): Document 'build' action.
  (guix-system): Honor 'build' action.
* doc/guix.texi (Invoking guix system): Add 'build' action.
2014-05-16 21:56:00 +02:00
Ludovic Courtès 4cca91832b authenticate: Add compatibility hack for Guile 2.0.5.
* guix/scripts/authenticate.scm (%default-port-conversion-strategy): New
  variable.  Reported by Andreas Enge <andreas@enge.fr>.
2014-05-16 10:22:19 +02:00
Ludovic Courtès 5ce3defed1 system: Add (guix build install) module.
* guix/build/vm.scm (install-grub, evaluate-populate-directive,
  reset-timestamps, register-closure): Move to...
* guix/build/install.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Add (guix
  build install) to #:modules.
2014-05-15 23:37:46 +02:00
Ludovic Courtès 150e20ddde vm: Support initialization of the store DB when the store is shared.
* gnu/system/vm.scm (qemu-image): Rename #:inputs-to-copy to #:inputs,
  and #:initialize-store? to #:register-closures?.  Add #:copy-inputs?.
  Adjust build gexp accordingly.
  (system-qemu-image): Remove #:initialize-store? argument and add
  #:copy-inputs?.
  (system-qemu-image/shared-store): Add #:inputs, #:register-closures?,
  and #:copy-inputs? arguments.
* guix/build/vm.scm (register-closure): New procedure.
  (MS_BIND): New variable.
  (initialize-hard-disk): Rename #:initialize-store? to
  #:register-closures?, #:closures-to-copy to #:closures, and add
  #:copy-closures?.
  Add 'target-directory' and 'target-store' variables.
  Call 'populate-store' only when COPY-CLOSURES?.
  Bind-mount the store to TARGET-STORE when REGISTER-CLOSURES? and not
  COPY-CLOSURES?.  Add call to 'register-closure'.
2014-05-15 22:55:14 +02:00
Ludovic Courtès f3b692acdd activation: Silence warning from 'useradd'.
* guix/build/activation.scm (add-user): Don't pass '--create-home' when
  HOME already exists.
2014-05-14 19:07:04 +02:00
Ludovic Courtès 7f17ff7841 linux-initrd: Make /dev/ttyS0, for debugging.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Make
  /dev/ttyS0.
2014-05-14 19:07:04 +02:00
Ludovic Courtès 7d57cfd3b6 system: When unionfs-fuse is used for /, don't kill it when halting.
* guix/build/linux-initrd.scm (pidof): New procedure.
  (mount-root-file-system)[mark-as-not-killable]: New procedure.
  Use it for unionfs when VOLATILE-ROOT?.
* gnu/services/base.scm (%do-not-kill-file): New variable.
  (user-processes-service)[stop]: Honor it.
2014-05-14 19:07:03 +02:00
Ludovic Courtès 17a4d34489 syscalls: Add 'processes' to list all the live processes.
* guix/build/syscalls.scm (kernel?, processes): New procedures.
2014-05-14 19:07:03 +02:00
Ludovic Courtès ab6a279abb system: Make accounts and groups at activation time.
* gnu/services/base.scm (guix-build-accounts): Remove #:gid parameter;
  add #:group.  Remove 'password' and 'gid' fields in 'user-account'
  form, and add 'group'.
  (guix-service): Remove #:build-user-gid parameter.  Remove 'id' field
  in 'user-group' form.
* gnu/system.scm (etc-directory): Remove #:groups and #:accounts.  No
  longer produce files "passwd", "shadow", and "group".  Adjust caller
  accordingly.
  (%root-account): New variable.
  (operating-system-accounts): Add 'users' variable.  Add %ROOT-ACCOUNT
  only of 'operating-system-users' doesn't already contain a root
  account.
  (user-group->gexp, user-account->gexp): New procedures.
  (operating-system-boot-script): Add calls to 'setenv' and
  'activate-users+groups' in gexp.
* gnu/system/linux.scm (base-pam-services): Add PAM services for
  "user{add,del,mode}" and "group{add,del,mod}".
* gnu/system/shadow.scm (<user-account>)[gid]: Rename to...
  [group]: ... this.
  [supplementary-groups]: New field.
  [uid, password]: Default to #f.
  (<user-group>)[id]: Default to #f.
  (group-file, passwd-file): Remove.
* gnu/system/vm.scm (operating-system-default-contents)[user-directories]:
  Remove.  Add "/home" to the directives.
* guix/build/activation.scm (add-group, add-user,
  activate-users+groups): New procedures.
2014-05-11 22:41:58 +02:00
Ludovic Courtès 023f391c78 services: Add 'file-system-service'.
* gnu/services/base.scm (file-system-service): New procedure.
  (user-processes-service): Add 'requirements' parameter.
* gnu/services/dmd.scm (dmd-configuration-file): Use (guix build
  linux-initrd).
* guix/build/linux-initrd.scm (guix): Export 'check-file-system'.
* gnu/system.scm (file-union): New procedure.
  (essential-services): Use it.  Add that to the returned list.
2014-05-10 23:33:52 +02:00
Ludovic Courtès 29fa45f45d Add (guix build syscalls).
* guix/build/syscalls.scm, tests/syscalls.scm: New files.
* Makefile.am (MODULES): Add guix/build/syscalls.scm.
  (SCM_TESTS): Add tests/syscalls.scm.
* guix/utils.scm (%libc-errno-pointer, errno): Remove; take from (guix
  build syscalls).
2014-05-10 22:55:34 +02:00
Ludovic Courtès 02139eb9b2 linux-initrd: Append to /etc/mtab.
* guix/build/linux-initrd.scm (mount-file-system): Open /etc/mtab in
  append mode.
2014-05-10 21:47:05 +02:00
Ludovic Courtès 474b832d5e linux-initrd: Don't leak /dev/console file descriptors.
* guix/build/linux-initrd.scm (switch-root): Simplify /dev/console
  code.  This fixes a bug where we would leak the IN and OUT file
  descriptors.
2014-05-08 23:42:15 +02:00
Ludovic Courtès 03178aec1d git-download: Disable TLS certificate verification.
* guix/build/git.scm (git-fetch): Add 'setenv' call.
2014-05-08 23:42:15 +02:00
Ludovic Courtès b1995341ce linux-initrd: Update /etc/mtab.
* guix/build/linux-initrd.scm (mount-root-file-system): Populate
  /root/etc/mtab.
  (mount-file-system): Update ROOT/etc/mtab.
2014-05-08 00:22:26 +02:00
Ludovic Courtès 538cc2e016 Remove now unneeded (guix build gnome) module.
* guix/build/gnome.scm: Remove.
* Makefile.am (MODULES): Update accordingly.
2014-05-07 14:32:36 +02:00
Ludovic Courtès 26a728eb09 linux-initrd: Delete files from the initrd ramfs when switching roots.
* guix/build/linux-initrd.scm (switch-root): Delete file from the old
  root.  Chdir to / after 'chroot' call.  Re-open file descriptors 0, 1,
  and 2.
  (boot-system): Move 'loading' message after the 'switch-root' call.
* gnu/system.scm (operating-system-boot-script): Add loop that closes
  file descriptor before calling 'execl'.
2014-05-06 18:18:22 +02:00
Ludovic Courtès 515eba4543 gnu-maintenance: Add missing type check.
* guix/gnu-maintenance.scm (gnu-package?): Only call 'mirror-type' when
  URL is a string.
2014-05-05 09:00:00 +02:00
Ludovic Courtès 1d4628329d linux-initrd: Improve root file system switching.
* guix/build/linux-initrd.scm (move-essential-file-systems,
  switch-root): New procedures.
  (MS_MOVE): New variable.
  (boot-system): Remove 'mount-essential-file-systems' call for ROOT.
  Use 'switch-root' instead of chdir + chroot.
2014-05-04 22:24:47 +02:00
Ludovic Courtès 3c05b4bc25 linux-initrd: Check the root and other early file systems.
* gnu/system.scm (operating-system-derivation)[boot-file-systems]: Keep "/".
* gnu/system/linux-initrd.scm (file-system->spec): Keep the 'check?'
  flag.
  (qemu-initrd)[helper-packages]: New variable.  Pass it as #:to-copy.
  <gexp>: Add 'set-path-environment-variable' call.  Remove #:unionfs
  argument for 'boot-system'.
* gnu/system/vm.scm (%linux-vm-file-systems): Add 'check?' field/
  (virtualized-operating-system): Likewise for the "9p" file system.
* guix/build/linux-initrd.scm (mount-root-file-system): Change #:unionfs
  default.  Call 'check-file-system' before mounting ROOT, when
  VOLATILE-ROOT? is false.
  (check-file-system): New procedure.
  (mount-file-system): Honor 'check?' element in list; add
  'check-file-system' call.
  (boot-system): Remove #:root-fs-type and #:unionfs parameters.
  [root-mount-point?, root-fs-type]: New variables.
  Call 'mount-file-system' on all MOUNTS but "/".
2014-05-04 00:30:39 +02:00
Ludovic Courtès ad896f23a5 activation: Fix deletion of setuid programs.
* guix/build/activation.scm (activate-setuid-programs): When
  %SETUID-DIRECTORY exists, pass the right file names to 'delete-file'.
2014-05-04 00:18:46 +02:00
Ludovic Courtès 03ddfaf5fb vm: Make root file system type a parameter, and default to ext4.
* gnu/system/vm.scm (qemu-image): Add #:file-system-type parameter.
  Pass it to 'initialize-hard-disk'.
* guix/build/linux-initrd.scm (mount-root-file-system): Always honor
  TYPE.
  (boot-system): Change #:root-fs-type to default to "ext4".  Update
  docstring.
* guix/build/vm.scm (initialize-hard-disk): Remove #:mkfs parameter; add
  #:file-system-type.  Adjust 'mkfs' invocation and 'mount' call to
  honor #:file-system-type.
2014-05-03 12:16:23 +02:00
Ludovic Courtès 3c986b75f5 ftp-client: Add missing CR in "USER" command.
* guix/ftp-client.scm (%ftp-login): Add #\return before #\newline.
  Fixes access to some FTP servers, such as
  ftp://invisible-island.net ("ProFTPD 1.3.4a Server").
2014-05-03 00:46:51 +02: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 6f8f8ccb5b download: Rewrite using gexps.
* guix/download.scm (gnutls-derivation): Remove.
  (gnutls-package): New procedure.
  (url-fetch): Rewrite using 'gexp->derivation'.
2014-05-01 22:31:36 +02:00
Ludovic Courtès 53e89b1732 monads, gexp: Remove unintended dependency on (gnu packages …).
* guix/gexp.scm (gexp->derivation, gexp->script): Use 'default-guile'
  instead of an explicit reference to 'guile-final'.
  (default-guile): New procedure.
* guix/monads.scm (run-with-store)[default-guile]: New procedure.
  Use it.
2014-05-01 22:31:36 +02:00
Ludovic Courtès 79c0c8cdf7 gexp: Add support for 'origin?' objects in 'ungexp' forms.
* guix/gexp.scm (lower-inputs, gexp-inputs, gexp->sexp,
  canonicalize-reference): Add 'origin?' case.
* guix/monads.scm (origin->derivation): New procedure.
* tests/gexp.scm ("one input origin"): New test.
2014-05-01 22:31:36 +02:00
Ludovic Courtès 7560b00b1c gexp: Add pretty printer.
* guix/gexp.scm (write-gexp): New procedure.
  <top level>: Add call to 'set-record-type-printer!'.
2014-04-30 23:16:23 +02:00
Ludovic Courtès 09e028f45f system: Add support for setuid binaries.
* gnu/system.scm (<operating-system>)[pam-services, setuid-programs]:
  New fields.
  (etc-directory)[bashrc]: Prepend /run/setuid-programs to $PATH.
  (operating-system-etc-directory): Honor
  'operating-system-pam-services'.
  (%setuid-programs): New variable.
  (operating-system-boot-script): Add (guix build utils) to the set of
  imported modules.  Call 'activate-setuid-programs' in boot script.
* gnu/system/linux.scm (base-pam-services): New procedure.
* guix/build/activation.scm (%setuid-directory): New variable.
  (activate-setuid-programs): New procedure.
* build-aux/hydra/demo-os.scm: Add 'pam-services' field.
2014-04-30 23:16:23 +02:00
Ludovic Courtès d8a7a5bfd5 linux-initrd: Allow setuid binaries from the unionfs to run.
* guix/build/linux-initrd.scm (boot-system): Pass the 'suid' option to
  UNIONFS.
2014-04-30 23:16:23 +02:00
Ludovic Courtès 4dfe6c58ee system: Add (guix build activation).
* gnu/services/dmd.scm (dmd-configuration-file): Remove 'etc'
  parameter.  Move /etc activation code to...
* guix/build/activation.scm: ... here; new file.
* gnu/system.scm (operating-system-boot-script): Augment script: add
  (guix build activation) to the load path; call 'activate-etc'.
* Makefile.am (MODULES): Add guix/build/activation.scm.
2014-04-30 23:16:22 +02:00
Ludovic Courtès be4e38fb6f derivations: Micro-optimize 'derivation'.
* guix/derivations.scm (derivation->string): New procedure.
  (derivation-hash, derivation): Use it.
  Memoization here yields a 5% improvement on "guix build -e '(@ (gnu
  packages emacs) emacs)' -n --no-substitutes".
2014-04-29 18:13:10 +02:00
Ludovic Courtès 187eb5f643 gnu-maintenance: Avoid network access in 'gnu-package?'.
* guix/gnu-maintenance.scm (gnu-package?): Add 'mirror-type' procedure.
  Resort to 'official-gnu-packages' only when 'mirror-type' returns #f.
2014-04-29 18:02:16 +02:00
Ludovic Courtès bfd9eed955 gexp: Remove leftover parameter.
* guix/gexp.scm (gexp->sexp): Remove #:outputs parameter.  Adjust
  callers accordingly.
2014-04-29 17:58:34 +02:00
Ludovic Courtès ada3df03e3 monads: Hide 'derivation-expression' and 'lower-inputs'.
* 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'.
2014-04-28 23:41:12 +02:00
Ludovic Courtès eee2127109 store: (direct-store-path? (%store-prefix)) returns #f.
* guix/store.scm (direct-store-path?): Return #f if PATH
  is (%store-prefix).
* tests/store.scm ("direct-store-path?"): Add test.
2014-04-28 23:24:18 +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
Andreas Enge 06ed59825e guix: cmake: Add input and package libraries to the rpath, and adapt package
definitions accordingly.

* guix/build/cmake-build-system.scm (configure): Add flags.
* gnu/packages/maths.scm (lapack): Drop special code.
* gnu/packages/ssh.scm (libssh): Drop special code.
* gnu/packages/slim.scm (slim): Drop special code and enable shared library.

Co-authored-by: Eric Bavier <bavier@member.fsf.org>
2014-04-27 11:35:26 +02:00
Ludovic Courtès 6ef3644e34 pk-crypto: Add pretty-printer to 'gcry-error' exceptions.
* guix/pk-crypto.scm (string->canonical-sexp, sign, generate-key): Pass
  the procedure name as the first argument to 'throw'.
  (gcrypt-error-printer): New procedure.
  <top level>: Add call to 'set-exception-printer!'.
* guix/nar.scm (restore-one-item): Add 'proc' parameter to 'catch'
  handler for 'gcry-error.
* guix/scripts/archive.scm (%options, generate-key-pair, authorize-key):
  Likewise.
* guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp):
  Likewise.
2014-04-22 11:41:52 +02:00
Ludovic Courtès 6f69588529 authenticate: Allow signatures with binary data to be written to stdout.
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.
2014-04-22 11:30:58 +02:00
Ludovic Courtès 6030d8493e pk-crypto: Use ISO-8859-1 for strings passed to 'gcry_sexp_new'.
* 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.
2014-04-22 01:39:31 +02:00
Ludovic Courtès 50db7d82b3 nar: Really really protect the temporary store directory from GC.
This is a follow-up to 6071b55e10.
See <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00167.html>
for the original report, and
<https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00198.html>
for an alternate solution that has been discussed.

* guix/nar.scm (temporary-store-file): Remove call to
  'add-permanent-root'; don't loop.
  (with-temporary-store-file): Rewrite using 'with-store' and
  'add-temp-root'.
2014-04-21 23:24:23 +02:00
Ludovic Courtès 395bea2a53 download: Improve progress report output.
* guix/build/download.scm (url-fetch): Make current-output-port
  unbuffered.
2014-04-16 12:25:52 +02:00
Ludovic Courtès 1c96c1bbab linux-initrd: Mount / as a unionfs when asking for a volatile root.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Make
  /dev/fuse.
  (boot-system): Add #:unionfs parameter.  Invoke UNIONFS instead of
  copying files over when VOLATILE-ROOT? is true.
* gnu/system/linux-initrd.scm (expression->initrd): Add #:inputs
  parameter.
  [files-to-copy]: New procedure.
  [builder]: Add 'to-copy' parameter; honor it.
  (qemu-initrd)[linux-modules]: Add 'fuse.ko' when VOLATILE-ROOT?.
  Pass UNIONFS-FUSE/STATIC as #:inputs; change builder to pass #:unionfs
  to 'boot-system'.
2014-04-14 23:59:08 +02:00
Ludovic Courtès 30ce8012cd offload: '{send,receive}-files' wait for completion of the transfer.
Fixes situations where the remote 'guix build' is invoked before the
.drv has been completely copied, as reported at
<https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00174.html>.

In some cases 'send-files' would return before the other end is done
importing the files, and so the subsequent 'guix build' invocation would
just miss the .drv file it refers to.

* guix/utils.scm (call-with-decompressed-port): Don't close PORT.
  (call-with-compressed-output-port): Likewise.
* tests/utils.scm ("compressed-output-port + decompressed-port"): Adjust
  accordingly.
* guix/scripts/offload.scm (send-files): Add explicit (close-pipe pipe)
  call.
  (retrieve-files): Likewise.
2014-04-14 00:24:24 +02:00
Ludovic Courtès 66ef541147 offload: Better synchronize with remote invocation of 'guix archive --missing'.
* guix/scripts/offload.scm (send-files)[missing-files]: Call 'waitpid'
  after reading all of MISSING.
2014-04-14 00:17:43 +02:00
Ludovic Courtès 8d846470f2 build-system/gnu: Reset timestamps on build tree when source is a directory.
* guix/build/utils.scm (copy-recursively): Add #:keep-mtime? parameter
  and honor it.
* guix/build/gnu-build-system.scm (unpack): Use #:keep-mtime? #t.
* gnu/packages/admin.scm (shadow)[arguments]: Remove 'reset-timestamps'
  phase.
2014-04-14 00:09:42 +02:00