Commit Graph

810 Commits (b6c18d6af7862847326db290e890a7327203b282)

Author SHA1 Message Date
Ludovic Courtès 07fb21b231 offload: Remove erroneous 'close-pipe' call.
* guix/scripts/offload.scm (send-files): Remove 'close-pipe' call from
  'guard' handler ('pipe' here referred to Guile's 'pipe' procedure.)
2014-03-26 16:27:46 +01:00
Ludovic Courtès 6c41cce0be offload: Wait for the processes involved in 'guix archive --missing'.
* guix/scripts/offload.scm (send-files): Keep the second return value of
  'filtered-port'.  Call 'waitpid' on it.
2014-03-26 16:27:46 +01:00
Ludovic Courtès 236e66481d offload: Allow one transfer in each direction simultaneously.
* guix/scripts/offload.scm (transfer-and-offload): Use 'upload' lock
  instead of 'bandwidth' around 'send-files' calls, and 'download' lock
  around 'retrieve-files' call.
2014-03-26 15:06:52 +01:00
Ludovic Courtès 3dfd8af534 offload: Disable SSH-level compression.
* guix/scripts/offload.scm (remote-pipe): Remove '-z' lsh command line
  argument.  This makes transfers almost an order of magnitude slower.
  OpenSSH's ssh(1) man page notes: "Compression is desirable on modem lines
  and other slow connections, but will only slow down things on fast
  networks."  See also
  <http://www.spikelab.org/blog/transfer-largedata-scp-tarssh-tarnc-compared.html>.
2014-03-26 15:06:52 +01:00
Ludovic Courtès 212ece42b0 download: Don't use 'http-get*' on Guile 2.0.10+.
* guix/build/download.scm (http-fetch)[post-2.0.7?]: Use
  'string->number' and numeric comparison.  This fixes version
  comparison with "2.0.10" and subsequent 2.0 releases.
2014-03-25 18:54:52 +01:00
Ludovic Courtès 8b7af63754 offload: Compress files being sent/retrieved.
* guix/scripts/offload.scm (send-files): Add "xz -dc |" to the remote
  pipe command.  Pass PIPE through 'call-with-compressed-output-port'.
  Remove 'close-pipe' call.
  (retrieve-files): Add "| xz -c" to the remote pipe command.  Pass PIPE
  through 'call-with-decompressed-port'.  Remove 'close-pipe' call.
2014-03-24 22:20:54 +01: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 80dea563a3 utils: Add 'filtered-output-port' and 'compressed-output-port'.
* guix/utils.scm (filtered-output-port, compressed-output-port): New
  procedures.
* tests/utils.scm ("compressed-output-port + decompressed-port"): New
  test.
2014-03-24 21:09:15 +01:00
Ludovic Courtès 9b0a2233db authenticate: Support reading the hash or key from stdin.
* guix/scripts/authenticate.scm (guix-authenticate): Add clauses
  for ("rsautl" "-sign" "-inkey" key) and ("rsautl" "-verify" "-inkey" _
  "-pubin").
* tests/guix-authenticate.sh (hash): Add test using -sign and -verify in
  a pipeline.
2014-03-22 22:57:10 +01:00
Ludovic Courtès 9dbe6e43ea authenticate: Move actual work to separate procedures.
* guix/scripts/authenticate.scm (read-canonical-sexp): Change to expect
  a port instead of a file name.
  (read-hash-data): Likewise.
  (sign-with-key, validate-signature): New procedures.
  (guix-authenticate): Rewrite in terms of these two procedures.
2014-03-22 22:57:10 +01:00
Ludovic Courtès 7a8024a33a utils: Add 'decompressed-port' and 'compressed-port'.
* guix/utils.scm (decompressed-port, compressed-port): New procedures.
* guix/scripts/substitute-binary.scm (decompressed-port): Remove.
  (guix-substitute-binary): Pass a symbol or #f as the first argument to
  'decompress-port'.
* tests/utils.scm ("compressed-port, decompressed-port, non-file"): New
  test.
2014-03-22 22:57:09 +01:00
Ludovic Courtès 443eb4e950 utils: 'filtered-port' doesn't leave dangling processes behind.
* guix/utils.scm (filtered-port): Make sure the 'execl' child process
  always exits, and does (primitive-_exit 1) upon execution failure.
  Use 'primitive-_exit' in the 'dump-port' child process.
* tests/utils.scm ("filtered-port, does not exist"): New test.
2014-03-22 22:57:09 +01:00
Yakkala Yagnesh Raghava ca534666aa licenses: Fix Nixpkgs license URL.
* guix/licenses.scm: Fix Nixpkgs URL in comment.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-03-22 22:57:09 +01:00
Mark H Weaver 1eefbb2693 Merge branch 'master' into core-updates 2014-03-22 11:19:19 -04:00
Ludovic Courtès 1fda6840a8 pk-crypto: Don't use Ed25519 when libgcrypt is older than 1.6.0.
* guix/pk-crypto.scm (gcrypt-version): New procedure.
* guix/scripts/archive.scm (%key-generation-parameters): New variable.
  (%options) <generate-key>: Use it.
* tests/pk-crypto.scm ("sign + verify, Ed25519"): Skip if using gcrypt < 1.6.0.
2014-03-20 23:06:47 +01:00
Ludovic Courtès d81195bffd offload: Send build logs to file descriptor 4.
* guix/scripts/offload.scm (with-error-to-port): New macro.
  (remote-pipe): Add #:error-port parameter.  Use 'with-error-to-port'
  around 'open-pipe*' call.
  (build-log-port): New procedure.
  (offload): Change #:log-port to default to (build-log-port).  Call
  'remote-pipe' with #:error-port LOG-PORT.
2014-03-19 23:12:06 +01:00
Ludovic Courtès 19ee8c7dc5 substitute-binary: Quietly handle 404s when fetching narinfos.
* guix/scripts/substitute-binary.scm (fetch): Add #:quiet-404?
  parameter.  Upon &http-get-error, re-raise C if the QUIET-404? is
  true and the code is 404.
  (fetch-narinfo): Pass #:quiet-404? #t.
2014-03-19 22:26:08 +01:00
Ludovic Courtès 32a1eb8025 pk-crypto: Use RFC6979 when signing with an ECC or DSA key.
* guix/pk-crypto.scm (bytevector->hash-data): Add #:key-type parameter.
  Use the 'pkcs1' flag when KEY-TYPE is 'rsa', and 'rfc6979' when
  KEY-TYPE is 'ecc' or 'dsa'.
  (key-type): New procedure.
* guix/scripts/authenticate.scm (read-hash-data): Add 'key-type'
  parameter.  Pass it to 'bytevector->hash-data'.  Adjust caller
  accordingly.
* tests/pk-crypto.scm (%ecc-key-pair): New variable.
  ("key-type"): New test.
  ("sign + verify"): Pass #:key-type to 'bytevector->hash-data'.
  ("sign + verify, Ed25519"): New test.
2014-03-19 21:40:10 +01:00
Ludovic Courtès 1cbfce1669 guix archive: Generate curve Ed25519 keys by default.
* guix/scripts/archive.scm (%options) <generate-key>: Default to curve
  Ed25519.  Suggested by Christian Grothoff <grothoff@in.tum.de>.
2014-03-17 23:49:35 +01:00
Ludovic Courtès d0a850698a guix archive: Improve '--generate-key' error reporting.
* guix/scripts/archive.scm (%options) <generate-key>: Report the error
  source and string when 'string->canonical-sexp' fails.
2014-03-17 23:47:18 +01:00
Ludovic Courtès 0562dbe5d3 Merge branch 'master' into core-updates 2014-03-17 18:26:46 +01:00
Ludovic Courtès 11e7a6cf46 store: Add 'hash-part->path'.
* guix/store.scm (hash-part->path): New procedure.
* tests/store.scm ("hash-part->path"): New test.
2014-03-14 17:16:10 +01:00
Ludovic Courtès 1a8ea0a188 offload: Fix 'choose-build-machine' for several machines.
* guix/scripts/offload.scm (choose-build-machine)[undecorate]: Turn into
  a two-argument procedure.
2014-03-13 22:57:21 +01:00
Ludovic Courtès 3c0e6e6080 offload: Convert the port number to a string when invoking lsh.
* guix/scripts/offload.scm (remote-pipe, send-files): Pass the result of
  'build-machine-port' to 'number->string'.
2014-03-13 22:46:32 +01:00
Ludovic Courtès cecd72d55a offload: Allow build machines to specify a port number.
* guix/scripts/offload.scm (<build-machine>): Add 'port' field.
  (remote-pipe, send-files): Use lsh's '-p' option when invoking it.
2014-03-13 21:58:04 +01:00
Ludovic Courtès 257b93412a guix build: Support '--with-source' along with '-e'.
* guix/scripts/build.scm (derivation-from-expression): Remove.
  (options->derivations): Handle pairs of the form
  "('argument . (? derivation?))".
  (options/resolve-packages): Add 'store' parameter; update caller.  Add
  'system' variable.  Add case for 'expression pairs.
* guix/scripts/archive.scm (derivation-from-expression): New procedure.
2014-03-13 19:21:49 +01:00
Ludovic Courtès 7f3673f21d guix build: Add '--with-source'.
* guix/scripts/build.scm (package-with-source): New procedure.
  (show-help): Add '--with-source'.
  (%options): Likewise.
  (options->derivations): Call 'options/with-source' and
  'options/resolve-packages'.
  (options/resolve-packages, options/with-source): New procedures.
* doc/guix.texi (Invoking guix build): Document '--with-source'.
2014-03-12 00:22:41 +01:00
Ludovic Courtès d91a879121 download: 'download-to-store' accepts plain file names.
* guix/download.scm (download-to-store): When URI is #f, assume that URL
  is a file name, and handle it.
2014-03-11 22:09:42 +01:00
Ludovic Courtès 6f58d58243 More /gnu/store replacements.
* gnu/packages/gcc.scm (gcc-4.7): Change /nix/store in comment.
* gnu/system/vm.scm (operating-system-default-contents):
  Use (%store-prefix) instead of "/nix/store".
* guix/derivations.scm (derivation-path->output-path,
  derivation-path->output-paths): Change to /gnu/store in docstring.
2014-03-10 23:58:40 +01:00
Ludovic Courtès 8be3b8a39b Change default store values from /nix/store to /gnu/store.
* gnu/packages/ld-wrapper.scm (%store-directory): Change the default to
  /gnu/store.
* guix/build/utils.scm (%store-directory): New procedure.
  (remove-store-references): Use it for the default value of 'store'.
* guix/packages.scm (patch-and-repack)[builder]: Change default store to
  /gnu/store.
2014-03-10 23:54:27 +01:00
Ludovic Courtès e06f7865e2 Merge branch 'master' into core-updates 2014-03-10 23:54:17 +01:00
Ludovic Courtès c9c88118a1 gnu: linux-initrd: Make the pseudo-tty device nodes.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Create
  /dev/ptmx and /dev/pts.
* gnu/system/vm.scm (qemu-image): Umount /fs/dev/pts before /fs.
2014-03-10 23:43:31 +01:00
Ludovic Courtès 714084e6c0 offload: Honor absolute build timeouts.
* guix/scripts/offload.scm (offload): Remove default value for
  'build-timeout'.  Pass '--timeout' to the remote 'guix build'
  process.
  (transfer-and-offload, process-request): Remove default value for
  'build-timeout'.
2014-03-09 23:15:09 +01:00
Ludovic Courtès 002622b65b guix build: Add '--timeout' to the common build options.
* guix/scripts/build.scm (show-build-options-help): Document
  '--timeout'.
  (set-build-options-from-command-line): Pass #:timeout to
  'set-build-options'.
  (%standard-build-options): Add '--timeout'.
* doc/guix.texi (Invoking guix build): Document it.
2014-03-09 23:09:18 +01:00
Ludovic Courtès 6c20d1d0c3 store: Add #:timeout build option.
* guix/serialization.scm (write-string-pairs): New procedure.
* guix/store.scm (write-arg): Add 'string-pairs' case.
  (set-build-options): Add 'timeout' keyword parameter.  Honor it.
* tests/derivations.scm ("build-expression->derivation and timeout"):
  New test.
2014-03-09 23:01:18 +01:00
Ludovic Courtès f5768afa33 build: Change state and log directories to $localstatedir/.../guix.
* daemon.am (libstore_a_CPPFLAGS): Change /nix to /guix.
* guix/config.scm.in (%state-directory): Likewise.
* guix/store.scm (log-file): Likewise.
2014-03-09 22:10:01 +01:00
Ludovic Courtès 59f704dff6 offload: Move macro definitions before use.
* guix/scripts/offload.scm (lock-file, unlock-file, with-file-lock,
  with-machine-lock, machine-slot-file, acquire-build-slot,
  release-build-slot): Move definitions above their first use.
2014-03-09 18:08:38 +01:00
Ludovic Courtès 88da0b6888 offload: Distinguish between 'decline' and 'postpone'.
* guix/scripts/offload.scm (transfer-and-offload): New procedure, with
  core formerly in 'process-request'.
  (choose-build-machine): Remove 'requirements' parameter.
  (process-request): Reply 'decline' when none of MACHINES matches the
  requirements, and 'postpone' when MACHINES are busy.
2014-03-09 14:06:35 +01:00
Ludovic Courtès 5cc569dc73 offload: Prevent locked files from being GC'd.
* guix/scripts/offload.scm (%slots): New variable.
  (choose-build-machine): Add SLOT to '%slots'.
2014-03-08 21:23:12 +01:00
Ludovic Courtès 7df3ade112 offload: Fix thinko.
* guix/scripts/offload.scm (choose-build-machine)[machine+slots]: Use
  'filter-map', not 'filter'.
2014-03-08 12:22:49 +01:00
Ludovic Courtès d652b85137 offload: Make 'parallel-builds' a hard limit.
* guix/scripts/offload.scm (machine-choice-lock-file,
  machine-slot-file, acquire-build-slot, release-build-slot): New
  procedures.
  (choose-build-machine): Operate with (machine-choice-lock-file)
  taken.  Acquire a build slot for each of MACHINES.  Release those not
  used.
2014-03-08 12:16:06 +01:00
Ludovic Courtès 4bf1eb4f88 offload: Further generalize lock files.
* guix/scripts/offload.scm (lock-machine, unlock-machine): Remove.
  (lock-file, unlock-file): New procedures.
  (with-file-lock): New macro.
  (with-machine-lock): Rewrite in terms of 'with-file-lock'.
2014-03-08 12:07:57 +01:00
Ludovic Courtès 178f5828eb offload: Generalize the machine lock mechanism.
* guix/scripts/offload.scm (lock-machine): Add 'hint' parameter.
  (unlock-machine): Remove 'machine' parameter.
  (with-machine-lock): Add 'hint' parameter, and pass it down.
  (process-request): Adjust uses of 'with-machine-lock' to pass the
  'bandwidth hint.
2014-03-08 11:29:52 +01:00
Ludovic Courtès c7445833eb utils: Add a non-blocking option for 'fcntl-flock'.
* guix/utils.scm (F_SETLK): New variable.
  (fcntl-flock): Add 'wait?' keyword parameter; honor it.
* tests/utils.scm ("fcntl-flock non-blocking"): New test.
2014-03-08 00:18:22 +01:00
Ludovic Courtès cafb92d853 store: 'export-paths' doesn't export references of the given files.
This fixes a regression introduced in
99fbddf9a6 ("store: Change 'export-paths'
to always export in topological order.")

* guix/store.scm (export-paths): Define 'ordered' variable.  Iterate
  over it.
* tests/store.scm ("export/import paths, ensure topological order"): Add
  'file0'.  Adjust accordingly.
2014-03-07 00:19:03 +01:00
Ludovic Courtès 9ea3ef2655 utils: 'fcntl-flock' passes an errno when throwing an exception.
* guix/utils.scm (%libc-errno-pointer, errno): New procedures.
  (fcntl-flock): Use it as the exception's argument.
2014-03-06 21:42:24 +01:00
Ludovic Courtès f326fef8a8 offload: Serialize file transfers to build machines.
* guix/scripts/offload.scm (machine-lock-file, lock-machine,
  unlock-machine): New procedures.
  (with-machine-lock): New macro.
  (process-request): Wrap 'send-files' and 'retrieve-files' calls in
  'with-machine-lock'.
2014-03-06 21:42:24 +01:00
Ludovic Courtès 56c72822a8 download: Perform derivations locally.
* guix/download.scm (url-fetch): Pass #:local-build? #t to
  'build-expression->derivation'.
* guix/git-download.scm (git-fetch): Likewise.
2014-03-06 21:42:24 +01:00
Ludovic Courtès dd67b429e1 guix package: Use the common build options from (guix scripts build).
* guix/scripts/build.scm (%standard-build-options): Change option
  handlers to support multiple seeds.
* guix/scripts/package.scm (show-help): Remove --dry-run, --fallback,
  --no-substitutes, and --max-silent-time.
  (%options): Likewise, and add %STANDARD-BUILD-OPTIONS.
  (%default-options): Add 'verbosity'.
  (guix-package): Call 'set-build-options-from-command-line' instead of
  'set-build-options'.
2014-03-01 18:29:29 +01:00
Ludovic Courtès 706e9e575d substitute-binary: Gracefully handle HTTP GET errors.
* guix/http-client.scm (&http-get-error): New condition type.
  (http-fetch): Raise it instead of using 'error'.
* guix/scripts/substitute-binary.scm (fetch) <http>: Wrap body into
  'guard' form; gracefully handle 'http-get-error?' conditions.
2014-03-01 15:38:11 +01:00
Ludovic Courtès 1f7fd80032 offload: Comment out attempt to set up an lsh gateway.
* guix/scripts/offload.scm (open-ssh-gateway): Comment out.
  (process-request): Remove call to 'open-ssh-gateway' and to 'kill'.
2014-03-01 12:24:39 +01:00
Ludovic Courtès aedbf9b873 offload: 'remote-pipe' uses the right SSH key.
* guix/scripts/offload.scm (remote-pipe): Pass -i when invoking
  %LSHG-COMMAND.
2014-03-01 12:15:47 +01:00
Ludovic Courtès 165f4b2add offload: Take the target machine load into account.
* guix/scripts/offload.scm (machine-load, machine-less-loaded?,
  machine-less-loaded-or-faster?): New procedures.
  (choose-build-machine): Use 'machine-less-loaded-or-faster?' when
  sorting.  Return the head of MACHINES unless it's loaded is >= 2.
2014-03-01 01:31:18 +01:00
Ludovic Courtès 36b56f081b guix archive: Change '--help' to show '--authorize'.
* guix/scripts/archive.scm (show-help): Add '--authorize'.
2014-02-28 22:31:16 +01:00
Ludovic Courtès 3ca00bb51e packages: Support 'patches' and 'snippets' for sources that are directories.
* guix/packages.scm (patch-and-repack)[numeric-extension?, tarxz-name]:
  New procedures.
  [builder]: Adjust to deal with SOURCE when it's a directory.
  <body>: Use 'tarxz-name'.  Always add (guix build utils) to
  IMPORTED-MODULES.
2014-02-28 10:42:09 +01:00
Ludovic Courtès a74da6b015 gnu-maintenance: Adjust 'latest-release' to filter Bash's patch directories.
* guix/gnu-maintenance.scm (latest-release)[patch-directory-name?]: New
  procedure.
  <subdirs>: Use it to filter out Bash-like patch directories.
2014-02-28 00:01:53 +01:00
Ludovic Courtès 829ecd002e Merge branch 'master' into core-updates
Conflicts:
	gnu/packages/libwebsockets.scm
2014-02-27 23:49:30 +01:00
Ludovic Courtès 371e87d286 store: Use 'when' instead of 'if' in effectful context.
* guix/store.scm (set-build-options): Use 'when' instead of 'if'.
2014-02-27 22:24:02 +01:00
Ludovic Courtès 17919a5801 build-system/gnu: Allow the source to be a directory.
* guix/build/gnu-build-system.scm (unpack): Check if SOURCE is a
  directory, and copy it locally if it is.
* gnu/packages/libwebsockets.scm (libwebsockets)[arguments]: Remove
  'unpack' phase.
2014-02-22 00:34:49 +01:00
Ludovic Courtès b2bfa32d25 Merge branch 'master' into core-updates
Conflicts:
	gnu-system.am
2014-02-22 00:27:57 +01:00
Ludovic Courtès 2096ef47aa derivations: Remove unused 'derivation' parameter.
* guix/derivations.scm (derivation): Remove unused #:hash-mode parameter.
* doc/guix.texi (Derivations): Adjust accordingly.
2014-02-21 23:49:53 +01:00
Ludovic Courtès 9b5b5c1740 Add (guix git-download).
* guix/git-download.scm, guix/build/git.scm: New files.
* Makefile.am (MODULES): Add them.
* guix/packages.scm (<origin>): Fix comment for 'method' field.
2014-02-21 23:49:53 +01:00
Ludovic Courtès 96c7448f37 nar: Produce archives with files sorted in C collation order.
* guix/nar.scm (write-file) <directory>: Pass 'string<?' as the second
  argument to 'scandir'.
* tests/nar.scm ("write-file puts file in C locale collation order"):
  New test.
2014-02-21 23:49:53 +01:00
Ludovic Courtès 36bbbbd150 derivations: Add support for recursive fixed-output derivations.
* guix/derivations.scm (<derivation-output>): Add 'recursive?' field.
  Adjust 'make-derivation-output' callers.
  (%read-derivation) <fixed-output>: When HASH-ALGO starts with 'r:',
  set the 'recursive?' field and drop 'r:' from the hash algo name.
  (write-derivation)[write-output]: Write the algo as 'r:HASH-ALGO' when
  the RECURSIVE? field is set.
  (derivation-hash) <fixed-output>: Prepend "r:" when RECURSIVE? is set.
  (fixed-output-path): New procedure.
  (derivation): Add #:recursive? parameter.  Use 'fixed-output-path' to
  compute the output file name of a fixed output derivation.
  (build-expression->derivation): Add #:recursive? parameter.  Pass it
  to 'derivation'.
* tests/derivations.scm ("fixed-output derivation, recursive",
  "build-expression->derivation produces recursive fixed-output",
  "build-expression->derivation uses recursive fixed-output"): New
  tests.
* doc/guix.texi (Derivations): Document #:recursive? for 'derivation'.
  Add #:recursive? for 'build-expression->derivation'.
2014-02-21 23:49:52 +01:00
Ludovic Courtès 3140f2df42 guix hash: Add '--recursive'.
* guix/scripts/hash.scm (show-help): Add --recursive.
  (%options): Likewise.
  (guix-hash)[file-hash]: New procedure.  Honor --recursive.
  Use it.
* guix/nar.scm (write-file): Add missing field to the &nar-error
  condition raised upon unsupported file type; change its message to be
  more descriptive.
* tests/guix-hash.sh: Add tests with -r.
* doc/guix.texi (Invoking guix hash): Document --recursive.
2014-02-21 23:49:52 +01:00
Ludovic Courtès c1d52c71aa ui: Handle SRFI-35 '&message' conditions.
* guix/ui.scm (call-with-error-handling): Add case for
  'message-condition?'.
* po/Makevars: Fix typo in comment.
2014-02-21 23:49:52 +01:00
Ludovic Courtès a93e91ff48 nar: 'write-file' can write to non-file ports.
* guix/nar.scm (write-contents): Use 'sendfile' only when P is a file
  port.
* tests/nar.scm ("write-file supports non-file output ports"): New test.
2014-02-21 23:49:52 +01:00
Ludovic Courtès c6d37be951 guix hash: Don't load the whole file in memory.
* guix/scripts/hash.scm (guix-hash)[eof->null]: Remove.
  (guix-hash): Use 'port-sha256' to compute the hash instead of
  'get-bytevector-all' and co.
2014-02-20 23:18:08 +01:00
Ludovic Courtès db4fdc04cc gnu: Introduce the (gnu services ...) modules.
* gnu/system/dmd.scm: Remove file.  Move contents to...
* gnu/services.scm, gnu/services/base.scm, gnu/services/dmd.scm,
  gnu/services/networking.scm, gnu/services/xorg.scm: ... here.  New
  files.
* gnu/system.scm, gnu/system/vm.scm: Adjust accordingly.
* guix/scripts/system.scm (%user-module): Likewise.
* doc/guix.texi (Using the Configuration System): Likewise.
  (Defining Services): Likewise.
2014-02-19 20:58:24 +01:00
Ludovic Courtès 523e48969b Add 'guix system'.
* guix/scripts/system.scm: New file.
* Makefile.am (MODULES): Add it.
* po/POTFILES.in: Likewise.
* doc/guix.texi (Using the Configuration System): Link to "Invoking guix
  system".
  (Invoking guix system): New node.
2014-02-18 23:47:49 +01:00
Ludovic Courtès e7fc17b592 guix build: Factorize common options.
* guix/scripts/build.scm (show-build-options-help,
  set-build-options-from-command-line): New procedures.
  (show-help): Remove description of --dry-run,
  --fallback, --no-substitutes, --max-silent-time, and --cores.  Call
  'show-build-options-help'.
  (%standard-build-options): New variable.
  (%options): Remove --dry-run, --fallback, --no-substitutes,
  --verbosity, --max-silent-time, and --cores.  Add
  %STANDARD-BUILD-OPTIONS.
  (guix-build): Use 'set-build-options-from-command-line' instead of
  'set-build-options'.
* guix/scripts/archive.scm (show-help): Remove description of --dry-run,
  --fallback, --no-substitutes, --max-silent-time, and --cores.  Call
  'show-build-options-help'.
  (%options): Remove --dry-run, --fallback, --no-substitutes,
  --verbosity, --max-silent-time, and --cores.  Add
  %STANDARD-BUILD-OPTIONS.
  (export-from-store): Call 'set-build-options-from-command-line'
  instead of 'set-build-options.
2014-02-18 00:13:24 +01:00
Ludovic Courtès bdff90a16a guix build: Move 'set-build-options' call earlier.
* guix/scripts/build.scm (guix-build): Move 'set-build-options' call
  before 'show-what-to-build'.
2014-02-12 00:03:20 +01:00
Ludovic Courtès d66b704b51 store: Add comments for the stracer.
* guix/store.scm (%worker-magic-1, %worker-magic-2): Add comments.
2014-02-12 00:03:20 +01:00
Ludovic Courtès 99fbddf9a6 store: Change 'export-paths' to always export in topological order.
* guix/store.scm (export-paths): Pass PATHS through
  'topologically-sorted' before iterating.
* tests/store.scm ("export/import paths, ensure topological order"): New
  test.
2014-02-10 23:36:42 +01:00
John Darrington c2e6516721 build-system/gnu: Set the docdir to "share/doc"
* guix/build/gnu-build-system.scm (configure):
  Change docdir directory from "doc" to "share/doc".

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-02-10 22:22:53 +01:00
Ludovic Courtès 6ede17ca69 union: Do not compare directories upon collision.
* guix/build/union.scm (file=?): Return #f if FILE1 and FILE2 are not
  regular files.  Fixes a bug whereby collisions among directories would
  lead to the invocation of 'file=?' and thus 'call-with-input-file' on
  directories.  Reported by Mark H. Weaver <mhw@netris.org>.
2014-02-10 00:05:39 +01:00
Ludovic Courtès 2de227af4b download: Provide a 'User-Agent' field in HTTP requests.
Fixes <http://bugs.gnu.org/16703>.
Reported by Raimon Grau <raimonster@gmail.com>.

* guix/build/download.scm (http-fetch)[headers]: New variable.
  Pass it as #:headers or #:extra-headers to 'http-get' and
  'http-get*'.
2014-02-10 00:03:34 +01:00
Ludovic Courtès 26fc862a61 gnu: linux-initrd: When booting, chdir to the new root before calling 'chroot'.
* guix/build/linux-initrd.scm (boot-system): Add 'chdir' call right
  before 'chroot'.
2014-02-09 23:28:18 +01:00
Ludovic Courtès 45adbd624f monads: Add 'text-file*'.
* guix/monads.scm (text-file*): New procedure.
* tests/monads.scm ("text-file*"): New test.
* doc/guix.texi (The Store Monad): Change example since the previous one
  would erroneously fail to retain a reference to Coreutils.  Document
  'text-file*'.
2014-02-03 23:20:49 +01:00
Ludovic Courtès 92cb2e2888 offload: Have 'build-machines' honor its argument.
* guix/scripts/offload.scm (build-machines): Honor FILE.
2014-02-02 01:32:50 +01:00
Ludovic Courtès 1c2215108b gnu: linux-initrd: Build /dev/input devices.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Make
  dev/input devices.
2014-02-01 02:22:23 +01:00
Ludovic Courtès c04c6ff64c gnu: linux-initrd: Make /dev/{mem,kmem}.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Make
  dev/{mem,kmem}.
2014-02-01 01:07:14 +01:00
Ludovic Courtès 44ddf33ed5 gnu: linux-initrd: Allow the root file system to be volatile.
* gnu/system/linux-initrd.scm (qemu-initrd): Add 'volatile-root?'
  parameter.
* guix/build/linux-initrd.scm (boot-system): Likewise.  Honor it.
2014-01-31 14:26:30 +01:00
Ludovic Courtès 4919d68432 gnu: linux-initrd: Recognize 9p file systems.
* gnu/system/linux-initrd.scm (qemu-initrd)[virtio-9p-modules]: New
  variable.
  [linux-modules]: Append VIRTIO-9P-MODULES when a 9p file system is in
  MOUNTS.
* guix/build/linux-initrd.scm (mount-qemu-9p): New procedure.
  (boot-system): Recognize '9p' in MOUNTS, and use 'mount-qemu-9p'.
2014-01-31 12:52:13 +01:00
Ludovic Courtès fc4bc4b6de gnu: linux-initrd: Properly distinguish between /dev/sda* and /dev/vda*.
* guix/build/linux-initrd.scm (make-essential-device-nodes): Rename
  devices with major = 8 to /dev/sda*.  Make /dev/vda* devices.
* gnu/system/vm.scm (qemu-image): Change '/dev/vda' to '/dev/sda'.
* gnu/system.scm (operating-system-derivation): Likewise.
2014-01-31 01:43:16 +01:00
Ludovic Courtès 83b9e6a185 gnu: linux-initrd: Start a REPL when the root could not be mounted.
* guix/build/linux-initrd.scm (boot-system): Catch errors when mounting
  ROOT and call 'start-repl' upon error.
2014-01-31 01:40:02 +01:00
Ludovic Courtès d425471182 gnu: linux-initrd: Factorize boot code.
* guix/build/linux-initrd.scm (boot-system): New procedure.
* gnu/system/linux-initrd.scm (qemu-initrd): Add keyword parameters
  'guile-modules-in-chroot?' and 'mounts'.  Change builder to simply
  call 'boot-system'.
  (gnu-system-initrd): Change to a simple call to 'qemu-initrd'.
* gnu/system/vm.scm (expression->derivation-in-linux-vm): Call
  'qemu-initrd' with #:guile-modules-in-chroot?.
2014-01-29 21:57:56 +01:00
Ludovic Courtès 413d5351aa monads: Add 'imported-modules' and 'compiled-modules'.
* guix/monads.scm (package-file): Fix typo.
  (imported-modules, compiled-modules): New procedures.
2014-01-29 13:05:42 +01:00
Ludovic Courtès 49a8b80da6 Revert "build-system/gnu: Pass --localstatedir=/var --sharedstatedir=/com."
This reverts commit 65529e49ff.
2014-01-28 08:57:37 +01:00
Ludovic Courtès 65529e49ff build-system/gnu: Pass --localstatedir=/var --sharedstatedir=/com.
Suggested by John Darrington <john@darrington.wattle.id.au>
and Mark H Weaver <mhw@netris.org>.

* guix/build/gnu-build-system.scm (configure): Pass --localstatedir=/var
  --sharedstatedir=/com.
* gnu/packages/admin.scm (dmd): Remove 'arguments' field.
* gnu/packages/avahi.scm (avahi): Remove --localstatedir flag.
* gnu/packages/glib.scm (dbus): Likewise.
* gnu/packages/package-management.scm (guix): Likewise.
* gnu/packages/pulseaudio.scm (pulseaudio): Likewise.
2014-01-27 23:45:59 +01:00
Ludovic Courtès f06afd4da2 download: Add archive.apache.org to the Apache mirrors.
* guix/download.scm (%mirrors)[apache]: Add archive.apache.org as a last
  resort.
2014-01-27 23:31:28 +01:00
Ludovic Courtès a76611c435 offload: Do not try to retrieve anything upon build failure.
* guix/scripts/offload.scm (offload): Add 'log-port' keyword parameter.
  Handle log display here.  Return the result of (close-pipe pipe).
  (process-request): Adjust 'offload' call site accordingly.  Call
  'retrieve-files' only when 'offload' returns zero; exit when 'offload'
  returns non-zero.
2014-01-27 21:32:59 +01:00
Ludovic Courtès 6ce206cb92 Prefer local builds for "small" derivations.
* gnu/system.scm (union, file-union, links): Pass #:local-build? #t to
  'derivation-expression'.
* guix/derivations.scm (imported-files, compiled-modules): Likewise.
* guix/profiles.scm (profile-derivation): Likewise.
2014-01-25 17:22:53 +01:00
Ludovic Courtès 200a97e64f Merge branch 'master' into core-updates 2014-01-25 17:07:21 +01:00
Ludovic Courtès 1909431c5b derivations: Add #:local-build? parameter for derivations.
* guix/derivations.scm (derivation): Add #:local-build? parameter and
  honor it.
  (build-expression->derivation): Likewise.
* doc/guix.texi (Derivations): Update documentation of these
  procedures.
2014-01-25 17:04:35 +01:00
Ludovic Courtès 9e55f04a4b profiles: Remove misleading message.
Fixes <http://bugs.gnu.org/16484>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/profiles.scm (profile-derivation)[builder]: Remove "building
  profile '~a' with ~a packages" message.
2014-01-25 16:20:23 +01:00
Ludovic Courtès 49e6291a7a Add 'guix offload' as a daemon build hook.
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_NO_BUILD_HOOK): New macro.
  (options): Add '--no-build-hook'.
  (parse_opt): Handle it.
  (main)[HAVE_DAEMON_OFFLOAD_HOOK]: Set 'useBuildHook' by default.
  Set $NIX_BUILD_HOOK to our offload hook unless otherwise specified.
  [!HAVE_DAEMON_OFFLOAD_HOOK]: Clear 'useBuildHook'.
* pre-inst-env.in: Set and export NIX_BUILD_HOOK.
* nix/scripts/offload.in, guix/scripts/offload.scm: New files.
* guix/ui.scm (show-guix-help)[internal?]: Add "offload".
* config-daemon.ac: Call 'GUIX_CHECK_UNBUFFERED_CBIP'.
  Instantiate 'nix/scripts/offload'.  Set 'BUILD_DAEMON_OFFLOAD'
  conditional, and optionally define 'HAVE_DEAMON_OFFLOAD_HOOK' cpp
  macro.
* daemon.am (nodist_pkglibexec_SCRIPTS)[BUILD_DAEMON_OFFLOAD]: Add it.
* Makefile.am (MODULES)[BUILD_DAEMON_OFFLOAD]: Add
  'guix/scripts/offload.scm'.
  (EXTRA_DIST)[!BUILD_DAEMON_OFFLOAD]: Likewise.
* m4/guix.m4 (GUIX_CHECK_UNBUFFERED_CBIP): New macro.
* doc/guix.texi (Setting Up the Daemon): Move most of the body to...
  (Build Environment Setup): ... this.  New subsection.
  (Daemon Offload Setup): New subsection.
2014-01-24 00:01:50 +01:00
Ludovic Courtès 50add47748 store: Add 'topologically-sorted'.
* guix/store.scm (topologically-sorted): New procedure.
* tests/store.scm ("topologically-sorted, one item",
  "topologically-sorted, several items", "topologically-sorted, more
  difficult"): New tests.
2014-01-24 00:01:50 +01:00
Ludovic Courtès cd4027fa47 nar: Add 'restore-file-set', for use by build hooks.
* guix/nar.scm (&nar-invalid-hash-error, &nar-signature-error): New
  condition types.
  (&nar-error): Add 'file' and 'port' fields.
  (&nar-read-error): Remove 'port' and 'file' fields.
  (lock-store-file, unlock-store-file, finalize-store-file,
  temporary-store-directory, restore-file-set): New procedures.
* tests/nar.scm (%seed): New variable.
  (random-text): New procedure.
  ("restore-file-set (signed, valid)", "restore-file-set (missing
  signature)", "restore-file-set (corrupt)"): New tests.
* po/Makevars (XGETTEXT_OPTIONS): Add '--keyword=message'.nar fixes
* po/POTFILES.in: Add guix/nar.scm.
2014-01-24 00:01:50 +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