guix-devel/guix
Ludovic Courtès 94d92c7796
daemon: Add "builtin:download" derivation builder.
This ensures that 1) the derivation doesn't change when Guix changes;
2) the derivation closure doesn't contain Guix and its dependencies; 3)
we don't have to rely on ugly chroot hacks.

Adapted from Nix commit 0a2bee307b20411f5b0dda0c662b1f9bb9e0e131.

* nix/libstore/build.cc (DerivationGoal::runChild): Add special case for
'isBuiltin(drv)'.  Disable chroot when 'isBuiltin(drv)'.
* nix/libstore/builtins.cc, nix/libstore/builtins.hh,
nix/scripts/download.in, guix/scripts/perform-download.scm: New files.
* guix/ui.scm (show-guix-help)[internal?]: Add 'perform-download'.
* nix/local.mk (libstore_a_SOURCES): Add builtins.cc.
(libstore_headers): Add builtins.hh.
(nodist_pkglibexec_SCRIPTS): Add 'scripts/download'.
* config-daemon.ac: Emit 'scripts/download'.
* Makefile.am (MODULES): Add 'guix/scripts/perform-download.scm'.
* tests/derivations.scm ("unknown built-in builder")
("'download' built-in builder")
("'download' built-in builder, invalid hash")
("'download' built-in builder, not found")
("'download' built-in builder, not fixed-output"): New tests.

Co-authored-by: Eelco Dolstra <eelco.dolstra@logicblox.com>
2016-11-16 18:19:47 +01:00
..
build Merge branch 'core-updates' 2016-11-13 00:34:16 +01:00
build-system build-system: Add asdf-build-system. 2016-10-08 21:20:35 +08:00
import import/cpan: Maybe coerce version to string. 2016-11-14 00:06:09 +01:00
scripts daemon: Add "builtin:download" derivation builder. 2016-11-16 18:19:47 +01:00
tests tests: Move HTTP server to (guix tests http). 2016-11-16 18:00:41 +01:00
base32.scm base32: Use a custom error condition instead of 'misc-error'. 2015-05-31 22:39:48 +02:00
base64.scm base64: Restore original license header. 2016-08-27 08:45:27 -05:00
build-system.scm build-system: Bags record their system and target. 2014-10-05 21:58:42 +02:00
combinators.scm utils: Move combinators to (guix combinators). 2016-05-04 23:35:55 +02:00
config.scm.in pull: Install (guix config) module to override the user's one. 2016-07-20 22:53:02 +02:00
cpio.scm linux-initrd: Produce cpio archives with zeroed timestamps, etc. 2015-06-24 18:05:03 +02:00
cve.scm cve: Use a more compact format for the list of package/versions. 2016-05-28 01:07:12 +02:00
cvs-download.scm download: Use 'with-imported-modules'. 2016-07-12 22:47:08 +02:00
derivations.scm Use (ice-9 binary-ports) instead of (rnrs io ports). 2016-10-19 15:54:10 +02:00
download.scm guix download: Add '--no-check-certificate' option. 2016-11-07 23:39:01 +01:00
elf.scm elf: Add missing argument in 'elf-segment'. 2015-03-30 15:21:11 +02:00
ftp-client.scm Use (ice-9 binary-ports) instead of (rnrs io ports). 2016-10-19 15:54:10 +02:00
gcrypt.scm Add (guix gcrypt). 2015-01-26 21:58:12 +01:00
gexp.scm gexp: Store compilers in a hash table for O(1) lookup. 2016-09-10 13:10:06 +02:00
git-download.scm download: Use 'with-imported-modules'. 2016-07-12 22:47:08 +02:00
gnu-maintenance.scm gnu-maintenance: GNOME updater honors 'upstream-name' package property. 2016-10-20 22:18:59 +02:00
gnupg.scm gnupg: Honor $GUIX_GPG_COMMAND and default to 'gpg'. 2016-09-06 11:12:11 +02:00
grafts.scm grafts: Apply the right grafts in the presence of multiple outputs. 2016-10-17 23:59:03 +02:00
graph.scm graph: Add 'node-reachable-count'. 2016-05-24 00:06:01 +02:00
hash.scm Use (ice-9 binary-ports) instead of (rnrs io ports). 2016-10-19 15:54:10 +02:00
hg-download.scm download: Use 'with-imported-modules'. 2016-07-12 22:47:08 +02:00
http-client.scm http-client: Add #:verify-certificate? to 'http-fetch'. 2016-11-12 13:04:45 +01:00
licenses.scm licenses: Export fdl1.2+. 2016-11-01 00:05:22 +00:00
modules.scm Add (guix modules). 2016-09-05 00:06:47 +02:00
monad-repl.scm monad-repl: Close connection when leaving the monad REPL. 2016-01-13 17:43:21 +01:00
monads.scm monads: Fix 'liftN' fallback case. 2015-09-04 18:31:06 +02:00
nar.scm utils: Move 'fcntl-flock' to (guix build syscalls). 2016-05-06 13:25:30 +02:00
packages.scm Merge branch 'master' into core-updates 2016-10-17 16:47:12 -04:00
pk-crypto.scm pk-crypto: Improve documentation of 'key-type'. 2015-03-18 14:43:03 +01:00
pki.scm Use (ice-9 binary-ports) instead of (rnrs io ports). 2016-10-19 15:54:10 +02:00
profiles.scm Merge branch 'master' into core-updates 2016-11-07 00:33:16 -05:00
records.scm records: Improve reporting of invalid field specifiers. 2016-07-14 19:07:07 +02:00
scripts.scm emacs: Disable grafts when dry-run is enabled. 2016-07-30 18:17:03 +03:00
search-paths.scm utils: Have search-path-as-list pattern search for directories. 2015-10-29 17:30:18 -05:00
serialization.scm Use (ice-9 binary-ports) instead of (rnrs io ports). 2016-10-19 15:54:10 +02:00
sets.scm Add (guix sets). 2015-01-11 23:50:01 +01:00
store.scm Use (ice-9 binary-ports) instead of (rnrs io ports). 2016-10-19 15:54:10 +02:00
svn-download.scm download: Use 'with-imported-modules'. 2016-07-12 22:47:08 +02:00
tests.scm Use (ice-9 binary-ports) instead of (rnrs io ports). 2016-10-19 15:54:10 +02:00
ui.scm daemon: Add "builtin:download" derivation builder. 2016-11-16 18:19:47 +01:00
upstream.scm import: Gracefully report import failures. 2016-05-17 14:02:48 +02:00
utils.scm Use (ice-9 binary-ports) instead of (rnrs io ports). 2016-10-19 15:54:10 +02:00
zlib.scm zlib: Protect against non-empty port internal buffers. 2016-07-27 12:45:01 +02:00