Commit Graph

1193 Commits (b2c3640d2baa7bc929bf21880e6fb2785f5997f6)

Author SHA1 Message Date
Ludovic Courtès 6ef61cc4c3
daemon: Support multiplexed build output.
This allows clients to tell whether output comes from the daemon or, if
it comes from a builder, from which builder it comes.  The latter is
particularly useful when MAX-BUILD-JOBS > 1.

* nix/libstore/build.cc (DerivationGoal::tryBuildHook)
(DerivationGoal::startBuilder): Print the child's PID in "@ build-started"
traces.
(DerivationGoal::handleChildOutput): Define 'prefix', pass it to
'writeToStderr'.
* nix/libstore/globals.cc (Settings:Settings): Initialize
'multiplexedBuildOutput'.
(Settings::update): Likewise.
* nix/libstore/globals.hh (Settings)[multiplexedBuildOutput]: New field.
Update 'printBuildTrace' documentation.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0.163.
* nix/nix-daemon/nix-daemon.cc (performOp) <wopSetOptions>: Special-case
"multiplexed-build-output" and remove "use-ssh-substituter".
* guix/store.scm (set-build-options): Add #:multiplexed-build-output?
and honor it.
(%protocol-version): Bump to #x163.
* tests/store.scm ("multiplexed-build-output"): New test.

fixlet
2018-10-15 22:40:35 +02:00
Ludovic Courtès b33e191c86
guix build: '-f' accepts file-like objects.
* guix/scripts/build.scm (options->things-to-build)[validate-type]:
Check for 'file-like?'.
(options->derivations): Accept 'file-like?'.
* tests/guix-build.sh: Add a test with 'computed-file'.
* doc/guix.texi (Additional Build Options): Mention file-like objects.
2018-10-09 18:54:12 +02:00
Ludovic Courtès fe17037b38
status: Gracefully handle invalid UTF-8 in build logs.
* guix/status.scm (maybe-utf8->string): New procedure.
(build-event-output-port): Use it in lieu of 'utf8->string'.
* tests/status.scm ("build-output-port, UTF-8")
("current-build-output-port, UTF-8 + garbage"): New tests.
2018-10-09 18:54:12 +02:00
Marius Bakke cf6db76d2a
Merge branch 'master' into core-updates 2018-10-05 19:15:39 +02:00
Ludovic Courtès 7fed9353ec
tests: Adjust services tests to new 'shepherd-service-upgrade'.
This is a followup to 4245ddcbc9.

* tests/services.scm ("shepherd-service-upgrade: one unchanged, one upgraded, one new")
("shepherd-service-upgrade: service depended on is not unloaded")
("shepherd-service-upgrade: obsolete services that depend on each
other"): Adjust to changes in 'shepherd-service-upgrade'.
2018-09-27 23:58:05 +02:00
Ludovic Courtès d4e9317b9d
tests: Update (guix build store-copy) tests.
This is a followup to a387b0bebb.

* tests/gexp.scm ("gexp->derivation, store copy")
("gexp->derivation #:references-graphs"): Add (guix progress) and (guix
records) to the imported modules.
2018-09-27 23:46:44 +02:00
Ludovic Courtès dc0f74e5fc
Add (guix status) and use it for pretty colored output.
* guix/progress.scm (progress-reporter/trace): New procedure.
(%progress-interval): New variable.
(progress-reporter/file): Use it.
* guix/scripts/build.scm (set-build-options-from-command-line): Pass
 #:print-extended-build-trace?.
(%default-options): Add 'print-extended-build-trace?'.
(guix-build): Parameterize CURRENT-TERMINAL-COLUMNS.  Use
'build-status-updater'.
* guix/scripts/environment.scm (%default-options): Add
'print-extended-build-trace?'.
(guix-environment): Wrap body in 'with-status-report'.
* guix/scripts/pack.scm (%default-options): Add 'print-build-trace?' and
'print-extended-build-trace?'.
(guix-pack): Wrap body in 'with-status-report'.
* guix/scripts/package.scm (%default-options, guix-package): Likewise.
* guix/scripts/system.scm (%default-options, guix-system): Likewise.
* guix/scripts/pull.scm (%default-options, guix-pull): Likewise.
* guix/scripts/substitute.scm (progress-report-port): Don't call STOP
when TOTAL is zero.
(process-substitution): Add #:print-build-trace? and honor it.
(guix-substitute)[print-build-trace?]: New variable.
Pass #:print-build-trace? to 'process-substitution'.
* guix/status.scm: New file.
* guix/store.scm (set-build-options): Add #:print-extended-build-trace?;
pass it into PAIRS.
(%protocol-version): Bump.
(protocol-version, nix-server-version): New procedures.
(current-store-protocol-version): New variable.
(with-store, build-things): Parameterize it.
* guix/ui.scm (build-output-port): Remove.
(colorize-string): Export.
* po/guix/POTFILES.in: Add guix/status.scm.
* tests/status.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x162.
* nix/libstore/build.cc (DerivationGoal::registerOutputs)
(SubstitutionGoal::finished): Print a "@ hash-mismatch" trace before
throwing.
2018-09-27 23:21:53 +02:00
Marius Bakke 6a0427af6c
Merge branch 'master' into core-updates 2018-09-26 01:11:32 +02:00
Ludovic Courtès 811b21fb15
profiles: 'packages->manifest' now accepts inferior packages.
* guix/profiles.scm (packages->manifest)[inferiors-loaded?]: New
variable.
[inferior->entry]: New procedure.
Accept inferior packages when INFERIORS-LOADED? is true.
* tests/guix-package.sh: Add test using a manifest with an inferior.
* tests/inferior.scm ("packages->manifest"): New test.
2018-09-21 17:04:37 +02:00
Ludovic Courtès 2e6d64e122
inferior: Add 'inferior-package->manifest-entry'.
* guix/inferior.scm (inferior-package->manifest-entry): New procedure.
* tests/inferior.scm (manifest-entry->list): New procedure.
("inferior-package->manifest-entry"): New test.
2018-09-21 17:04:37 +02:00
Ludovic Courtès eee8b303f6
inferior: Add 'inferior-package-search-paths' & co.
* guix/inferior.scm (%inferior-package-search-paths)
(inferior-package-native-search-paths)
(inferior-package-search-paths)
(inferior-package-transitive-native-search-paths): New procedures.
* tests/inferior.scm ("inferior-package-search-paths"): New test.
2018-09-21 17:04:37 +02:00
Ludovic Courtès 6030396aec
inferior: Add 'inferior-package-inputs' & co.
* guix/inferior.scm (open-inferior): Use (ice-9 match).
(inferior-package-input-field, inferior-package-inputs):
(inferior-package-native-inputs)
(inferior-package-propagated-inputs)
(inferior-package-transitive-propagated-inputs): New procedures.
* tests/inferior.scm ("inferior-package-inputs"): New test.

inputs fixlet
2018-09-21 17:04:37 +02:00
Ludovic Courtès e1a4ffdab5
inferior: Add 'lookup-inferior-packages'.
* guix/inferior.scm (<inferior>)[packages, table]: New fields.
(open-inferior): Initialize these new fields.
(inferior-packages): Rename to...
(%inferior-packages): ... this.
(inferior-packages): New procedure; force the promise.
(%inferior-package-table, lookup-inferior-packages): New procedures.
* tests/inferior.scm ("lookup-inferior-packages")
("lookup-inferior-packages and eq?-ness"): New tests.
2018-09-21 17:04:37 +02:00
Ludovic Courtès 9daf046c5d
inferior: Add 'inferior-package-derivation'.
* guix/inferior.scm (read-inferior-response)
(send-inferior-request): New procedures.
(inferior-eval): Rewrite in terms of these.
(proxy, inferior-package-derivation, inferior-package->derivation)
(package-compiler): New procedures.
* tests/inferior.scm ("inferior-package-derivation"): New test.
2018-09-21 17:04:37 +02:00
Marius Bakke 2817ac3c18
Merge branch 'master' into core-updates 2018-09-20 13:37:58 +02:00
Ludovic Courtès cda08dd339
tests: Skip 'self-contained-tarball' test unconditionally.
* tests/pack.scm ("self-contained-tarball"): Skip unconditionally.
2018-09-18 23:23:44 +02:00
Leo Famulari d763940711
Merge branch 'master' into core-updates 2018-09-13 13:32:39 -04:00
Ludovic Courtès 2225d56a14
profiles: Correctly deal with etc/ being a relative symlink.
Fixes <https://bugs.gnu.org/32686>.
Reported by Oleg Pykhalov <go.wigust@gmail.com>.

* guix/build/profiles.scm (ensure-writable-directory): Add #:symlink.
[absolute?]: New procedure.
[unsymlink]: Use it to determine how to resolve readlink's result.
(build-profile): Pass SYMLINK to 'ensure-writable-directory'.
* tests/profiles.scm ("profile-derivation when etc/ is a relative symlink"):
New test.
2018-09-11 00:14:58 +02:00
Marius Bakke 0aeb134850
Merge branch 'master' into core-updates 2018-09-09 17:40:35 +02:00
Ludovic Courtès 5dec93bb8b
gexp: 'file-union' accepts directory names.
* guix/gexp.scm (file-union): Import (guix build utils).  Make the
parent directories of TARGET.
* tests/gexp.scm ("file-union"): New test.
2018-09-08 23:02:01 +02:00
Ludovic Courtès 9b6c435564
services: 'instantiate-missing-services' reaches fixed point.
Fixes a bug whereby services indirectly depended on would not be
automatically instantiated.

* gnu/services.scm (instantiate-missing-services): Loop back when the
length of ADJUSTED is greater than that of INSTANCES.
* tests/services.scm ("instantiate-missing-services, indirect"): New test.
2018-09-07 23:00:39 +02:00
Ludovic Courtès bd7470185b
Add 'guix describe'.
* guix/scripts/describe.scm: New file.
* Makefile.am (MODULES): Add it.
(SH_TESTS): Add tests/guix-describe.sh.
* po/guix/POTFILES.in: Add it.
* guix/scripts/pull.scm (display-profile-content): Export.
* guix/describe.scm (current-profile, current-profile-entries): Export.
* tests/guix-describe.sh: New file.
* doc/guix.texi (Features): Mention 'guix pull' and provenance tracking.
(Invoking guix pull): Link to 'guix describe'.
(Channels): Likewise.
(Invoking guix describe): New node.
2018-09-07 11:40:22 +02:00
Ludovic Courtès 1540075c79
vm: Make UUID computation really deterministic.
Fixes <https://bugs.gnu.org/32652>.

* gnu/system/vm.scm (operating-system-uuid)[service-name,
file-system-digest]: New procedures.
Map these over services and file systems and hash the result.
* tests/guix-system.sh: Add test.
2018-09-07 11:40:05 +02:00
Ludovic Courtès 3d43017026
tests: Adjust 'add-file-tree-to-store' test for lack of /bin/sh.
* tests/store.scm (%shell): New variable.
("add-file-tree-to-store"): Use it instead of "/bin/sh".  This fixes
builds in the chroot build environment.
2018-09-05 13:59:10 +02:00
Ludovic Courtès ca71942445
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)

* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt.  Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this.  Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this.  Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
 #:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions  Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules.  Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-09-04 17:25:11 +02:00
Ludovic Courtès 7e1d229019
inferior: Add home-page and location package accessors.
* guix/inferior.scm (inferior-package-home-page)
(inferior-package-location): New procedures.
* tests/inferior.scm ("inferior-packages"): Test them.
2018-09-04 17:22:55 +02:00
Marius Bakke 70dc8db8e7
Merge branch 'master' into core-updates 2018-09-03 19:20:06 +02:00
Ludovic Courtès 8e1395be5c
records: Adjust to test changes in 'record-abi-mismatch-error'.
Fixes a test failure introduced in
de5cbd4a38.

* guix/records.scm (abi-check): Refer to TYPE in an unquoted context so
we get at the RTD.
* tests/records.scm ("ABI checks"): Adjust 'catch' handler to changes
in the 'record-abi-mismatch-error' arguments.
2018-08-31 17:26:56 +02:00
Marius Bakke 839167ff9d
Merge branch 'staging' into core-updates 2018-08-25 16:44:07 +02:00
Ludovic Courtès dccd29d17d
import: cpan: Adjust test to new URL.
This is a followup to 9aba9b1278.

* tests/cpan.scm ("cpan->guix-package"): Adjust 'home-page' URL.
2018-08-24 18:04:07 +02:00
Ludovic Courtès 93c333895a
grafts: Add (guix build debug-link) and use it.
Fixes <https://bugs.gnu.org/19973>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/build/debug-link.scm: New file.
* guix/build/graft.scm (%graft-hooks): New variable.
(graft): Add #:hooks and honor it.
* guix/grafts.scm (graft-derivation/shallow): Add (guix build
debug-link) and (guix elf) to #:modules.
* tests/debug-link.scm: New file.
* Makefile.am (MODULES): Add guix/build/debug-link.scm.
(SCM_TESTS): Add tests/debug-link.scm.
2018-08-24 18:01:05 +02:00
Ludovic Courtès f7dfda2c73
gremlin: 'elf-dynamic-info-needed' test is no longer skipped.
* tests/gremlin.scm (%guile-executable): Use /proc/self/exe instead
of (command-line).  For a while now, the first element of (command-line)
was "./build-aux/test-driver.scm"; consequently the test was always
skipped.
2018-08-21 23:27:08 +02:00
Ludovic Courtès 8c7bebd6ea
gexp: Remove backward compatibility hack for 'imported-files'.
* guix/gexp.scm (gexp->derivation): Remove #:import-creates-derivation?.
(imported-files): Remove #:derivation? and adjust callers.
(imported-modules), compiled-modules): Likewise.
* guix/packages.scm (patch-and-repack): Adjust 'gexp->derivation' call.
2018-07-26 22:59:49 +02:00
Marius Bakke 706ae8e15c
Merge branch 'master' into core-updates 2018-07-24 19:56:35 +02:00
Marius Bakke 8440db459a
import: PyPI: Update redirected URL.
* guix/import/pypi.scm (guix-package->pypi-name, pypi->guix-package): Update
docstrings.
(pypi-package?): Test for pypi.org, too.
(pypi-fetch): s/pypi.python.org/pypi.org/
* tests/pypi.scm ("guix-package->pypi-name, new URL style",
"pypi->guix-package", "pypi->guix-package, wheels"): Likewise.
2018-07-24 17:42:04 +02:00
Ludovic Courtès e475211869
database: Reset timestamps to one second after the Epoch.
Previously, store items registered in the database by this code (for
instance, store items retrieved by 'guix offload' and passed to
'restore-file-set') would have an mtime of 0 instead of 1.

This would cause problems for things like .go files: Guile would
consider them to be older than the corresponding .scm file, and
consequently it would ignore them and possibly use another (incorrect)
.go file.

Reported by Ricardo Wurmus.

* guix/store/database.scm (reset-timestamps): Pass 1, not 0, to
'utime'.
* tests/store-database.scm ("register-path"): Check the mtime of FILE
and REF.
2018-07-20 15:01:33 +02:00
Ludovic Courtès c71cd4a61f
hash: sha256 port now implements 'port-position'.
* guix/hash.scm (open-sha256-port)[position]: New variable.
[get-position]: New procedure.
Pass it to 'make-custom-binary-output-port'.
* tests/hash.scm ("open-sha256-port, hello"): Test 'port-position'.
2018-07-19 17:08:53 +02:00
Ludovic Courtès e529d46828
gexp: 'imported-files/derivation' can copy files instead of symlinking.
* guix/gexp.scm (imported-files/derivation): Add #:symlink? and honor
it.
(imported-files): Pass #:symlink? to 'imported-files/derivation'.
* tests/gexp.scm ("imported-files with file-like objects"): Add 'file=?'
and use it instead of calling 'readlink'.
2018-07-19 11:48:04 +02:00
Ludovic Courtès 8df2eca6b0
gexp: 'imported-files' no longer creates a derivation by default.
* guix/gexp.scm (gexp->derivation): Add #:import-creates-derivation?.
Pass #:derivation? to 'imported-modules' and 'compiled-modules'.  In -L
argument, check whether MODULES is a derivation.
(%not-slash): New variable.
(file-mapping->tree): New procedure.
(imported-files): Rename to...
(imported-files/derivation): ... this.
(imported-files): New procedure.  Rewrite in terms of
'interned-file-tree' when possible; add #:derivation? parameter.
(imported-modules, compiled-modules): Add #:derivation? parameter and
pass it to 'imported-files'.
* guix/packages.scm (patch-and-repack): Pass
 #:import-creates-derivation? to 'gexp->derivation'.
* tests/gexp.scm ("imported-files"): Adjust to no longer expect a
derivation.
2018-07-19 11:48:04 +02:00
Ludovic Courtès 7f11efbac7
store: Add 'add-file-tree-to-store'.
* guix/store.scm (%not-slash): New variable.
(add-file-tree-to-store, interned-file-tree): New procedures.
* tests/store.scm ("add-file-tree-to-store"): New test.
2018-07-19 11:48:04 +02:00
Ludovic Courtès b94b698d4e
serialization: Add 'write-file-tree'.
* guix/serialization.scm (write-contents-from-port): New procedure.
(write-contents): Write in terms of 'write-contents-from-port'.
(filter/sort-directory-entries, write-file-tree): New procedures.
(write-file): Rewrite in terms of 'write-file-tree'.
* tests/nar.scm ("write-file-tree + restore-file"): New test.
2018-07-19 11:48:04 +02:00
Leo Famulari 92bcccc51f
tests: Don't rely on temporary directories being permanent.
* tests/gexp.scm ("gexp->script #:module-path",
"program-file #:module-path"): Use run-with-store.
2018-07-13 17:33:45 -04:00
Ludovic Courtès 2ca299caf6
Add (guix inferior) and (guix scripts repl).
* guix/inferior.scm, guix/scripts/repl.scm, tests/inferior.scm: New
files.
* Makefile.am (MODULES): Add 'guix/scripts/repl.scm' and
'guix/inferior.scm'.
(SCM_TESTS): Add 'tests/inferior.scm'.
* doc/guix.texi (Invoking guix repl): New node.
2018-07-13 17:28:39 +02:00
Ludovic Courtès bc6e291ef0
guix package: Use relative symlinks to generations.
Reported by Roel Janssen <roel@gnu.org>
at <https://lists.gnu.org/archive/html/guix-devel/2018-07/msg00036.html>.

* guix/profiles.scm (switch-to-generation): Use (basename generation) as
the symlink target.
* guix/scripts/package.scm (build-and-use-profile): Likewise,
use (basename name) as the symlink target.
* tests/guix-package.sh: Adjust --roll-back test accordingly.  Add
explicitly test with '-p foo/prof'.
2018-07-13 17:28:39 +02:00
Danny Milosavljevic e39a44f340
import: hackage: Evaluate "-any" and "-none" version comparison operators.
* guix/import/cabal.scm (eval-cabal): Modify.
* tests/hackage.scm (test-cabal-4): New variable and test.
(test-cabal-5): New variable and test.
(test-cabal-6): New variable and test.
2018-07-12 20:35:04 +02:00
Oleg Pykhalov 88388766f7
import: gem: Add recursive import.
* doc/guix.texi (Invoking guix import): Document gem recursive import.
* guix/import/gem.scm (gem->guix-package): Return package and dependencies
values.
(gem-recursive-import): New procedure.
* guix/scripts/import/gem.scm (show-help, %options): Add recursive option.
(guix-import-gem): Use 'gem-recursive-import'.
* tests/gem.scm (test-json): Rename to 'test-foo-json'.
("gem->guix-package"): Use 'test-foo-json'.
(test-bar-json, test-bundler-json): New variables.
("gem-recursive-import"): New test.
2018-07-11 07:08:54 +03:00
Julien Lepiller b24443bff9
guix: Add opam importer.
* guix/scripts/import.scm (importers): Add opam.
* guix/scripts/import/opam.scm: New file.
* guix/import/opam.scm: New file.
* tests/opam.scm: New file.
* Makefile.am: Add them.
* doc/guix.texi (Invoking guix import): Document it.
2018-07-10 10:11:01 +02:00
Ludovic Courtès ee75e80c05
tests: Skip 'guix-pack.sh'.
This works around a regression introduced in commit
66e9944e07 while waiting for a proper fix.

* tests/guix-pack.sh: Add "exit 77".
2018-07-05 21:35:55 +02:00
Ludovic Courtès 25c7ff6a3e
syscalls: Define AT_SYMLINK_NOFOLLOW et al.
* guix/build/syscalls.scm (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR)
(AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, AT_EMPTY_PATH): New variables.
* tests/syscalls.scm ("utime with AT_SYMLINK_NOFOLLOW"): New test.
2018-07-03 17:50:04 +02:00
Ludovic Courtès 3dbf331942
deduplication: Place link files under /gnu/store/.links.
Previously they'd always be placed next to TO-REPLACE, which would lead
to EPERM in some cases.

* guix/store/deduplication.scm (replace-with-link): Add #:swap-directory
parameter and honor it.  Add call to 'make-file-writable'.  Catch
'system-error' around 'rename-file'.
(deduplicate): Pass #:swap-directory and remove uses of
'false-if-system-error'.
* tests/store-deduplication.scm ("deduplicate"): Add 'chmod' call.
2018-07-03 00:39:11 +02:00
Ricardo Wurmus f1728d4346
Merge branch 'master' into core-updates 2018-06-29 22:51:23 +02:00
Ludovic Courtès 68a58775e0
system: Mapped devices needed for boot do not yield Shepherd services.
Fixes <https://bugs.gnu.org/31889>.
Reported by Taylan Kammer <taylanbayirli@gmail.com>.

* gnu/system.scm (non-boot-file-system-service)[mapped-devices-for-boot]:
New variable.
Remove dependencies of FS that are members of MAPPED-DEVICES-FOR-BOOT.
(mapped-device-user): Rename to...
(mapped-device-users): ... this.  Use 'filter' instead of 'find'.
(operating-system-user-mapped-devices)
(operating-system-boot-mapped-devices): Use 'any
file-system-needed-for-boot?' instead of looking at the first user.
* tests/system.scm ("non-boot-file-system-service"): New test.
2018-06-21 23:54:15 +02:00
Ludovic Courtès ea0a06cee2
Remove 'guix-register' and its traces.
* Makefile.am (SH_TESTS): Remove tests/guix-register.sh.
* build-aux/pre-inst-env.in (GUIX_REGISTER): Remove.
* gnu/build/install.scm (directives): Remove outdated comment.
* gnu/build/vm.scm (root-partition-initializer): Update comment.
* gnu/packages/package-management.scm (guix-register): Remove.
* guix/config.scm.in (%sbindir, %guix-register-program): Remove.
* guix/scripts/system.scm (install): Adjust docstring.
* guix/self.scm (make-config.scm): Remove #:guix.  Do not generate
%sbindir and %guix-register-program.
(specification->package): Remove "guix".
* nix/guix-register/guix-register.cc: Remove.
* nix/libstore/store-api.cc (decodeValidPathInfo): Remove.
* nix/libstore/store-api.hh (decodeValidPathInfo): Remove declaration.
* nix/local.mk (sbin_PROGRAMS, guix_register_SOURCES)
(guix_register_CPPFLAGS, guix_register_LDFLAGS): Remove.
* tests/guix-register.sh: Remove.
2018-06-14 11:17:00 +02:00
Ludovic Courtès df2f6400b1
store: Remove 'register-path'.
* guix/store.scm (register-path): Remove.
* guix/nar.scm: Use (guix store database).
* guix/scripts/system.scm: Likewise.
* tests/store-database.scm: Remove #:hide (register-path).
* tests/store.scm ("register-path"): Remove.
2018-06-14 11:17:00 +02:00
Ludovic Courtès ef1297e8c7
database: 'sqlite-register' takes a database, not a file name.
* guix/store/database.scm (sqlite-register): Remove #:db-file and add
'db' parameter.  Remove #:schema and 'parameterize'.
(register-path): Wrap 'sqlite-register' call in 'with-database' and in
'parameterize'.
* tests/store-database.scm ("new database")
("register-path with unregistered references"): Adjust accordingly.
2018-06-14 11:17:00 +02:00
Ludovic Courtès 0d0438ed8c
deduplicate: Fix a couple of thinkos.
* guix/store/deduplication.scm (get-temp-link): Turn 'args' in the 'catch'
handler into a rest argument.
(deduplicate): Use 'lstat' instead of 'file-is-directory?' to properly
handle symlinks.  When iterating over the result of 'scandir', exclude
the ".links" sub-directory.
* tests/store-deduplication.scm ("deduplicate"): Create sub-directories
and call 'deduplicate' directly on STORE.
2018-06-14 11:16:59 +02:00
Ludovic Courtès 6892f0a247
store-copy: 'read-reference-graph' returns a list of records.
The previous implementation of 'read-reference-graph' was good enough
for many use cases, but it discarded the graph structure, which is
useful information in some cases.

* guix/build/store-copy.scm (<store-info>): New record type.
(read-reference-graph): Rewrite to return a list of <store-info>.
(closure-size, populate-store): Adjust accordingly.
* gnu/services/base.scm (references-file): Adjust accordingly.
* gnu/system/vm.scm (system-docker-image): Likewise.
* guix/scripts/pack.scm (squashfs-image, docker-image): Likewise.
* tests/gexp.scm ("gexp->derivation #:references-graphs"): Likewise.
2018-06-14 11:16:58 +02:00
Ludovic Courtès f8f9f7cabc
database: Fail registration when encountering unregistered references.
* guix/store/database.scm (add-reference-sql): Remove nested SELECT.
(add-references): Expect REFERENCES to be a list of ids.
(sqlite-register): Call 'path-id' for each of REFERENCES and pass it to
'add-references'.
* tests/store-database.scm ("register-path with unregistered references"):
New test.
2018-06-14 11:16:58 +02:00
Ludovic Courtès 3931c76154
database: 'with-database' can now initialize new databases.
* nix/libstore/schema.sql: Rename to...
* guix/store/schema.sql: ... this.
* Makefile.am (nobase_dist_guilemodule_DATA): Add it.
* nix/local.mk (%D%/libstore/schema.sql.hh): Adjust accordingly.
* guix/store/database.scm (sql-schema): New variable.
(sqlite-exec, initialize-database, call-with-database): New procedures.
(with-database): Rewrite in terms of 'call-with-database'.
* tests/store-database.scm ("new database"): New test.
* guix/self.scm (compiled-guix)[*core-modules*]: Add 'schema.sql' to
 #:extra-files.
2018-06-14 11:16:58 +02:00
Ludovic Courtès c423ae8918
packages: Add 'package-patched-vulnerabilities'.
* guix/packages.scm (patch-file-name): New procedure.
(%vulnerability-regexp): New variable.
(package-patched-vulnerabilities): New procedure.
* guix/scripts/lint.scm (patch-file-name): Remove.
(check-vulnerabilities): Adjust to use
'package-patched-vulnerabilities'.
* tests/packages.scm ("package-patched-vulnerabilities"): New test.
2018-06-09 12:02:28 +02:00
Ricardo Wurmus 8709624756
Merge branch 'origin/core-updates-next' into core-updates 2018-06-06 23:01:48 +02:00
Ludovic Courtès 477ee222aa
tests: Adjust 'guix package' test to "python2" name.
This is a followup to a7714d42de, which
renamed Python 2.x to "python2".

* tests/guix-package.sh: Use g-wrap and guile@2.0 when testing
collisions.
2018-06-06 14:37:35 +02:00
Ludovic Courtès a99b0ad785
tests: Adjust graph test.
This is a followup to 301a424906, which
added a dependency to sed.

* tests/graph.scm ("node-edges"): Use 'hello', not 'sed', as the example
of a package without any dependency.
2018-06-06 14:37:35 +02:00
Ludovic Courtès a13c1bf4ca
Merge branch 'master' into core-updates 2018-06-01 23:41:40 +02:00
Caleb Ristvedt bf5bf5778c
Add (guix store deduplication).
* guix/store/database.scm (register-path): Add #:deduplicate? and call
'deduplicate' when it's true.
(counting-wrapper-port, nar-sha256): Move to...
* guix/store/deduplication.scm: ... here.  New file.
* tests/store-deduplication.scm: New file.
* Makefile.am (STORE_MODULES): Add deduplication.scm.
(SCM_TESTS) [HAVE_GUILE_SQLITE3]: Add store-deduplication.scm.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2018-06-01 15:35:54 +02:00
Caleb Ristvedt 7f9d184d9b
Add (gnu store database).
* guix/config.scm.in (%store-database-directory): New variable.
* guix/store/database.scm: New file.
* tests/store-database.scm: New file.
* Makefile.am (STORE_MODULES): New variable.
(MODULES, MODULES_NOT_COMPILED): Adjust accordingly.
(SCM_TESTS) [HAVE_GUILE_SQLITE3]: Add tests/store-database.scm.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2018-06-01 15:35:32 +02:00
Ludovic Courtès 838e17d805
gexp: Add 'with-extensions'.
* guix/gexp.scm (<gexp>)[extensions]: New field.
(gexp-attribute): New procedure.
(gexp-modules): Write in terms of 'gexp-attribute'.
(gexp-extensions): New procedure.
(gexp->derivation): Add #:effective-version.
[extension-flags]: New procedure.
Honor extensions of EXP.
(current-imported-extensions): New syntax parameter.
(with-extensions): New macro.
(gexp): Honor CURRENT-IMPORTED-EXTENSIONS.
(compiled-modules): Add #:extensions and honor it.
(load-path-expression): Likewise.
(gexp->script, gexp->file): Honor extensions.
* tests/gexp.scm (%extension-package): New variable.
("gexp-extensions & ungexp")
("gexp-extensions & ungexp-splicing")
("gexp-extensions and literal Scheme object")
("gexp->derivation & with-extensions")
("program-file & with-extensions"): New tests.
* doc/guix.texi (G-Expressions): Document 'with-extensions'.
2018-06-01 15:20:54 +02:00
Ludovic Courtès ccc951cab3
pack: Adjust test to expect relative symlinks.
Reported by Chris Marusich <cmmarusich@gmail.com>.
Fixes <https://bugs.gnu.org/31560>.

* tests/pack.scm ("self-contained-tarball"): Rename 'guile' to 'bin'.
Expect 'bin/Guile' to be a relative symlink.
2018-06-01 15:17:41 +02:00
Ricardo Wurmus 44057a461b
tests: Fix arguments in pack test.
This is a follow-up to commit 5ffac538aa.

* tests/pack.scm (self-contained-tarball): Adjust arguments to
"self-contained-tarball".
2018-06-01 14:18:31 +02:00
Ricardo Wurmus a82eefe65a
tests: Fix arguments in pack test.
This is a follow-up to commit 5ffac538aa.

* tests/pack.scm (self-contained-tarball): Adjust arguments to
"self-contained-tarball".
2018-05-30 09:55:28 +02:00
Mark H Weaver 82b695b834
Merge branch 'master' into core-updates 2018-05-28 20:45:37 -04:00
Ludovic Courtès 9ceeca0880
system: Remove uses of the 'title' field of <file-system>.
* gnu/system/install.scm (installation-os): Remove uses of the 'title'
field of 'file-system'; use 'file-system-label' as appropriate.
* gnu/system/vm.scm (system-disk-image, system-qemu-image): Likewise.
* gnu/tests.scm (%simple-os): Likewise.
* gnu/tests/install.scm (%minimal-os, %minimal-extlinux-os)
(%minimal-os-on-vda, %separate-home-os, %separate-store-os)
(%raid-root-os, %encrypted-root-os, %btrfs-root-os): Likewise.
* gnu/build/shepherd.scm (default-mounts)[tmpfs]: Likewise.
* tests/guix-system.sh: Likewise.
* tests/system.scm (%root-fs): Likewise.
("operating-system-boot-mapped-devices, implicit dependency"): Likewise.
2018-05-28 13:24:19 +02:00
Mark H Weaver 9d10a63402
Merge branch 'master' into core-updates 2018-05-24 02:34:08 -04:00
Ludovic Courtès 7874bbbb9f
records: Insert record type ABI checks in constructors.
* guix/records.scm (print-record-abi-mismatch-error): New procedure.
<top level>: Add 'set-exception-printer!' call.
(current-abi-identifier, abi-check): New procedures.
(make-syntactic-constructor): Add #:abi-cookie parameter.  Insert calls
to 'abi-check'.
(define-record-type*)[compute-abi-cookie]: New procedure.
Use it and emit a definition of the 'current-abi-identifier' for TYPE.
* tests/records.scm ("ABI checks"): New test.
2018-05-23 10:21:02 +02:00
Mark H Weaver 0661758e13
Merge branch 'master' into core-updates 2018-05-21 13:22:32 -04:00
Ludovic Courtès 263c9941a1
uuid: 'uuid' returns #f when 'string->uuid' returns #f.
* gnu/system/uuid.scm (uuid): When STR is not a literal, return #f when
'string->uuid' returns #f.
* tests/uuid.scm ("uuid, dynamic value"): New test.
2018-05-19 00:14:52 +02:00
Ludovic Courtès ce9e684b83
tests: Skip 'tests/guix-pack.sh' when networking is missing.
The test could fail because "static-binaries.tar.xz" is missing, for
instance.

* tests/guix-pack.sh: Require a network connection to be on the safe
side.  This reverts part of 47a60325ca.
2018-05-19 00:14:51 +02:00
Ludovic Courtès 7acdecec99
tests: Adjust to new "unbound variable" messages.
This is a followup to 2d2f98efb3.

* tests/guix-system.sh: Adjust regexps to match "error:".
2018-05-19 00:14:51 +02:00
Mark H Weaver 539bf8f2c0
Merge branch 'master' into core-updates 2018-05-17 01:00:50 -04:00
Ludovic Courtès 437f62f02a
utils: Add 'version-prefix?'.
* guix/utils.scm (version-prefix?): New procedure.
* tests/utils.scm ("version-prefix?"): New test.
2018-05-13 13:29:27 +02:00
Ludovic Courtès 47a60325ca
pack: Add '--relocatable'.
* gnu/packages/aux-files/run-in-namespace.c: New file.
* Makefile.am (AUX_FILES): Add it.
* guix/scripts/pack.scm (<c-compiler>): New record type.
(c-compiler, bootstrap-c-compiler, c-compiler-compiler): New procedures.
(self-contained-tarball): Use
'relative-file-name' for the SOURCE -> TARGET symlink.
(docker-image): Add 'defmod' to please Geiser.
(wrapped-package, map-manifest-entries): New procedures.
(%options, show-help): Add --relocatable.
(guix-pack): Honor it.
2018-05-10 14:53:57 +02:00
Ludovic Courtès e00ade3fb8
profiles: Optionally use relative file names for symlink targets.
* guix/build/union.scm (symlink-relative): New procedure.
* guix/build/profiles.scm: Re-export it.
(build-profile): Add #:symlink and pass it to 'union-build'.
* guix/profiles.scm (profile-derivation): Add #:relative-symlinks?.
Pass #:symlink to 'build-profile'.
* tests/profiles.scm ("profile-derivation relative symlinks, one entry")
("profile-derivation relative symlinks, two entries"): New tests.
2018-05-10 14:53:57 +02:00
Ludovic Courtès dac1c97d13
union: Add 'relative-file-name'.
* guix/build/union.scm (%not-slash): New variable.
(relative-file-name): New procedure.
* tests/union.scm (test-relative-file-name): New macro and tests.
2018-05-10 14:53:56 +02:00
Chris Marusich ede121de42
guix: Separate the package name and version with "@", not "-".
* guix/packages.scm (package-full-name): By default, use "@" to separate
  the package name and package version.  Add an optional delimiter
  argument so that there is still a way to explicitly use a different
  delimiter.
* gnu/packages/commencement.scm (gcc-boot0) <unpack-gmp&co>: Adjust
  accordingly.
* tests/graph.scm: Adjust accordingly.
* tests/profiles.scm: Adjust accordingly.
* NEWS: Mention the change.

Fixes: <https://bugs.gnu.org/31088>.
Reported by Pierre Neidhardt <ambrevar@gmail.com>.
2018-05-08 21:55:46 -07:00
Mark H Weaver aedc6e9fc9
Merge branch 'master' into core-updates 2018-05-08 18:45:39 -04:00
Ludovic Courtès d26727a143
pack: Fix handling of '-e'.
Fixes a regression introduced in
aad16cc196.
Reported by Julien Lepiller.

* guix/scripts/pack.scm (guix-pack)[manifest-from-args]: In
'match-lambda', add clause for single packages.
* tests/guix-pack.sh: Add test for '-e'.
2018-05-07 14:04:19 +02:00
Ludovic Courtès b178fc2369
gremlin: Add 'strip-runpath'.
* guix/build/gremlin.scm (strip-runpath): New procedure.
* tests/gremlin.scm (c-compiler): New variable.
("strip-runpath"): New test.
2018-05-07 11:21:36 +02:00
Ludovic Courtès aad16cc196
pack: Honor package transformation options.
Previously they would silently be ignored.

* guix/scripts/pack.scm (guix-pack)[manifest-from-args]: Add 'store'
parameter.  Call 'options->transformation' and use it.
Move 'with-store' and 'parameterize' around the 'let'.
* tests/guix-pack.sh: Add test using '--with-source'.
2018-05-07 10:46:07 +02:00
Ludovic Courtès df6f86a0cb
pack: Adjust test to cope with GC'd profiles.
Previous "test -x opt/gnu/bin/guile" would fail if the store item
"opt/gnu/bin" points to had been GC'd.

* tests/guix-pack.sh: Replace "test -x" with "test -L" to deal with
store items that have been reclaimed.
2018-05-07 10:41:33 +02:00
Marius Bakke 12bd588346
Merge branch 'master' into core-updates 2018-05-06 15:56:24 +02:00
Ludovic Courtès 2d2f98efb3
guix build: Nicely report unbound variables with hints.
* guix/ui.scm (print-unbound-variable-error): Add "error:" to the
message.
(report-unbound-variable-error): New procedure, with code formerly in
'report-load-error'.
(report-load-error): Use it.
(call-with-unbound-variable-handling): New procedure.
(with-unbound-variable-handling): New macro.
* guix/scripts/build.scm (options->derivations): Wrap body in
'with-unbound-variable-handling'.
* tests/guix-build.sh (GUIX_PACKAGE_PATH): Add test.
2018-05-04 15:07:08 +02:00
Mark H Weaver f0ae90cbbb
Merge branch 'master' into core-updates 2018-04-30 16:48:15 -04:00
Ludovic Courtès 6ac8b7359a
guix system: search: Display default Shepherd service names.
Fixes <https://bugs.gnu.org/29707>.
Reported by Clément Lassieur <clement@lassieur.org>.

* guix/scripts/system/search.scm (service-type-default-shepherd-services)
(service-type-shepherd-names): New procedures.
(service-type->recutils): Use it.
* tests/guix-system.sh: Add test.
2018-04-30 14:22:43 +02:00
Mark H Weaver c52872bfc4
Merge branch 'master' into core-updates 2018-04-21 05:02:52 -04:00
Roel Janssen 5cefb13ddd
guix-daemon: Disable garbage collection for remote connections.
* nix/nix-daemon/nix-daemon.cc (isRemoteConnection): New variable.
  (performOp): For wopCollectGarbage, throw an error when isRemoteConnection
  is set.
  (acceptConnection): Set isRemoteConnection when connection is not AF_UNIX.
* tests/guix-daemon.sh: Add a test for the new behavior.
2018-04-19 19:06:26 +02:00
Mark H Weaver 3c0316169b
Merge branch 'master' into core-updates 2018-04-11 17:19:06 -04:00
Ludovic Courtès 4fbd1a2b7f
gexp: 'scheme-file' can splice expressions.
* guix/gexp.scm (<scheme-file>)[splice?]: New field.
(scheme-file): Add #:splice? and pass it to '%scheme-file'.
(scheme-file-compiler): Pass SPLICE? to 'gexp->file'.
(gexp->file): Add #:splice? and honor it.
* tests/gexp.scm ("gexp->file + #:splice?"): New test.
("gexp->derivation & with-imported-module & computed module"): Use
 #:splice? #t.
2018-04-11 01:03:47 +02:00
Mark H Weaver f89aa1521a
Merge branch 'master' into core-updates 2018-04-10 00:42:22 -04:00
Ludovic Courtès e40aa54e98
union: Allow callers to choose the collision resolution policy.
* guix/build/union.scm (warn-about-collision): New procedure.
(union-build): Add #:resolve-collision.
[resolve-collisions]: Call it.
* tests/union.scm ("union-build collision first & last"): New test.
2018-04-08 17:41:08 +02:00
Ludovic Courtès 6ef80eb0d9
tests: Skip 'pivot-root' test on Ubuntu's 4.4 kernels.
Fixes <https://bugs.gnu.org/25476>.
Reported by Paul Garlick <pgarlick@tourbillion-technology.com>
and Maria Sidorova <hydromasha@gmail.com>.

* tests/syscalls.scm ("pivot-root"): Skip on known-bad Ubuntu kernels.
2018-04-08 17:41:08 +02:00
Ludovic Courtès fc95dc4c34
guix package: Add '--allow-collisions'.
Fixes <https://bugs.gnu.org/30830>.
Suggested by Ricardo Wurmus <rekado@elephly.net>.

* guix/scripts/package.scm (build-and-use-profile): Add
 #:allow-collisions? and pass it to 'profile-derivation'.
(show-help, %options): Add '--allow-collisions'.
(manifest-action, process-actions): Pass #:allow-collisions? to
'build-and-use-profile'.
* tests/guix-package.sh: Add collision test.
* doc/guix.texi (Invoking guix package): Document '--allow-collisions'.
2018-03-31 23:30:50 +02:00
Marius Bakke 5576cfabf3
Merge branch 'master' into core-updates 2018-03-29 17:34:41 +02:00
Mark H Weaver 1e868858fd
tests: Use invoke and return #t from all builders.
* tests/packages.scm ("package-source-derivation, snippet", "trivial")
("trivial with local file as input", "trivial with source")
("trivial with system-dependent input", "trivial with #:allowed-references")
("--search-paths with pattern", "--search-paths with single-item search path")
("replacement also grafted"): In the builders, raise an exception on errors
and otherwise return #t.  Use invoke.
2018-03-27 21:35:43 -04:00
Ludovic Courtès 8980eea5ab
guix gc: Add '--derivers'.
* guix/scripts/gc.scm (show-help, %options): Add '--derivers'.
(guix-gc): Handle 'list-derivers'.
* tests/guix-gc.sh: Add test.
* doc/guix.texi (Invoking guix gc): Document it.
2018-03-27 14:51:44 +02:00
Ludovic Courtès b06a70e05d
graph: Add "module" node type.
* guix/scripts/graph.scm (module-from-package)
(source-module-dependencies*): New procedures.
(%module-node-type): New variable.
(%node-types): Add it.
* guix/modules.scm (source-module-dependencies): Export.
* tests/graph.scm ("module graph"): New test.
* doc/guix.texi (Invoking guix graph): Document it.
2018-03-27 14:51:44 +02:00
Chris Marusich 8e88f6fa82
tests: Add tests for "guix system disk-image" et al.
* tests/guix-system.sh: Add test cases that exercise (1) all of the
  example files in gnu/system/examples, and (2) all of the "image"
  creation commands: vm, vm-image, disk-image, and docker-image.
2018-03-24 03:04:11 +01:00
Chris Marusich 272c070962
tests: Add tests for "guix pack".
* guix/scripts/pack.scm (bootstrap-xz): New variable.
  (%options) <--bootstrap>: New option.
  (show-help): Document the new --bootstrap option.
  (guix-pack): When --bootstrap is specified, use the bootstrap Guile,
  tar, and xz to build the pack, and do not use any profile hooks or
  locales.
* doc/guix.texi (Invoking guix pull): Document the new --bootstrap
  option.
* tests/guix-pack.sh: New file.
* Makefile.am (SH_TESTS): Add guix-pack.sh.
* gnu/packages/package-management.scm (guix) <inputs>: Add util-linux.
2018-03-24 03:04:07 +01:00
Ludovic Courtès 427ec19e88
gexp: 'program-file' has a new #:module-path parameter.
* guix/gexp.scm (<program-file>): Add 'path' field.
(program-file): Add #:module-path parameter and honor it.
(program-file-compiler): Honor the 'path' field.
* tests/gexp.scm ("program-file #:module-path"): New test.
* doc/guix.texi (G-Expressions): Update.
2018-03-23 18:41:07 +01:00
Ludovic Courtès 1ae16033f3
gexp: 'gexp->script' and 'gexp->file' have a new #:module-path parameter.
* guix/gexp.scm (load-path-expression): Add 'path' optional parameter.
(gexp->script): Add #:module-path and honor it.
(gexp->file): Likewise.
* tests/gexp.scm ("gexp->script #:module-path"): New test.
* doc/guix.texi (G-Expressions): Update accordingly.
2018-03-23 18:41:07 +01:00
Ludovic Courtès 04d2a16c4f
publish: Always build a new derivation for the "/log/NAME" test.
Fixes <https://bugs.gnu.org/30868>.
Reported by Martin Castillo <castilma@uni-bremen.de>.

* tests/publish.scm ("/log/NAME"): Use #$(random-text) in the builder.
2018-03-22 12:54:31 +01:00
Ludovic Courtès c1cd155aa8
publish: Add test for non-GET queries.
* tests/publish.scm ("non-GET query"): New test.
2018-03-22 12:51:23 +01:00
Ludovic Courtès 71e08fde28
glob: Add an extra glob pattern compilation stage.
* guix/glob.scm (compile-glob-pattern): Rename to...
(string->sglob): ... this.
(compile-sglob, string->compiled-sglob): New procedures.
(glob-match?): Replace '?, 'range, and 'set with a single clause.
* tests/glob.scm (test-compile-glob-pattern): Rename to...
(test-string->sglob): ... this.  Adjust accordingly.
(test-glob-match): Use 'string->compiled-sglob' instead of
'compile-glob-pattern'.
* gnu/build/linux-modules.scm (read-module-aliases): Use
'string->compiled-sglob' instead of 'compile-glob-pattern'.
2018-03-18 22:57:17 +01:00
Ludovic Courtès e914b398af
glob: Support square brackets in patterns.
* guix/glob.scm (wildcard-indices): Remove.
(parse-bracket): New procedure.
(compile-glob-pattern): Rewrite.  Support square brackets for sets and
ranges.
(glob-match?): Support sets and ranges.
* tests/glob.scm (test-compile-glob-pattern)
(test-glob-match): New macros.
Use them to rewrite the existing tests, and add new tests.
2018-03-18 22:35:36 +01:00
Ludovic Courtès 17cdd3d0fe
tests: elpa: Don't actually download files.
* tests/elpa.scm (eval-test-with-elpa): Mock 'url-fetch'.
2018-03-18 22:33:41 +01:00
Ludovic Courtès e5425ed950
import: elpa: Adjust test for HTTPS URLs.
This is a followup to 44dd3d579d.

* tests/elpa.scm (eval-test-with-elpa): Use https.
2018-03-18 22:25:54 +01:00
Ludovic Courtès f8ec8d96d6
tests: Do not assume the bootstrap guile tarball is available locally.
Fixes <https://bugs.gnu.org/30824>.
Reported by Chris Marusich <cmmarusich@gmail.com>.

* tests/packages.scm ("package-source-derivation, snippet"): Use
'bootstrap-guile-origin' instead of assuming the bootstrap guile tarball
is available locally.
2018-03-15 10:25:10 +01:00
Efraim Flashner 64f925cb4b
gnu: time: Update to 1.9.
* gnu/packages/time.scm (time): Update to 1.9.
* tests/guix-build.sh: Update time package to 1.9.
2018-03-13 20:17:06 +02:00
Ludovic Courtès 33286075b9
hash: Add 'sha1'.
* guix/hash.scm (GCRY_MD_SHA1): New macro.
(bytevector-hash): New procedure.
(sha256): Express in terms of 'bytevector-hash'.
(sha1): New procedure.
* tests/hash.scm ("sha1, empty", "sha1, hello"): New tests.
2018-03-08 11:56:20 +01:00
Ludovic Courtès f14c933df1
Add (guix glob).
* guix/glob.scm, tests/glob.scm: New files.
* Makefile.am (MODULES): Add guix/glob.scm.
(SCM_TESTS): Add tests/glob.scm.
2018-03-02 13:46:25 +01:00
Mike Gerwitz e37944d827
environment: Add --user.
This change allows overriding the home directory of all filesystem mappings to
help hide the identity of the calling user in a container.

* doc/guix.texi (Invoking guix environment)[--container]: Mention --user.
[--user]: Add item.
* guix/scripts/environment.scm (show-help): Add --user.
(%options): Add --user.
(launch-environment/container) Add 'user' parameter.  Update doc.  Override
'user-mappings' using 'override-user-mappings'.  Consider override for chdir.
(mock-passwd, user-override-home, overrid-euser-dir): New procedures.
(guix-environment): Disallow --user without --container.  Provide user to
'launch-environment/container'.
* tests/guix-environment.sh: Add user test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-03-02 11:55:43 +01:00
Mike Gerwitz 07ec349229
environment: Add --link-profile.
This change is motivated by attempts to run programs (like GNU IceCat) within
containers.  The 'fontconfig' program, for example, is configured explicitly
to check ~/.guix-profile for additional fonts.

There were no existing container tests in 'tests/guix-environment.sh', but I
added one anyway for this change.

* doc/guix.texi (Invoking guix environment): Add '--link-profile'.
* guix/scripts/environment.scm (show-help): Add '--link-profile'.
(%options): Add 'link-profile' as '#\P', assigned to 'link-profile?'.
(link-environment): New procedure.
(launch-environment/container): Use it when 'link-profile?'.
[link-profile?]: New parameter.
(guix-environment): Leave when '--link-prof' but not '--container'.  Add
'#:link-profile?' argument to 'launch-environment/container' application.
* tests/guix-environment-container.sh: New '--link-profile' test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-03-02 11:55:42 +01:00
Ludovic Courtès 435603a1d6
profiles: 'manifest-add' truly deletes duplicate entries.
Fixes <https://bugs.gnu.org/30569>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/profiles.scm (manifest-add): Don't append ENTRIES as is.
Instead, cons each element of ENTRIES as we fold over it.
Remove unneeded ellispes in 'match' patterns.
2018-03-01 14:00:21 +01:00
Ludovic Courtès 297602513b
build-system/trivial: Add support for #:allowed-references.
* guix/build-system/trivial.scm (lower): Add #:allowed-references and
keep it in the 'arguments' field.
(trivial-build): Add #:allowed-references.  Add
'canonicalize-reference'.  Pass #:allowed-references to
'build-expression->derivation'.
(trivial-cross-build): Likewise.
* tests/packages.scm ("trivial with #:allowed-references"): New test.
2018-02-28 22:47:42 +01:00
Ludovic Courtès 0fb405796c
guix package: '--search' no longer shows superseded packages.
Fixes <https://bugs.gnu.org/30566>.
Reported by Björn Höfling <bjoern.hoefling@bjoernhoefling.de>.

* guix/scripts/package.scm (find-packages-by-description): Ignore
superseded packages.
* tests/guix-package.sh: Add test.
2018-02-27 15:46:56 +01:00
Ludovic Courtès 1d84d7bf60
build: Require Guile >= 2.0.13.
* README, configure.ac, doc/guix.texi (Requirements): Increase minimum
Guile version from 2.0.9 to 2.0.13.
* config-daemon.ac: Remove use of 'GUIX_CHECK_UNBUFFERED_CBIP'.
* m4/guix.m4 (GUIX_CHECK_UNBUFFERED_CBIP): Remove.
* guix/build/download.scm (current-http-proxy): Remove.
* guix/build/syscalls.scm (%libc-errno-pointer, errno): Remove.
(syscall->procedure): Use #:return-errno unconditionally.
* guix/hash.scm (open-sha256-input-port)[unbuffered]: Remove outdated
comment.
* guix/http-client.scm (when-guile<=2.0.5-or-otherwise-broken): Remove.
<top level>: Remove 'when-guile<=2.0.5-or-otherwise-broken' block.
* guix/scripts/substitute.scm (fetch): Remove 'guile-version>?'
conditional.
* tests/hash.scm (supports-unbuffered-cbip?): Remove.
<top level>: Remove 'test-skip' call.
2018-02-26 18:19:34 +01:00
David Thompson 267379f852
environment: Add --manifest option.
* guix/scripts/environment.scm (show-help, %options): Add -m/--manifest.
(options/resolve-packages): Handle manifests.
* tests/guix-envronment.sh: Add a test.
* doc/guix.texi (Invoking guix environment): Document it.
2018-02-21 22:16:38 -05:00
Mark H Weaver 150062f190
Merge branch 'master' into core-updates 2018-02-16 13:14:26 -05:00
Ludovic Courtès 5e2495d09e
import: utils: 'alist->package' allows false license.
Reported by <pkill9@runbox.com>.
Fixes <https://bugs.gnu.org/30470>.

* guix/import/utils.scm (alist->package): Check whether 'license' is
false and set the 'license' field to #f in this case.
* tests/import-utils.scm ("alist->package with false license"): New
test.
2018-02-16 11:10:12 +01:00
Marius Bakke bee7bb315c
Merge branch 'master' into core-updates 2018-02-01 13:18:47 +01:00
Ludovic Courtès 9d6fae65f3
derivations: Adjust tests for Stow environments.
Fixes <https://bugs.gnu.org/30250>.
Reported by Jorge <jorge+list@disroot.org>.

* tests/derivations.scm ("add-to-store, flat")
("add-to-store, recursive"): Call 'readlink*'.
2018-01-30 22:24:06 +01:00
Mark H Weaver a102d359a6
Merge branch 'master' into core-updates 2018-01-23 17:01:07 -05:00
Ludovic Courtès 33988f9b58
publish: Restore gzip compression in cache-less mode.
Fixes <https://bugs.gnu.org/30184>.
Regression introduced in 297e04d660.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/scripts/publish.scm (nar-response-port): Add 'compression'
parameter and honor it.
(http-write): Get 'x-nar-compression' from the initial RESPONSE.
2018-01-22 11:15:50 +01:00
Ludovic Courtès d466b1fc82
services: Missing services are automatically instantiated.
This simplifies OS configuration: users no longer need to be aware of
what a given service depends on.

See the discussion at
<https://lists.gnu.org/archive/html/guix-devel/2018-01/msg00114.html>.

* gnu/services.scm (missing-target-error): New procedure.
(service-back-edges): Use it.
(instantiate-missing-services): New procedure.
* gnu/system.scm (operating-system-services): Call
'instantiate-missing-services'.
* tests/services.scm ("instantiate-missing-services")
("instantiate-missing-services, no default value"): New tests.
* gnu/services/version-control.scm (cgit-service-type)[extensions]: Add
FCGIWRAP-SERVICE-TYPE.
* gnu/tests/version-control.scm (%cgit-os): Remove NGINX-SERVICE-TYPE
and FCGIWRAP-SERVICE-TYPE instances.
* doc/guix.texi (Log Rotation): Remove 'mcron-service-type' in example.
(Miscellaneous Services): Remove 'nginx-service-type' and
'fcgiwrap-service-type' in Cgit example.
2018-01-21 00:24:03 +01:00
Leo Famulari 4adb40bffc
Merge branch 'master' into core-updates 2018-01-11 14:22:50 -08:00
Ludovic Courtès c04ffadbed
publish: Publish build logs.
* guix/scripts/publish.scm (render-log-file): New procedure.
(make-request-handler): Add "log" case.
* tests/publish.scm ("/log/NAME")
("/log/NAME not found"): New tests.
* doc/guix.texi (Invoking guix publish): Document /log URLs.
2018-01-07 23:51:46 +01:00
Ludovic Courtès 29a6866886
daemon: Add gzip log compression.
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_LOG_COMPRESSION): New macro.
(options): Mark "disable-log-compression" as hidden and add
"log-compression".
(parse_opt): Handle GUIX_OPT_LOG_COMPRESSION.
* nix/libstore/build.cc (DerivationGoal): Add 'gzLogFile'.
(openLogFile): Initialize it when 'logCompression' is COMPRESSION_GZIP.
(closeLogFile, handleChildOutput): Honor 'gzLogFile'.
* nix/libstore/globals.hh (Settings)[compressLog]: Remove.
[logCompression]: New field.
(CompressionType): New enum.
* nix/libstore/globals.cc (Settings::Settings): Initialize it.
(update): Remove '_get' call for 'compressLog'.
* nix/local.mk (guix_daemon_LDADD, guix_register_LDADD): Add -lz.
* guix/store.scm (log-file): Handle '.gz' log files.
* tests/guix-daemon.sh: Add test with '--log-compression=gzip'.
* doc/guix.texi (Invoking guix-daemon): Adjust accordingly.
* config-daemon.ac: Check for libz and zlib.h.
2018-01-07 23:47:22 +01:00
Efraim Flashner 23de2e1d5f
Merge remote-tracking branch 'origin/master' into core-updates 2017-12-31 14:10:25 +02:00
Ludovic Courtès 3e30cdf1c3
guix build: Support '--with-source=PACKAGE@VERSION=URI'.
* guix/scripts/build.scm (numeric-extension?, tarball-base-name): New
procedures, formerly in 'package-with-source'.
(transform-package-source)[new-sources]: Look for '=' in URI.  Each
element of the list of now a (PKG VERSION SOURCE) tuple.
Pass VERSION to 'package-with-source'.
(package-with-source): Add 'version' parameter and honor it.
* tests/scripts-build.scm ("options->transformation, with-source, PKG=URI")
("options->transformation, with-source, PKG@VER=URI"): New tests.
* doc/guix.texi (Package Transformation Options): Document the new
forms.
2017-12-23 00:05:05 +01:00
Marius Bakke 32cd878be0
Merge branch 'master' into core-updates 2017-12-19 01:42:40 +01:00
Ludovic Courtès 3caab236c4
guix gc: '--verify=foo' is reported as an error.
Fixes <https://bugs.gnu.org/29761>.
Reported by Martin Castillo <castilma@uni-bremen.de>.

* guix/scripts/gc.scm (argument->verify-options): New procedure.
(%options) ["verify"]: Adjust to use it.
* tests/guix-gc.sh: Add test.
2017-12-18 23:17:30 +01:00
Ludovic Courtès cafc97e2f3
graph: Adjust test for glibc:static among the implicit inputs.
Fixes <https://bugs.gnu.org/29612>.
Reported by Chris Marusich <cmmarusich@gmail.com>.
This is a followup to 6dff905e51.

* tests/graph.scm ("bag-emerged DAG"): Adjust for glibc:static among
IMPLICIT.
2017-12-17 22:27:21 +01:00
Efraim Flashner f4007b2547
lint: 'check-vulnerabilities' also checks package properties.
* guix/scripts/lint.scm (check-vulnerabilities): Also check for CVEs
listed as mitigated in the package properties.
* tests/lint.scm ("cve: known safe from vulnerability"): New test.
2017-12-10 21:59:07 +02:00
Tobias Geerinckx-Rice fdfdecdb7e
gnu, doc, tests: Use ‘bootloader-configuration’ everywhere.
* doc/guix.texi (Proceeding with the Installation): Replace the old-style
‘grub-configuration’ with the newer ‘bootloader-configuration’ syntax.
* gnu/system/examples/vm-image.tmpl: Likewise.
* gnu/system/install.scm (installation-os): Likewise.
* gnu/tests.scm (%simple-os): Likewise.
* gnu/tests/install.scm (%minimal-os, %minimal-os-on-vda, %separate-home-os)
(%separate-store-os, %raid-root-os, %encrypted-root-os, %btrfs-root-os):
Likewise.
* gnu/tests/nfs.scm (%base-os): Likewise.
* tests/guix-system.scm (OS_BASE, make_user_config): Likewise.
* tests/system.scm (%os, %os-with-mapped-device): Likewise.
2017-12-06 15:02:24 +01:00
Eric Bavier 42d16037d8
tests: Look for multi-digit column numbers in unbound variable test.
* tests/guix-system.sh: Match one or more digits in unbound-variable test.
2017-12-04 04:30:28 -06:00
Ludovic Courtès 2a4050341f
tests: Avoid double slash in URIs.
* tests/publish.scm ("with cache"): Remove extra slash in NAR-URL.  This
would lead to a 'uri-error' exception on Guile 2.2.3.
2017-12-01 18:47:34 +01:00
Ludovic Courtès eef01cfe8e
lint: 'patch-file-names' checks for file name length.
Reported at <https://bugs.gnu.org/27943>
by Danny Milosavljevic <dannym@scratchpost.org>.

* guix/scripts/lint.scm (%distro-directory): New variable.
(check-patch-file-names): Add check for the file name length.
* tests/lint.scm ("patches: file name too long"): New test.
2017-11-28 15:05:55 +01:00
Ludovic Courtès 4aac8d059a
syscalls: Adjust utmpx test.
Fixes <https://bugs.gnu.org/29426>.
Reported by Adonay Felipe Nogueira <adfeno@hyperbola.info>.

* tests/syscalls.scm ("utmpx-entries"): Check the value
of (utmpx-entries entry) only for INIT_PROCESS, LOGIN_PROCESS, and
USER_PROCESS entries.
2017-11-25 18:12:33 +01:00
Marius Bakke 953c2de706
tests: Disable test for freed disk space that fails on Btrfs.
This is a follow-up to commit 40e89f5be6.

* tests/store.scm ("dead path can be explicitly collected"): Don't check
that (> freed 0).
* gnu/packages/package-management.scm (guix)[arguments]<#:phases>: Remove
workaround for the same problem.
2017-11-21 22:46:55 +01:00
Ludovic Courtès 19fd7229bc
workers: Add test with exceptions.
* tests/workers.scm ("exceptions"): New test.
2017-11-17 10:47:49 +01:00
Ludovic Courtès ff23b47dbe
tests: 'guix-gc.sh' passes even when 'out' or 'drv' are defined as env vars.
This fixes a test failure exhibited by
fb17a89912 whereby assignments to 'out' in
guix-gc.sh would go to the 'out' environment variable, when it exists,
which in turn prevents garbage collection of $out.

* tests/guix-gc.sh: Add 'unset' invocations.
2017-11-13 10:10:13 +01:00