Commit graph

1562 commits

Author SHA1 Message Date
Mathieu Othacehe 313f492657
scripts: system: Add support for image-type.
* guix/scripts/system.scm (list-image-types): New procedure,
(%options): add "image-type" and "list-image-types" options, remove
"file-system-type" option,
(show-help): adapt accordingly,
(%default-options): also adapt, and set the default "image-type" to "raw",
(perform-action): add image-type argument and remove file-system-type argument,
(process-action):  adapt perform-action call,
(system-derivation-for-action): remove base-image
argument, add image-type argument, and use it to create the image passed to
"system-image".
* tests/guix-system.sh: Adapt accordingly and add a test for
"--list-image-types" command.
* doc/guix.texi (Building the Installation Image,
Invoking guix system): Adapt accordingly.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2020-09-30 10:47:59 +02:00
Lars-Dominik Braun 680b80e374
openpgp: Fix argument order of 'fxbit-set?'.
* guix/openpgp.scm (fxbit-set?): Change to swap arguments compared to
'bit-set?'.
* tests/openpgp.scm (%binary-sample): New test vector.
("port-ascii-armored?, #t"): Add test.
("port-ascii-armored?, #f"): Add another test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-09-29 22:53:36 +02:00
Eric Bavier d8934360d2
tests: Simplify shell exit status negation;
* tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh,
tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment.sh,
tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh,
tests/guix-hash.sh, tests/guix-lint.sh, tests/guix-pack-relocatable.sh,
tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh,
tests/guix-package.sh: Use the shell '!' keyword to negate command exit status
in place of 'if ...; then false; else true; fi'
2020-09-28 21:06:36 -05:00
Ludovic Courtès 8819551c8d
packages: 'package-input-rewriting' has a #:deep? parameter.
* guix/packages.scm (package-input-rewriting): Add #:deep? and pass it
to 'package-mapping'.
[replacement-property]: New variable.
[rewrite]: Check it.
[cut?]: New procedure.
* tests/packages.scm ("package-input-rewriting"): Pass #:deep? #f and
ensure implicit inputs were not rewritten.  Avoid 'eq?' comparisons.
("package-input-rewriting, deep"): New test.
* gnu/packages/guile.scm (package-for-guile-2.0, package-for-guile-3.0):
Pass #:deep? #f.
2020-09-27 21:41:15 +02:00
Ludovic Courtès b3fc03ee26
packages: 'package-mapping' correctly recurses into 'replacement'.
Previously, something like:

  guix build glib --with-graft=glibc=glibc@2.29

would produce a result showing that rewriting rules were not applied to
libx11@1.6.A (a replacement).

* guix/packages.scm (package-mapping): Call REPLACE instead of PROC to
'replacement'.
* tests/packages.scm ("package-input-rewriting/spec, graft"): New test.
2020-09-27 21:41:11 +02:00
Ludovic Courtès 2bf6f962b9
packages: 'package-input-rewriting/spec' can rewrite implicit dependencies.
With this change, '--with-input', '--with-graft', etc. also apply to
implicit dependencies.  Thus, it's now possible to do:

  guix build python-itsdangerous --with-input=python-wrapper=python@2

or:

  guix build hello --with-graft=glibc=glibc@2.29

Additionally, before, implicit inputs were not rewritten, which could
lead to duplicates in the output of 'bag-transitive-inputs' (packages
that are not 'eq?' but lead to the same derivation).  This in turn would
lead to unnecessary rebuilds when using '--with-input' & co.  This
change fixes it by ensuring even implicit inputs are rewritten.

Fixes <https://bugs.gnu.org/42156>.

* guix/packages.scm (package-input-rewriting/spec): Add #:deep?
defaulting to #true, and pass it to 'package-mapping'.
[replacement-property]: New variable.
[rewrite]: Check that property and set it on the result of PROC.
[cut?]: New procedure.
* tests/packages.scm ("package-input-rewriting/spec"): Ensure implicit
inputs were unchanged.
("package-input-rewriting/spec, partial match"): Pass #:deep? #f.
("package-input-rewriting/spec, deep")
("package-input-rewriting/spec, no duplicates"): New tests.
(package/inherit): Move before use.
* tests/guix-build.sh: Add tests.
* tests/scripts-build.scm ("options->transformation, with-graft"):
Compare dependencies by package name or derivation file name.
* doc/guix.texi (Defining Packages): Adjust accordingly.
2020-09-27 21:41:08 +02:00
Ludovic Courtès ff39361c80
packages: 'package-mapping' can recurse on implicit inputs.
* guix/packages.scm (build-system-with-package-mapping): New procedure.
(package-mapping): Add #:deep? and honor it.
* tests/packages.scm ("package-mapping"): Compare the direct inputs of
the bag of P0 and that of P1.
("package-mapping, deep"): New test.
2020-09-27 21:41:05 +02:00
Ludovic Courtès f458cfbcc5
guix build: Add '--without-tests'.
* guix/scripts/build.scm (transform-package-tests): New procedure.
(%transformations, %transformation-options)
show-transformation-options-help): Add it.
* tests/scripts-build.scm ("options->transformation, without-tests"):
New test.
* doc/guix.texi (Package Transformation Options): Document it.
2020-09-27 21:32:09 +02:00
Ludovic Courtès 9b65281de5
environment: '--link-profile' uses ~/.guix-profile for environment variables.
Before this patch, we had:

  $ guix environment -CP --ad-hoc coreutils
  [env]$ echo $PATH
  /gnu/store/…-profile/bin
  [env]$ echo $GUIX_ENVIRONMENT
  /gnu/store/…-profile

After this patch:

  $ guix environment -CP --ad-hoc coreutils
  [env]$ echo $PATH
  /home/ludo/.guix-profile/bin
  [env]$ echo $GUIX_ENVIRONMENT
  /home/ludo/.guix-profile

* guix/scripts/environment.scm (launch-environment/container): When
LINK-PROFILE? is true, pass ~/.guix-profile as the second argument to
'launch-environment'.
* tests/guix-environment-container.sh: Adjust test accordingly.
* doc/guix.texi (Invoking guix environment): Update accordingly.
2020-09-21 23:05:38 +02:00
Konrad Hinsen d7f7ed39be
repl: Look for script files in (getcwd).
Fixes <https://bugs.gnu.org/43331>.

* guix/scripts/repl.scm (guix-repl): Replace "." by (getcwd)
* tests/guix-repl.sh: Add test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-09-16 16:04:01 +02:00
Ludovic Courtès b911d65474
authenticate: Encode strings as ISO-8859-1.
Fixes <https://bugs.gnu.org/43421>.

* guix/scripts/authenticate.scm (read-command): Decode strings as
ISO-8859-1, not UTF-8.
(guix-authenticate)[send-reply]: Encode strings as ISO-8859-1, not
UTF-8.
* tests/guix-authenticate.sh: Add test.
2020-09-15 14:40:20 +02:00
Ludovic Courtès 8eeeedcb35
tests: Remove one 'delete-paths' call in 'tests/store.scm'.
This makes the test slightly less expensive.

* tests/store.scm ("add-text-to-store vs. delete-paths")
("add-to-store vs. delete-paths"): Delete and merge into...
("add-text-to-store/add-to-store vs. delete-paths"): ... this test.
2020-09-14 15:42:56 +02:00
Ludovic Courtès 64cf660f87
daemon: Spawn 'guix authenticate' once for all.
Previously, we'd spawn 'guix authenticate' once for each item that has
to be signed (when exporting) or authenticated (when importing).  Now,
we spawn it once for all and then follow a request/reply protocol.  This
reduces the wall-clock time of:

  guix archive --export -r $(guix build coreutils -d)

from 30s to 2s.

* guix/scripts/authenticate.scm (sign-with-key): Return the signature
instead of displaying it.  Raise a &formatted-message instead of calling
'leave'.
(validate-signature): Likewise.
(read-command): New procedure.
(define-enumerate-type, reply-code): New macros.
(guix-authenticate)[send-reply]: New procedure.
Change to read commands from current-input-port.
* nix/libstore/local-store.cc (runAuthenticationProgram): Remove.
(authenticationAgent, readInteger, readAuthenticateReply): New
functions.
(signHash, verifySignature): Rewrite in terms of the agent.
* tests/store.scm ("import not signed"): Remove 'pk' call.
("import signed by unauthorized key"): Check the error message of C.
* tests/guix-authenticate.sh: Rewrite using the new protocol.

fixlet
2020-09-14 15:42:55 +02:00
Ludovic Courtès 6dd8ffc574
daemon: Simplify interface with 'guix authenticate'.
There's no reason at this point to mimic the calling convention of the
'openssl' command.

* nix/libstore/local-store.cc (LocalStore::exportPath): Add only "sign"
and HASH to ARGS.  Remove 'tmpDir' and 'hashFile'.
(LocalStore::importPath): Add only "verify" and SIGNATURE to
* guix/scripts/authenticate.scm (guix-authenticate): Adjust
accordingly; remove the OpenSSL-style clauses.
(read-hash-data): Remove.
(sign-with-key): Replace 'port' with 'sha256' and adjust accordingly.
(validate-signature): Export SIGNATURE to be a canonical sexp.
* tests/guix-authenticate.sh: Adjust tests accordingly.
2020-09-11 17:53:58 +02:00
Ludovic Courtès 6310283bae
store: Test 'import-paths' with unauthorized and unsigned nar bundles.
* tests/store.scm ("import not signed")
("import signed by unauthorized key"): New tests.
2020-09-11 17:53:58 +02:00
Ludovic Courtès d7965b58d2
build: Remove references to the 'nix-hash' program.
* configure.ac: Remove check for 'nix-hash'.
* tests/base32.scm (%nix-hash, %have-nix-hash?): Remove.
("sha256 & bytevector->nix-base32-string"): Remove test.
* build-aux/pre-inst-env.in: Do not set 'NIX_HASH' environment
variable.
2020-08-29 16:24:17 +02:00
Ludovic Courtès 3d9ea605c8
store: 'with-store' returns as many values as its body.
Fixes <https://bugs.gnu.org/42912>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/store.scm (call-with-store)[thunk]: Wrap call to PROC in
'call-with-values'.
* tests/store.scm ("with-store, multiple values"): New test.
2020-08-28 23:27:53 +02:00
Maxim Cournoyer 4b5a6fbc9b
offload: Modify the build-machine record to accept multiple systems.
* guix/scripts/offload.scm (<build-machine>)[systems]: New field.
[system]: Accessor changed to %build-machine-system.  Default to #f.
* guix/scripts/offload.scm (build-machine-system): Wrap %build-machine-system
with a deprecation warning.
(build-machine-systems): Access the new systems field or fallback to use
build-machine-system, for backward compatibility.
(machine-matches?): Adjust.
* tests/offload.scm: Add tests...
* Makefile.am (SCM_TESTS): ...and register them.
* doc/guix.texi (Daemon Offload Setup): Update doc.
2020-08-25 13:45:27 -04:00
Mathieu Othacehe 4c0c65acfa
Use "guile-zlib" and "guile-lzlib" instead of (guix config).
* Makefile.am (MODULES): Remove guix/zlib.scm and guix/lzlib.scm,
(SCM_TESTS): remove tests/zlib.scm, tests/lzlib.scm.
* build-aux/build-self.scm (make-config.scm): Remove unused %libz variable.
* configure.ac: Remove LIBZ and LIBLZ variables and check instead for
Guile-zlib and Guile-lzlib.
* doc/guix.texi ("Requirements"): Remove zlib requirement and add Guile-zlib
and Guile-lzlib instead.
* gnu/packages/package-management.scm (guix)[native-inputs]: Add "guile-zlib"
and "guile-lzlib",
[inputs]: remove "zlib" and "lzlib",
[propagated-inputs]: ditto,
[arguments]: add "guile-zlib" and "guile-lzlib" to Guile load path.
* guix/config.scm.in (%libz, %liblz): Remove them.
* guix/lzlib.scm: Remove it.
* guix/man-db.scm: Use (zlib) instead of (guix zlib).
* guix/profiles.scm (manual-database): Do not stub (guix config) in imported
modules list, instead add "guile-zlib" to the extension list.
* guix/scripts/publish.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib),
(string->compression-type, effective-compression): do not check for zlib and
lzlib availability.
* guix/scripts/substitute.scm (%compression-methods): Do not check for lzlib
availability.
* guix/self.scm (specification->package): Add "guile-zlib" and "guile-lzlib"
and remove "zlib" and "lzlib",
(compiled-guix): remove "zlib" and "lzlib" arguments and add guile-zlib and
guile-lzlib to the dependencies, also do not pass "zlib" and "lzlib" to
"make-config.scm" procedure,
(make-config.scm): remove "zlib" and "lzlib" arguments as well as %libz and
%liblz variables.
* guix/utils.scm (lzip-port): Use (lzlib) instead of (guix lzlib) and do not
check for lzlib availability.
* guix/zlib.scm: Remove it.
* m4/guix.m4 (GUIX_LIBZ_LIBDIR, GUIX_LIBLZ_FILE_NAME): Remove them.
* tests/lzlib.scm: Use (zlib) instead of (guix zlib) and (lzlib)
instead of (guix lzlib), and do not check for zlib and lzlib availability.
* tests/publish.scm: Ditto.
* tests/substitute.scm: Do not check for lzlib availability.
* tests/utils.scm: Ditto.
* tests/zlib.scm: Remove it.
2020-08-24 13:35:24 +02:00
Mathieu Othacehe afc3cd84d1
tests: Add a debug output to "fold-available-packages with/without cache".
This should help to debug test failures due to duplicated packages.

* tests/packages ("fold-available-packages with/without cache"): Print
duplicated packages.
2020-08-24 11:54:30 +02:00
Ludovic Courtès d10474c38d
lint: formatting: Gracefully handle relative file names.
Fixes <https://bugs.gnu.org/42543>.
Reported by Jack Hill <jackhill@jackhill.us>.

* guix/lint.scm (check-formatting): Always return a list (previously we
would return #f when 'search-path' returns #f).  Check whether
LOCATION's file is a relative file name.  Return a warning if not.
* tests/guix-lint.sh: Add test.
2020-08-23 23:05:16 +02:00
Efraim Flashner 587e0d911d
services: Add zram-device-service.
* gnu/services/linux.scm (<zram-device-configuration>): New record.
(zram-device-service-type): New variable.
* doc/guix.texi (Linux Services): Document it.
* tests/services/linux.scm (zram-swap-device-test): New tests.
2020-08-02 15:54:37 +03:00
Ludovic Courtès c088aa2988
pack: "fakechroot" engine always creates its store.
Previously it would silently fail to create the /gnu/store symlink when
the host has a read-only /gnu as is the case in these tests.

* gnu/packages/aux-files/run-in-namespace.c (exec_with_loader): Unlink
the ancestor of ORIGINAL_STORE under NEW_ROOT.  Check the return value
of 'symlink' when creating NEW_STORE.
* tests/guix-pack-relocatable.sh: Check the contents of the store as
seen by the wrapped executable, with all three engines, and with both
"/gnu" and "/gnu/store" erased.
2020-07-28 14:41:05 +02:00
Ludovic Courtès c6c0d5a22c
pack: "fakechroot" execution engine can load its audit module.
Fixes <https://bugs.gnu.org/42558>.

Until now, loading 'pack-audit.so' in a truly non-Guix environment would
usually fail because 'pack-audit.so' depends on 'libgcc_s.so' and
'libc.so', none of which could be found.

Furthermore, the test was not working as expected: the trick

  unshare -mrf sh -c 'mount -t tmpfs none /gnu ; ...'

would allow the fakechroot engine to make its store available as
/gnu/store as a result of another bug.

* gnu/packages/aux-files/run-in-namespace.c (relocated_search_path): New
function.
(exec_with_loader): Pass "--library-path" to the loader.
* guix/scripts/pack.scm (wrapped-package)[build](runpath): New procedure.
(elf-loader-compile-flags): Pass "-DLOADER_AUDIT_RUNPATH".
* tests/guix-pack-relocatable.sh: Remove 'STORE_PARENT'.
(run_without_store): New function.  Erase $NIX_STORE_DIR instead of
$STORE_PARENT.
Use 'run_without_store' throughout.
2020-07-28 14:41:04 +02:00
Ludovic Courtès d51bfe242f
Use 'formatted-message' instead of '&message' where appropriate.
* gnu.scm (%try-use-modules): Use 'formatted-message' instead of
'&message'.
* gnu/machine/digital-ocean.scm (maybe-raise-unsupported-configuration-error):
Likewise.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Likewise.
(machine-check-building-for-appropriate-system): Likewise.
(deploy-managed-host): Likewise.
(maybe-raise-unsupported-configuration-error): Likewise.
* gnu/packages.scm (search-patch): Likewise.
* gnu/services.scm (%service-with-default-value): Likewise.
(files->etc-directory): Likewise.
(fold-services): Likewise.
* gnu/system.scm (locale-name->definition*): Likewise.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Likewise.
(check-luks-device): Likewise.
* guix/channels.scm (latest-channel-instance): Likewise.
* guix/cve.scm (json->cve-items): Likewise.
* guix/git-authenticate.scm (commit-signing-key): Likewise.
(commit-authorized-keys): Likewise.
(authenticate-commit): Likewise.
(verify-introductory-commit): Likewise.
* guix/remote.scm (remote-pipe-for-gexp): Likewise.
* guix/scripts/graph.scm (assert-package): Likewise.
* guix/scripts/offload.scm (private-key-from-file*): Likewise.
* guix/ssh.scm (authenticate-server*): Likewise.
(open-ssh-session): Likewise.
(remote-inferior): Likewise.
* guix/ui.scm (matching-generations): Likewise.
* guix/upstream.scm (package-update): Likewise.
* tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"):
Catch 'formatted-message?'.
("authenticate-channel, wrong first commit signer"): Likewise.
* tests/lint.scm ("patches: not found"): Adjust message string.
* tests/packages.scm ("patch not found yields a run-time error"): Catch
'formatted-message?'.
* guix/lint.scm (check-patch-file-names): Handle 'formatted-message?'.
(check-derivation): Ditto.
2020-07-25 19:11:37 +02:00
Ludovic Courtès 6a79eed920
utils: Remove compatibility re-export of 'memoize'.
The 'memoize' binding was re-exported in 2016, commit
19e1d5f7f9, as a backwards-compatibility
measure that makes little sense now.

* guix/utils.scm: Don't re-export 'memoize'.
* guix/import/pypi.scm: Adjust imports.
* tests/pypi.scm: Remove duplicate (guix memoization) import.
2020-07-25 19:11:36 +02:00
Ludovic Courtès a5e2fc7376
utils: Move <location> and '&error-location' to (guix diagnostics).
* guix/utils.scm (<location>, source-properties->location)
(location->source-properties, &error-location): Move to...
* guix/diagnostics.scm: ... here.
* gnu.scm: Adjust imports accordingly.
* gnu/machine.scm: Likewise.
* gnu/system.scm: Likewise.
* gnu/tests.scm: Likewise.
* guix/inferior.scm: Likewise.
* tests/channels.scm: Likewise.
* tests/packages.scm: Likewise.
2020-07-25 19:11:36 +02:00
Ludovic Courtès a553892215
pack: '-R' applies to propagated inputs too.
Fixes <https://bugs.gnu.org/42510>.

* guix/scripts/pack.scm (wrapped-manifest-entry): Recurse on
'dependencies' field.
* tests/guix-pack-relocatable.sh: Add test.
2020-07-24 14:21:30 +02:00
Ludovic Courtès b3802495f6
pack: Build the store database under a UTF-8 locale.
Fixes <https://bugs.gnu.org/42389>.
Reported by branjam4@gmail.com.

* guix/scripts/pack.scm (store-database)[build]: Add calls to 'setenv'
and 'setlocale'.
* tests/pack.scm ("self-contained-tarball + localstatedir, UTF-8 file
names"): New test.
2020-07-20 23:25:09 +02:00
Ludovic Courtès 181e0dddd6
pack: 'self-contained-tarball' runs derivation in a UTF-8local.
* guix/scripts/pack.scm (self-contained-tarball)
[set-utf8-locale]: New variable.
[build]: Use it.
* tests/pack.scm ("self-contained-tarball"): Use a <profile> record
instead of 'profile-derivation'.
2020-07-20 23:25:09 +02:00
Ludovic Courtès efb10f175f
packages: Ensure bags are insensitive to '%current-system'.
Fixes <https://bugs.gnu.org/42327>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

This is a followup to f52fbf7094.

* guix/packages.scm (bag-transitive-inputs, bag-transitive-build-inputs)
(bag-transitive-host-inputs, bag-transitive-target-inputs): Parameterize
%CURRENT-SYSTEM in addition to %CURRENT-TARGET-SYSTEM.
* tests/packages.scm ("package->bag, sensitivity to %current-system"):
New test.
2020-07-13 16:49:12 +02:00
Ludovic Courtès b0e7b6992f
gnu: Remove ".git" from "https://github/…/….git".
Until now, 'lookup-origin' and thus 'lookup-origin-revision' in (guix
swh) would sometimes return #f for these because the ".git" URLs are
redirects to the non-".git" URLs.  Consequently, 'guix lint -c archival'
would keep saying "scheduled Software Heritage archival"; likewise, the
fallback download code would fail.

* gnu/packages/ada.scm,
gnu/packages/admin.scm,
gnu/packages/aidc.scm,
gnu/packages/algebra.scm,
gnu/packages/android.scm,
gnu/packages/animation.scm,
gnu/packages/arcan.scm,
gnu/packages/assembly.scm,
gnu/packages/audio.scm,
gnu/packages/authentication.scm,
gnu/packages/avr.scm,
gnu/packages/axoloti.scm,
gnu/packages/backup.scm,
gnu/packages/bash.scm,
gnu/packages/benchmark.scm,
gnu/packages/bioconductor.scm,
gnu/packages/bioinformatics.scm,
gnu/packages/bittorrent.scm,
gnu/packages/boost.scm,
gnu/packages/build-tools.scm,
gnu/packages/c.scm,
gnu/packages/calendar.scm,
gnu/packages/cdrom.scm,
gnu/packages/check.scm,
gnu/packages/chemistry.scm,
gnu/packages/chez.scm,
gnu/packages/clojure.scm,
gnu/packages/code.scm,
gnu/packages/compression.scm,
gnu/packages/compton.scm,
gnu/packages/coq.scm,
gnu/packages/cpp.scm,
gnu/packages/cran.scm,
gnu/packages/crypto.scm,
gnu/packages/curl.scm,
gnu/packages/databases.scm,
gnu/packages/datastructures.scm,
gnu/packages/debug.scm,
gnu/packages/disk.scm,
gnu/packages/distributed.scm,
gnu/packages/django.scm,
gnu/packages/dlang.scm,
gnu/packages/dns.scm,
gnu/packages/docker.scm,
gnu/packages/education.scm,
gnu/packages/efi.scm,
gnu/packages/elixir.scm,
gnu/packages/emacs-xyz.scm,
gnu/packages/embedded.scm,
gnu/packages/emulators.scm,
gnu/packages/engineering.scm,
gnu/packages/erlang.scm,
gnu/packages/fabric-management.scm,
gnu/packages/file-systems.scm,
gnu/packages/finance.scm,
gnu/packages/firmware.scm,
gnu/packages/flashing-tools.scm,
gnu/packages/fonts.scm,
gnu/packages/fontutils.scm,
gnu/packages/fpga.scm,
gnu/packages/game-development.scm,
gnu/packages/games.scm,
gnu/packages/genealogy.scm,
gnu/packages/genimage.scm,
gnu/packages/geo.scm,
gnu/packages/gimp.scm,
gnu/packages/gl.scm,
gnu/packages/gnome-xyz.scm,
gnu/packages/gnome.scm,
gnu/packages/gnuzilla.scm,
gnu/packages/golang.scm,
gnu/packages/gpodder.scm,
gnu/packages/graph.scm,
gnu/packages/graphics.scm,
gnu/packages/graphviz.scm,
gnu/packages/groff.scm,
gnu/packages/groovy.scm,
gnu/packages/gtk.scm,
gnu/packages/guile-xyz.scm,
gnu/packages/guile.scm,
gnu/packages/hardware.scm,
gnu/packages/haskell-apps.scm,
gnu/packages/haskell-xyz.scm,
gnu/packages/hexedit.scm,
gnu/packages/i2p.scm,
gnu/packages/ibus.scm,
gnu/packages/image-processing.scm,
gnu/packages/image-viewers.scm,
gnu/packages/image.scm,
gnu/packages/ipfs.scm,
gnu/packages/java-graphics.scm,
gnu/packages/java-maths.scm,
gnu/packages/java.scm,
gnu/packages/javascript.scm,
gnu/packages/jrnl.scm,
gnu/packages/julia.scm,
gnu/packages/jupyter.scm,
gnu/packages/kodi.scm,
gnu/packages/language.scm,
gnu/packages/lego.scm,
gnu/packages/less.scm,
gnu/packages/libusb.scm,
gnu/packages/linux.scm,
gnu/packages/lirc.scm,
gnu/packages/lisp-xyz.scm,
gnu/packages/llvm.scm,
gnu/packages/logging.scm,
gnu/packages/lolcode.scm,
gnu/packages/lua.scm,
gnu/packages/lxde.scm,
gnu/packages/lxqt.scm,
gnu/packages/machine-learning.scm,
gnu/packages/mail.scm,
gnu/packages/markup.scm,
gnu/packages/maths.scm,
gnu/packages/maven.scm,
gnu/packages/mes.scm,
gnu/packages/messaging.scm,
gnu/packages/monitoring.scm,
gnu/packages/mpd.scm,
gnu/packages/music.scm,
gnu/packages/networking.scm,
gnu/packages/node-xyz.scm,
gnu/packages/ocaml.scm,
gnu/packages/ocr.scm,
gnu/packages/onc-rpc.scm,
gnu/packages/opencl.scm,
gnu/packages/opencog.scm,
gnu/packages/pantheon.scm,
gnu/packages/password-utils.scm,
gnu/packages/patchutils.scm,
gnu/packages/pdf.scm,
gnu/packages/perl6.scm,
gnu/packages/phabricator.scm,
gnu/packages/popt.scm,
gnu/packages/printers.scm,
gnu/packages/prolog.scm,
gnu/packages/protobuf.scm,
gnu/packages/pulseaudio.scm,
gnu/packages/python-crypto.scm,
gnu/packages/python-web.scm,
gnu/packages/python-xyz.scm,
gnu/packages/qt.scm,
gnu/packages/radio.scm,
gnu/packages/rails.scm,
gnu/packages/rdf.scm,
gnu/packages/rednotebook.scm,
gnu/packages/rpc.scm,
gnu/packages/rsync.scm,
gnu/packages/ruby.scm,
gnu/packages/rust.scm,
gnu/packages/scheme.scm,
gnu/packages/screen.scm,
gnu/packages/security-token.scm,
gnu/packages/selinux.scm,
gnu/packages/serialization.scm,
gnu/packages/shells.scm,
gnu/packages/shellutils.scm,
gnu/packages/simh.scm,
gnu/packages/sml.scm,
gnu/packages/ssh.scm,
gnu/packages/statistics.scm,
gnu/packages/stenography.scm,
gnu/packages/sync.scm,
gnu/packages/syncthing.scm,
gnu/packages/synergy.scm,
gnu/packages/telephony.scm,
gnu/packages/terminals.scm,
gnu/packages/tex.scm,
gnu/packages/texinfo.scm,
gnu/packages/text-editors.scm,
gnu/packages/textutils.scm,
gnu/packages/time.scm,
gnu/packages/tmux.scm,
gnu/packages/tor.scm,
gnu/packages/toys.scm,
gnu/packages/version-control.scm,
gnu/packages/video.scm,
gnu/packages/vim.scm,
gnu/packages/virtualization.scm,
gnu/packages/vlang.scm,
gnu/packages/vnc.scm,
gnu/packages/vpn.scm,
gnu/packages/web-browsers.scm,
gnu/packages/web.scm,
gnu/packages/wireservice.scm,
gnu/packages/wm.scm,
gnu/packages/wxwidgets.scm,
gnu/packages/xdisorg.scm,
gnu/packages/xml.scm,
gnu/packages/xorg.scm,
tests/lint.scm: Remove trailing ".git" from 'git-reference' URL.
2020-07-12 23:08:15 +02:00
Ludovic Courtès c10526672e
lint: source: Validate URLs of Git references.
Until now the 'source' checker would look at URL for 'url-fetch' origins
but not for 'git-fetch' origins.

* guix/lint.scm (check-source): Add case for 'git-reference?'.
* tests/lint.scm ("source, git-reference: 301 -> 200"): New test.
2020-07-12 22:41:51 +02:00
Ludovic Courtès a98712785e
Add 'guix git authenticate'.
* guix/scripts/git.scm, guix/scripts/git/authenticate.scm,
tests/guix-git-authenticate.sh: New files.
* Makefile.am (MODULES): Add the *.scm files.
(SH_TESTS): Add 'tests/guix-git-authenticate.sh'.
* doc/guix.texi (Channels)[Specifying Channel Authorizations]: Mention
'guix git authenticate'.
(Invoking guix git authenticate): New node.
* po/guix/POTFILES.in: Add 'guix/scripts/git.scm' and
'guix/scripts/git/authenticate.scm'.
2020-07-11 12:33:01 +02:00
Ludovic Courtès d774c7b121
channels: Dependencies listed in '.guix-channel' can have an introduction.
Suggested by Ricardo Wurmus and Simon Tournier.

* guix/channels.scm (sexp->channel-introduction): New procedure.
(read-channel-metadata): Use it.
(profile-channels)[sexp->channel-introduction]: Remove.
* tests/channels.scm ("latest-channel-instances, authenticate dependency"):
New test.
* doc/guix.texi (Channels)[Declaring Channel Dependencies]: Augment example.
2020-07-01 23:34:51 +02:00
Ludovic Courtès 884df77640
channels: Properly diagnose test failure.
This fixes a style issue similar to that of
a18d02def9.

* tests/channels.scm ("authenticate-channel, .guix-authorizations"):
Change to 'test-equal' so that test failures are properly diagnosed.
2020-07-01 23:34:51 +02:00
Ludovic Courtès 8b7d982e6a
channels: Make channel introductions public.
* guix/channels.scm (<channel-introduction>): Rename constructor to
'%make-channel-introduction'.
(make-channel-introduction): New procedure.
* tests/channels.scm ("authenticate-channel, wrong first commit signer")
("authenticate-channel, .guix-authorizations"): Use
'make-channel-introduction' without '@@' and without third argument.
* doc/guix.texi (Channels)[Channel Authentication, Specifying Channel
Authorizations]: New subsections.
2020-07-01 23:34:51 +02:00
Marius Bakke 5e113cf442
tests: Do not fail when network interface aliases are present.
Fixes <https://bugs.gnu.org/42111>.

* tests/syscalls.scm ("network-interface-names"): Filter interface names with
a colon.
2020-06-28 23:32:52 +02:00
Ludovic Courtès ead5c46147
channels: Error out when the 'guix' channel lacks an introduction.
* guix/channels.scm (latest-channel-instance): Raise an error instead of
warning when 'guix is unauthenticated.
* tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"):
New test.
2020-06-28 23:26:53 +02:00
Ludovic Courtès 0a8dd8aae5
tests: Allow 'tests/git-authenticate.scm' to run when git/gpg is missing.
Fixes <https://bugs.gnu.org/42077>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

The typo was introduced in 7b06781a58.

* tests/git-authenticate.scm <top level>: Remove call to 'which'
around (gpg+git-available?).
2020-06-28 23:26:53 +02:00
Ludovic Courtès 0505eda9c7
packages: Recognize SHA3 and BLAKE2s for 'content-hash'.
* guix/packages.scm (build-content-hash): Add 'sha3-256', 'sha3-512',
and 'blake2s-256'.
* tests/packages.scm ("package-source-derivation, origin, sha3-512"):
New test.
2020-06-27 23:42:20 +02:00
Ludovic Courtès 8e6c1415d8
daemon: Recognize SHA3 and BLAKE2s.
* nix/libutil/hash.hh (HashType): Add htSHA3_256, htSHA3_512, and
htBLAKE2s_256.
* nix/libutil/hash.cc (parseHashType, printHashType): Recognize them.
* tests/store.scm ("add-to-store"): Test these algorithms.
2020-06-27 23:42:20 +02:00
Ludovic Courtès 95c2bc49cf
tests: Skip lint tests when HTTP server cannot listen.
This could happen when running tests in parallel.

* tests/lint.scm ("github-url")
("github-url: one suggestion")
("github-url: already the correct github url")
("archival: missing content")
("archival: content available")
("archival: missing revision")
("archival: revision available")
("archival: rate limit reached"): Add 'test-skip' statement above.
2020-06-26 16:19:53 +02:00
Ludovic Courtès a18d02def9
channels: Fix test for introductory commit signer.
Until now the test would always succeed because it would return
'failed, which has truth value.  The exercise
'verify-introductory-commit', we need to add a second commit beyond the
introductory commit, which is what we do here.

* tests/channels.scm ("authenticate-channel, wrong first commit
signer"): Add a second commit and authenticate up to that one.  Change
'message?' to 'message-condition?'.
2020-06-25 01:20:31 +02:00
Ludovic Courtès 7b06781a58
tests: Skip tests that requires gpg when gpg is unavailable.
Partly fixes <https://bugs.gnu.org/41932>.
Reported by Simen Endsjø <simendsjo@gmail.com>.

* tests/git-authenticate.scm ("signed commits, SHA1 signature"): Use
'gpg+git-available?' in skip guard.
2020-06-20 13:18:11 +02:00
Ludovic Courtès 90f496be9a
tests: Actually run 'tests/guix-environment-container.sh'.
This test was skipped since the switch to Guile 3 because
'assert-container-features' would be inlined and thus accessing it with
@@ would fail with an unbound-variable error.

* guix/scripts/environment.scm (assert-container-features): Export.
* tests/guix-environment-container.sh: Use single '@'.
2020-06-20 13:18:11 +02:00
Ludovic Courtès 5bafc70d1e
channels: Make 'validate-pull' call right after clone/pull.
This should come before patching, authentication, etc.

* guix/channels.scm (latest-channel-instance): Add #:validate-pull
parameter and honor it.  Return a single value: the instance.
(ensure-forward-channel-update): Change 'instance' parameter to 'commit'
and adjust accordingly.
(latest-channel-instances): Adjust to 'latest-channel-instance' changes.
* guix/scripts/pull.scm (warn-about-backward-updates): Change 'instance'
parameter to 'commit' and adjust accordingly.
* tests/channels.scm ("latest-channel-instances #:validate-pull"):
Likewise.
2020-06-16 16:10:47 +02:00
Ludovic Courtès 43badf261f
channels: 'latest-channel-instance' authenticates Git checkouts.
Fixes <https://bugs.gnu.org/22883>.

* guix/channels.scm (<channel>)[introduction]: New field.
(<channel-introduction>): New record type.
(%guix-channel-introduction): New variable.
(%default-channels): Use it.
(<channel-metadata>)[keyring-reference]: New field.
(%default-keyring-reference): New variable.
(read-channel-metadata, read-channel-metadata-from-source): Initialize
the 'keyring-reference' field.
(commit-short-id, verify-introductory-commit)
(authenticate-channel): New procedures.
(latest-channel-instance): Call 'authenticate-channel' when CHANNEL has
an introduction.
* tests/channels.scm (gpg+git-available?, commit-id-string): New
procedures.
("authenticate-channel, wrong first commit signer"):
("authenticate-channel, .guix-authorizations"): New tests.
* doc/guix.texi (Invoking guix pull): Mention authentication.
2020-06-16 16:10:47 +02:00
Ludovic Courtès 1e2b9bf2d4
tests: Move OpenPGP helpers to (guix tests gnupg).
* tests/git-authenticate.scm (key-id): Remove.
(%ed25519-public-key-file, %ed25519-secret-key-file)
(%ed25519bis-public-key-file, %ed25519bis-secret-key-file)
(read-openpgp-packet, key-fingerprint): Move to...
* guix/tests/gnupg.scm: ... here.
2020-06-16 16:10:46 +02:00
Konrad Hinsen c924e54139
guix repl: Add script execution.
* guix/scripts/repl.scm: Add filename options for script execution.
* doc/guix.texi (Invoking guix repl): Document it.
* tests/guix-repl.sh: Test it.
* Makefile.am: (SH_TESTS): Add it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-06-14 23:02:36 +02:00
Ludovic Courtès 993023a28e
lint: Add 'check-for-collisions' checker.
Suggested by Edouard Klein <edk@beaver-labs.com>.

* guix/profiles.scm (check-for-collisions): Export.
* guix/lint.scm (check-profile-collisions): New procedure.
(%local-checkers): Add 'profile-collisions' checker.
* tests/lint.scm ("profile-collisions: no warnings")
("profile-collisions: propagated inputs collide")
("profile-collisions: propagated inputs collide, store items"): New tests.
* doc/guix.texi (Invoking guix lint): Document it.
2020-06-14 15:34:42 +02:00
Ludovic Courtès 52c529ff20
git-authenticate: Disallow SHA1 (and MD5) signatures.
* guix/git-authenticate.scm (commit-signing-key): Add
 #:disallowed-hash-algorithms and honor it.
(authenticate-commit)[recent-commit?]: New variable.
Pass #:disallowed-hash-algorithms to 'commit-signing-key'.
* tests/git-authenticate.scm ("signed commits, SHA1 signature"): New test.
2020-06-12 18:56:11 +02:00
Ludovic Courtès 03a70e4c19
packages: 'package-grafts' returns grafts for all the relevant outputs.
Fixes <https://bugs.gnu.org/41796>.
Reported by Jakub Kądziołka <kuba@kadziolka.net>.

* guix/packages.scm (input-graft): Add 'output' parameter and honor it.
Add OUTPUT to the cache key.
(input-cross-graft): Likewise.
(fold-bag-dependencies): Operate on inputs instead of nodes.  Turn
VISITED into a vhash instead of a set.  Pass PROC HEAD and OUTPUT
instead of just HEAD.
(bag-grafts): Adjust accordingly.
* tests/packages.scm ("package-grafts, dependency on several outputs"):
New test.
2020-06-11 19:05:05 +02:00
Ludovic Courtès 72357e2170
git: 'commit-difference' really excludes the ancestors of #:excluded.
* guix/git.scm (commit-difference): Initialize VISITED to the closure of
OLD and EXCLUDED, as written in the docstring.
* tests/git.scm ("commit-difference, excluded commits"): Adjust
accordingly.
2020-06-09 00:34:52 +02:00
Jan (janneke) Nieuwenhuizen 59bcffa314
system: examples: Add bare-hurd.tmpl.
* gnu/system/hurd.scm (%hurd-def%hurd-default-operating-system-kernel,
%hurd-default-operating-system): New exported variables.
* gnu/system/examples/bare-hurd.tmpl: New file.
* Makefile.am (EXAMPLES): Add it.
* tests/guix-system.sh: Add --target=i586-pc-gnu when testing it.
2020-06-08 13:51:19 +02:00
Ludovic Courtès e782756080
git-authenticate: Prevent removal of '.guix-authorizations'.
* guix/git-authenticate.scm (commit-authorized-keys)
[parents-have-authorizations-file?, assert-parents-lack-authorizations]:
New procedures.
Use the latter before returning DEFAULT-AUTHORIZATIONS.
* guix/git.scm (false-if-git-not-found): Export.
* guix/tests/git.scm (populate-git-repository): Add 'remove' clause.
* tests/git-authenticate.scm ("signed commits, .guix-authorizations removed"):
New test.
2020-06-07 23:10:46 +02:00
Ludovic Courtès b49caaa2b7
packages: Make 'bag-grafts' insensitive to '%current-target-system'.
Fixes <https://bugs.gnu.org/41713>.
Reported by Mathieu Othacehe.

* guix/packages.scm (bag-grafts): Wrap 'fold-bag-dependencies' calls in
'parameterize'.
* tests/packages.scm ("package->bag, sensitivity to
%current-target-system"): New test.
2020-06-06 23:28:48 +02:00
Ludovic Courtès c83eedba23
git-authenticate: Add tests.
* guix/tests/git.scm (call-with-environment-variables)
(with-environment-variables): Remove.
* guix/tests/git.scm (populate-git-repository): Add clauses for signed
commits and signed merges.
* guix/tests/gnupg.scm: New file.
* tests/git-authenticate.scm: New file.
* tests/ed25519bis.key, tests/ed25519bis.sec: New files.
* Makefile.am (dist_noinst_DATA): Add 'guix/tests/gnupg.scm'.
(SCM_TESTS): Add 'tests/git-authenticate.scm'.
(EXTRA_DIST): Add tests/ed25519bis.{key,sec}.
2020-06-05 22:54:06 +02:00
Mathieu Othacehe ea924134f8
tests: syscall: Support file-systems without extended attributes.
* tests/syscalls.scm (setxattr): Catch ENOTSUP that can be raised if the
file-system does not support extended user attributes.
2020-06-05 19:20:23 +02:00
Simon South cb21c14b0a
tests: Allow passing on systems without support for swap devices.
* tests/syscalls.scm ("swapon", "swapoff"): Accept ENOSYS as a valid result.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2020-06-02 10:24:03 +02:00
Ludovic Courtès abf43d4511
gexp: Fix expansion for (file-append (local-file ...) ...).
Fixes <https://bugs.gnu.org/41527>.
Regression introduced in d03001a31a.

* guix/gexp.scm (lower+expand-object): When LOWERED is not a struct and
EXPAND is true, call EXPAND.
* tests/gexp.scm ("file-append, raw store item"): New test.
2020-05-25 23:00:30 +02:00
Ludovic Courtès e033700f17
tests: Hide quoted (define-module ...) form from Geiser.
* tests/gexp.scm (%extension-package): Split (define-module ...) form to
fool Geiser.
2020-05-25 23:00:30 +02:00
Ludovic Courtès 872898f768
channels: 'latest-channel-instances' guards against non-forward updates.
* guix/channels.scm (latest-channel-instance): Add #:starting-commit and
pass it to 'update-cached-checkout'.  Return the commit relation as a
second value.
(ensure-forward-channel-update): New procedure.
(latest-channel-instances): Add #:current-channels and #:validate-pull.
[current-commit]: New procedure.
Pass #:starting-commit to 'latest-channel-instance'.  When the returned
relation is true, call VALIDATE-PULL.
(latest-channel-derivation): Add #:current-channels and #:validate-pull.
Pass them to 'latest-channel-instances*'.
* tests/channels.scm ("latest-channel-instances #:validate-pull"): New
test.
2020-05-25 00:00:28 +02:00
Ludovic Courtès 8d1d56578a
git: 'update-cached-checkout' returns the commit relation.
* guix/git.scm (update-cached-checkout): Add #:starting-commit
parameter.  Call 'commit-relation' when #:starting-commit is true.
Always return the relation or #f as the third value.
(latest-repository-commit): Adjust accordingly.
* guix/import/opam.scm (get-opam-repository): Likewise.
* tests/channels.scm ("latest-channel-instances includes channel dependencies")
("latest-channel-instances excludes duplicate channel dependencies"):
Update mock of 'update-cached-checkout' accordingly.
2020-05-25 00:00:28 +02:00
Ludovic Courtès c098c11be8
git: Add 'commit-relation'.
* guix/git.scm (commit-relation): New procedure.
* tests/git.scm ("commit-relation"): New test.
2020-05-25 00:00:28 +02:00
zimoun 881eaae1ab
guix package: Support multiple profiles with '--list-installed'.
* guix/scripts/package.scm (process-query): List installed multiple profiles.
* tests/guix-package-net.sh: Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-05-23 16:29:29 +02:00
Ludovic Courtès 197c07a847
tests: Use a #:prefix for (gcrypt hash).
* tests/packages.scm: Use #:prefix instead of #:hide for (gcrypt hash).
This accomodates for 'sha512' syntax literal matches with Guile-Gcrypt 0.3.0,
which exports 'sha512' in addition to 'sha256'.
2020-05-23 16:29:29 +02:00
Ludovic Courtès ce0be5675b
packages: Introduce <content-hash> and use it in <origin>.
* guix/packages.scm (<content-hash>): New record type.
(define-content-hash-constructor, build-content-hash)
(content-hash): New macros.
(print-content-hash): New procedure.
(<origin>): Rename constructor to '%origin'.
[sha256]: Remove field.
[hash]: New field.  Adjust users.
(origin-compatibility-helper, origin): New macros.
(origin-sha256): New deprecated procedure.
(origin->derivation): Adjust accordingly.
* tests/packages.scm ("package-source-derivation, origin, sha512"): New
test.
* guix/tests.scm: Hide (gcrypt hash) 'sha256' for proper syntax
matching.
* tests/challenge.scm: Add #:prefix for (gcrypt hash) and adjust users.
* tests/derivations.scm: Likewise.
* tests/store.scm: Likewise.
* tests/graph.scm ("bag DAG, including origins"): Provide 'sha256' field
with the right length.
* gnu/packages/aspell.scm (aspell-dictionary)
(aspell-dict-ca, aspell-dict-it): Use 'hash' and 'content-hash' for
proper syntax matching.
* gnu/packages/bash.scm (bash-patch): Rename 'sha256' to 'sha256-bv'.
* gnu/packages/bootstrap.scm (bootstrap-executable): Rename 'sha256' to 'bv'.
* gnu/packages/readline.scm (readline-patch): Likewise.
* gnu/packages/virtualization.scm (qemu-patch): Rename 'sha256' to
'sha256-bv'.
* guix/import/utils.scm: Hide (gcrypt hash) 'sha256'.
2020-05-22 01:29:39 +02:00
Ludovic Courtès 0e4e9c8e76
guix hash, guix download: Support base64 format.
* guix/scripts/download.scm (show-help, %options): Support "base64"
format.
* guix/scripts/hash.scm (show-help, %options): Likewise.
* tests/guix-hash.sh: Test it.
* doc/guix.texi (Invoking guix hash): Document it.
2020-05-22 00:35:24 +02:00
Ludovic Courtès 18ae1ec3ec
guix hash, guix download: Add '--hash'.
* guix/scripts/download.scm (%default-options): Add 'hash-algorithm'.
(show-help, %options): Add "--hash".
(guix-download): Honor it.
* guix/scripts/hash.scm (%default-options): Add 'hash-algorithm'.
(show-help, %options): Add "--hash".
(guix-hash): Honor it.
* tests/guix-hash.sh: Test '-H sha512'.
* doc/guix.texi (Invoking guix download): Document it.
(Invoking guix hash): Document it.
2020-05-22 00:35:24 +02:00
Ludovic Courtès 9418aaa00d
tests: Test fixed-output derivations with several hash algorithms.
* tests/derivations.scm ("fixed-output derivation"): Test several hash
algorithms.
2020-05-22 00:35:23 +02:00
Ludovic Courtès 73b27eaa64
tests: Test 'add-to-store' with several hash algorithms.
* tests/store.scm ("add-to-store"): New test.
2020-05-22 00:35:23 +02:00
Maxim Cournoyer b460ba7992
bootloader: grub: Allow booting from a Btrfs subvolume.
* gnu/bootloader/grub.scm (strip-mount-point): Remove procedure.
(normalize-file): Add procedure.
(grub-configuration-file): New BTRFS-SUBVOLUME-FILE-NAME parameter.  When
defined, prepend its value to the kernel and initrd file names, using the
NORMALIZE-FILE procedure.  Adjust the call to EYE-CANDY to pass the
BTRFS-SUBVOLUME-FILE-NAME argument.  Normalize the KEYMAP file as well.
(eye-candy): Add a BTRFS-SUBVOLUME-FILE-NAME parameter, and use it, along with
the NORMALIZE-FILE procedure, to normalize the FONT-FILE and IMAGE nested
variables.  Adjust doc.
* gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): Adapt.
* gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise.
* gnu/system/file-systems.scm (btrfs-subvolume?)
(btrfs-store-subvolume-file-name): New procedures.
* gnu/system.scm (operating-system-bootcfg): Specify the Btrfs
subvolume file name the store resides on to the
`operating-system-bootcfg' procedure, using the new
BTRFS-SUBVOLUME-FILE-NAME argument.
* doc/guix.texi (File Systems): Add a Btrfs subsection to document the use of
subvolumes.
* gnu/tests/install.scm (%btrfs-root-on-subvolume-os)
(%btrfs-root-on-subvolume-os-source)
(%btrfs-root-on-subvolume-installation-script)
(%test-btrfs-root-on-subvolume-os): New variables.
2020-05-20 08:30:35 -04:00
Maxim Cournoyer fa35fb58c8
file-systems: Add helpers for parsing the options string into an alist.
* gnu/system/file-systems.scm (file-system-options->alist)
(alist->file-system-options): New procedures.
* tests/file-systems.scm: New tests.
* doc/guix.texi (File Systems): Add note about the newly added procedures.
2020-05-20 08:30:34 -04:00
Ludovic Courtès 644cb40cd8
gexp: Add 'let-system'.
* guix/gexp.scm (<system-binding>): New record type.
(let-system): New macro.
(system-binding-compiler): New procedure.
(default-expander): Add 'self-quoting?' case.
(self-quoting?): New procedure.
(lower-inputs): Add 'filterm'.  Pass the result of
'mapm/accumulate-builds' through FILTERM.
(gexp->sexp)[self-quoting?]: Remove.
* tests/gexp.scm ("let-system", "let-system, target")
("let-system, ungexp-native, target")
("let-system, nested"): New tests.
* doc/guix.texi (G-Expressions): Document it.
2020-05-16 00:34:41 +02:00
Ludovic Courtès 6456232164
pack: Add relocation via ld.so and fakechroot.
* gnu/packages/aux-files/run-in-namespace.c (HAVE_EXEC_WITH_LOADER): New
macro.
(bind_mount): Rename to...
(mirror_directory): ... this.  Add 'firmlink' argument and use it
instead of calling mkdir/open/close/mount directly.
(bind_mount, make_symlink): New functions.
(exec_in_user_namespace): Adjust accordingly.
(exec_with_loader) [HAVE_EXEC_WITH_LOADER]: New function.
(exec_performance): New function.
(engines): Add them.
* guix/scripts/pack.scm (wrapped-package)[fakechroot-library]
[audit-module]: New procedures.
[audit-source]: New variable.
[build](elf-interpreter, elf-loader-compile-flags): New procedures.
(build-wrapper): Use them.
* tests/guix-pack-relocatable.sh: Test with
'GUIX_EXECUTION_ENGINE=fakechroot'.
* doc/guix.texi (Invoking guix pack): Document the 'performance' and
'fakechroot' engines.
* gnu/packages/aux-files/pack-audit.c: New file.
* Makefile.am (AUX_FILES): Add it.
2020-05-14 17:21:27 +02:00
Ludovic Courtès fde2aec3f4
pack: Wrapper honors 'GUIX_EXECUTION_ENGINE' environment variable.
* gnu/packages/aux-files/run-in-namespace.c (struct engine): New type.
(exec_default): New function.
(engines): New variable.
(execution_engine): New function.
(main): Use it instead of calling 'exec_in_user_namespace' and
'exec_with_proot' directly.
* tests/guix-pack-relocatable.sh: Add test with 'GUIX_EXECUTION_ENGINE'.
* doc/guix.texi (Invoking guix pack): Document 'GUIX_EXECUTION_ENGINE'.
2020-05-14 17:21:27 +02:00
Ludovic Courtès 80963744a2
store: 'mapm/accumulate-builds' preserves '%current-target-system'.
Fixes <https://bugs.gnu.org/41182>.

* guix/store.scm (mapm/accumulate-builds): Pass #:system and #:target to
'run-with-store'.
* tests/store.scm ("mapm/accumulate-builds, %current-target-system"):
New test.
* tests/guix-pack.sh: Add 'guix pack -d --target' test.
2020-05-14 17:21:27 +02:00
Ludovic Courtès f52fbf7094
packages: Ensure bags are insensitive to '%current-target-system'.
Fixes a bug whereby a bag's transitive dependencies would depend on the
global '%current-target-system' value.

Partly fixes <https://issues.guix.gnu.org/41182>.

* guix/packages.scm (bag-transitive-inputs)
(bag-transitive-build-inputs, bag-transitive-target-inputs):
Parameterize '%current-target-system'.
* tests/packages.scm ("package->bag, sensitivity to %current-target-system"):
New test.
2020-05-14 17:21:27 +02:00
Jan (janneke) Nieuwenhuizen df05842332
syscalls: Add 'getxattr'.
* guix/build/syscalls.scm (getxattr): New procedure.
* tests/syscalls.scm ("getxattr, setxattr"): Test it, together with setxattr.
2020-05-14 00:48:12 +02:00
Ludovic Courtès 88a96c568c
guix graph: Add '--path'.
* guix/scripts/graph.scm (display-path): New procedure.
(%options, show-help): Add '--path'.
(guix-graph): Handle it.
* tests/guix-graph.sh: Add tests.
* doc/guix.texi (Invoking guix graph): Document it.
(Invoking guix size): Mention it.
2020-05-11 23:30:55 +02:00
Ludovic Courtès 36c2192414
graph: Add 'shortest-path'.
* guix/graph.scm (shortest-path): New procedure.
* tests/graph.scm ("shortest-path, packages + derivations")
("shortest-path, reverse packages")
("shortest-path, references"): New tests.
2020-05-11 23:30:55 +02:00
Ludovic Courtès 7240202136
graph: reference/referrer node types work with graph traversal.
The graph traversal procedures in (guix graph) assume that nodes can be
compared with 'eq?', which was not the case for nodes of
%REFERENCE-NODE-TYPE and %REFERRER-NODE-TYPE (strings).

* guix/scripts/graph.scm (intern): New procedure.
(ensure-store-items, references*)
(%reference-node-type, non-derivation-referrers)
(%referrer-node-type): Use it on all store items.
* tests/graph.scm ("node-transitive-edges, references"): New test.
2020-05-11 23:30:55 +02:00
Ludovic Courtès 647c57207a
tests: Test 'guix show' with multiple packages.
* tests/guix-package-aliases.sh: Test 'guix show' with multiple packages.
2020-05-11 23:30:54 +02:00
Ludovic Courtès 053b10c3ef
channels: Add mechanism to patch checkouts of the 'guix channel.
* guix/channels.scm (<patch>): New record type.
(apply-patches): New procedure.
(latest-channel-instance)[dot-git?]: New procedure.
Use 'update-cached-checkout' and 'add-to-store' instead of
'latest-repository-commit'.  Call 'apply-patches' when CHANNEL is the
'guix channel.
(%patches): New variable.
* guix/git.scm (url+commit->name): Make public.
* tests/channels.scm ("latest-channel-instances includes channel dependencies")
("latest-channel-instances excludes duplicate channel dependencies"):
Mock 'update-cached-checkout' instead of 'latest-repository-commit'.
Wrap body in 'with-store' and pass the store to 'latest-channel-instances'.
2020-05-07 10:06:15 +02:00
Marius Bakke 87a40d7203
Merge branch 'master' into core-updates 2020-05-05 20:43:21 +02:00
Ludovic Courtès b835e158d5
openpgp: Add 'string->openpgp-packet'.
* guix/openpgp.scm (string->openpgp-packet): New procedure.
* tests/openpgp.scm ("verify-openpgp-signature, missing key")
("verify-openpgp-signature, good signatures")
("verify-openpgp-signature, bad signature"): Use it.
2020-05-04 09:56:13 +02:00
Ludovic Courtès bd8126558d
openpgp: 'lookup-key-by-{id,fingerprint}' return the key first.
Previously, 'lookup-key-by-{id,fingerprint}' would always return the
list of packets where the primary key is first.  Thus, the caller would
need to use 'find' to actually find the requested key.

* guix/openpgp.scm (keyring-insert): Always add KEY to PACKETS.
(lookup-key-by-id, lookup-key-by-fingerprint): Change to return the key
as the first value.
(verify-openpgp-signature): Remove now unneeded call to 'find'.
* tests/openpgp.scm ("get-openpgp-keyring"): Adjust accordingly.
2020-05-04 09:56:13 +02:00
Ludovic Courtès b45fa0a123
openpgp: 'verify-openpgp-signature' looks up by fingerprint when possible.
* guix/openpgp.scm (verify-openpgp-signature): Use
'lookup-key-by-fingerprint' when SIG contains a fingerprint.
Honor FINGERPRINT in the 'find' predicate.  Upon missing-key, return
FINGERPRINT if available.
* tests/openpgp.scm ("verify-openpgp-signature, missing key"): Adjust
expected value accordingly.
2020-05-04 09:56:12 +02:00
Ludovic Courtès efe1f0122c
openpgp: Add 'lookup-key-by-fingerprint'.
* guix/openpgp.scm (<openpgp-keyring>)[table]: Rename to...
[ids]: ... this.
[fingerprints]: New field.
(keyring-insert, lookup-key-by-fingerprint): New procedures.
(%empty-keyring): Adjust.
(get-openpgp-keyring): Manipulate KEYRING instead of its vhash, use
'keyring-insert'.
* tests/openpgp.scm ("get-openpgp-keyring"): Test
'lookup-key-by-fingerprint'.
2020-05-04 09:56:12 +02:00
Ludovic Courtès 7b2b3a13cc
openpgp: Store the issuer key id and fingerprint in <openpgp-signature>.
* guix/openpgp.scm (<openpgp-signature>)[issuer, issuer-fingerprint]:
New fields.
(openpgp-signature-issuer, openpgp-signature-issuer-fingerprint): Remove.
(verify-openpgp-signature): Use 'openpgp-signature-issuer-key-id'.
(get-signature): Initialize 'issuer' and 'issuer-fingerprint'.
* tests/openpgp.scm ("get-openpgp-detached-signature/ascii"): Adjust
accordingly.
2020-05-04 09:56:12 +02:00
Ludovic Courtès 4459c7859c
openpgp: Decode the issuer-fingerprint signature subpacket.
* guix/openpgp.scm (SUBPACKET-ISSUER-FINGERPRINT): New variable.
(openpgp-signature-issuer-fingerprint): New procedure.
(key-id-matches-fingerprint?): New procedure.
(get-signature): Look for the 'issuer and 'issuer-fingerprint
subpackets.  Ensure the issuer key ID matches the fingerprint when both
are available.
(parse-subpackets): Handle SUBPACKET-ISSUER-FINGERPRINT.
* tests/openpgp.scm (%rsa-key-fingerprint)
(%dsa-key-fingerprint, %ed25519-key-fingerprint): New variables.
* tests/openpgp.scm ("get-openpgp-detached-signature/ascii"): Check the
result of 'openpgp-signature-issuer-fingerprint'.
2020-05-04 09:56:12 +02:00
Ludovic Courtès 43408e304f
Add (guix openpgp).
* guix/openpgp.scm, tests/openpgp.scm, tests/civodul.key,
tests/dsa.key, tests/ed25519.key, tests/rsa.key,
tests/ed25519.sec: New files.
* Makefile.am (MODULES): Add guix/openpgp.scm.
(SCM_TESTS): Add tests/openpgp.scm.
(EXTRA_DIST): Add tests/*.key and tests/ed25519.sec.
2020-05-04 09:56:12 +02:00
Marius Bakke 8bf8cd9b85
Merge branch 'master' into core-updates
Conflicts:
	gnu/local.mk
	gnu/packages/backup.scm
	gnu/packages/emacs-xyz.scm
	gnu/packages/guile.scm
	gnu/packages/lisp.scm
	gnu/packages/openldap.scm
	gnu/packages/package-management.scm
	gnu/packages/web.scm
	gnu/packages/xorg.scm
2020-04-30 23:47:49 +02:00
Ludovic Courtès 5dfe02c607
tests: Remove trailing commas in JSON tests.
These commas are rejected by Guile-JSON 3.5.0.

* tests/crate.scm (test-foo-dependencies)
(test-root-dependencies, test-intermediate-1-dependencies)
(test-intermediate-2-dependencies): Remove trailing commas.
* tests/gem.scm (test-bar-json): Likewise.
* tests/pypi.scm (test-json): Likewise.
2020-04-27 23:29:40 +02:00
Ludovic Courtès ef674a24c5
profiles: Add lowerable <profile> record type.
* guix/profiles.scm (<profile>): New record type.
* tests/profiles.scm ("<profile>"): New test.
2020-04-26 22:49:48 +02:00
Marius Bakke c57d649de3
Merge branch 'master' into core-updates 2020-04-24 17:28:11 +02:00
Ludovic Courtès 2520059bdb
pack: 'guix pack -R' wrapper correctly reports exit code.
Fixes <https://bugs.gnu.org/40816>.
Reported by Jan (janneke) Nieuwenhuizen <janneke@gnu.org>.

* gnu/packages/aux-files/run-in-namespace.c (main): In the 'default'
case, check 'WIFEXITED (status)' and exit with the corresponding code in
that case.  Exit with 255 in other cases.
* tests/guix-pack-relocatable.sh: Add test.
2020-04-24 16:21:13 +02:00
Marius Bakke 030f6f489f
Merge branch 'master' into core-updates
Conflicts:
	etc/news.scm
	gnu/local.mk
	gnu/packages/bootloaders.scm
	gnu/packages/linphone.scm
	gnu/packages/linux.scm
	gnu/packages/tls.scm
	gnu/system.scm
2020-04-23 13:33:09 +02:00
Ricardo Wurmus 10af34cd7f
tests: Update expected values for package->code.
Reported by janneke on IRC.

* tests/print.scm: Update expected package definitions produced by package->code.
2020-04-20 10:57:49 +02:00