Commit Graph

4096 Commits

Author SHA1 Message Date
Ludovic Courtès e6301fb76d
packages: Adjust to new calling convention for "thunked" fields.
Fixes <https://bugs.gnu.org/34995>.

This is a followup to abd4d6b33d.

* guix/packages.scm (package->bag): Adjust calls to INPUTS,
PROPAGATED-INPUTS, NATIVE-INPUTS, and ARGS, passing them SELF as an
argument.
* gnu/packages/gnucash.scm (gnucash)[arguments]: Use (package-inputs
this-record) intead of (inputs).
* gnu/packages/version-control.scm (git)[arguments]: Likewise.
2019-03-26 10:26:02 +01:00
Ludovic Courtès abd4d6b33d
records: Allow thunked fields to refer to 'this-record'.
* guix/records.scm (this-record): New syntax parameter.
(make-syntactic-constructor)[wrap-field-value]: When F is thunked,
return a one-argument lambda instead of a thunk, and parameterize
THIS-RECORD.
(define-record-type*)[thunked-field-accessor-definition]: Pass X
to (real-get X).
* tests/records.scm ("define-record-type* & thunked & this-record")
("define-record-type* & thunked & default & this-record")
("define-record-type* & thunked & inherit & this-record"): New tests.
2019-03-25 23:37:06 +01:00
Ludovic Courtès 94aeec0aef
ui: Bypass Texinfo parsing and rendering for searches.
This makes search queries such as:

  LANGUAGE=fr guix package -s utilitaire -s recherche

about 6 times faster.

* guix/ui.scm (%package-metrics): Do not use 'package-synopsis-string'
and 'package-description-string' to bypass Texinfo parsing and
rendering.
2019-03-24 00:13:53 +01:00
Julien Lepiller 78b3748c1c
guix: dune-build-system: Add a package parameter.
* guix/build-system/dune.scm: Add a package parameter.
* guix/build/dune.scm (build, test, install): Use it.
* doc/guix.texi: Document it.
2019-03-23 22:58:52 +01:00
Marius Bakke 3cb61ca85a
Merge branch 'master' into staging 2019-03-23 22:50:07 +01:00
Efraim Flashner 4e4c311465
build: Add rakudo-build-system.
* guix/build-system/rakudo.scm,
guix/build/rakudo-build-system.scm: New files.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build System): Document it.
2019-03-23 22:26:48 +02:00
Julien Lepiller a506a4c380
import: opam: Also update dune packages.
* guix/import/opam.scm (opam-package?): Also accept packages that use the
dune build system.
2019-03-23 18:37:29 +01:00
Ludovic Courtès a53ecfc897
graph: Factorize calls to 'fold-packages'.
* guix/scripts/graph.scm (all-packages): New procedure.
(%reverse-package-node-type, %reverse-bag-node-type): Use 'all-packages'
instead of 'fold-packages'.
2019-03-23 18:15:36 +01:00
Ludovic Courtès 2b81eac01e
graph: Add the 'reverse-bag' graph.
Suggested by Julien Lepiller.

* guix/scripts/graph.scm (%reverse-bag-node-type): New variable.
(%node-types): Add it.
* tests/graph.scm ("reverse bag DAG"): New test.
* doc/guix.texi (Invoking guix graph): Document it.
2019-03-23 18:15:36 +01:00
Marius Bakke 081850816f
Merge branch 'master' into staging 2019-03-21 23:18:54 +01:00
Marius Bakke ad4910eec0
build-system/meson: Add #:allowed-references and #:disallowed-references.
* guix/build-system/meson.scm (meson-build): Add support for
  #:allowed-references and #:disallowed-references.
2019-03-21 19:23:47 +01:00
Ludovic Courtès 6c5e618ca0
pack: Create an empty /home directory for '-f squashfs'.
Fixes <https://bugs.gnu.org/34914>.

* guix/scripts/pack.scm (squashfs-image)[build]: Pass "-p /home d 555 0 0".
2019-03-19 11:30:34 +01:00
Ludovic Courtès 427c87d0bd
pack: Produce relative symlinks when using '-f squashfs'.
Fixes <https://bugs.gnu.org/34913>.

* guix/scripts/pack.scm (squashfs-image)[build]: Use
'relative-file-name' when creating SYMLINKS.
* guix/scripts/pack.scm (guix-pack): Pass #:relative-symlinks? #t when
PACK-FORMAT is 'squashfs.
2019-03-19 11:30:34 +01:00
Arun Isaac ae031d453c
import: Add Launchpad updater.
* guix/import/launchpad.scm: New file.
* Makefile.am (MODULES): Register it.
* doc/guix.texi (Invoking guix refresh): Mention the Launchpad updater.
2019-03-18 20:55:55 +05:30
ng0 47956fa0c2
Correct name and email address for ng0.
* .mailmap, Makefile.am, doc/guix.de.texi, doc/guix.fr.texi,
doc/guix.texi, etc/completion/fish/guix.fish,
gnu/packages/accessibility.scm, gnu/packages/admin.scm,
gnu/packages/audio.scm, gnu/packages/autotools.scm,
gnu/packages/cdrom.scm, gnu/packages/check.scm,
gnu/packages/cinnamon.scm, gnu/packages/compression.scm,
gnu/packages/crypto.scm, gnu/packages/databases.scm,
gnu/packages/django.scm, gnu/packages/dns.scm, gnu/packages/elixir.scm,
gnu/packages/emacs-xyz.scm, gnu/packages/emacs.scm,
gnu/packages/enlightenment.scm, gnu/packages/erlang.scm,
gnu/packages/fonts.scm, gnu/packages/fontutils.scm,
gnu/packages/forth.scm, gnu/packages/fvwm.scm, gnu/packages/games.scm,
gnu/packages/gl.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm,
gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/gtk.scm,
gnu/packages/guile-wm.scm,gnu/packages/guile-xyz.scm,
gnu/packages/haskell-check.scm, gnu/packages/haskell-crypto.scm,
gnu/packages/haskell.scm, gnu/packages/image-viewers.scm,
gnu/packages/image.scm, gnu/packages/irc.scm,
gnu/packages/language.scm, gnu/packages/libcanberra.scm,
gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lolcode.scm,
gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm,
gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm,
gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm,
gnu/packages/ncurses.scm, gnu/packages/networking.scm,
gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm,
gnu/packages/perl-check.scm, gnu/packages/perl.scm,
gnu/packages/python-compression.scm, gnu/packages/python-crypto.scm,
gnu/packages/python-web.scm, gnu/packages/python-xyz.scm,
gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm,
gnu/packages/rust.scm, gnu/packages/scheme.scm,
gnu/packages/serialization.scm, gnu/packages/shells.scm,
gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm,
gnu/packages/telephony.scm, gnu/packages/text-editors.scm,
gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm,
gnu/packages/tor.scm, gnu/packages/version-control.scm,
gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm,
gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm,
gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm,
gnu/services/desktop.scm, gnu/services/version-control.scm,
gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm:
Correct name and email address for ng0.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2019-03-18 15:05:08 +01:00
Ludovic Courtès b6fd086a61
describe: Warn about 'GUIX_PACKAGE_PATH' in json and recutils format.
Fixes <https://bugs.gnu.org/34884>.
Reported by Pierre Neidhardt <mail@ambrevar.xyz>.

* guix/scripts/describe.scm (display-package-search-path): Add catch-all
case for FMT.
2019-03-18 10:51:05 +01:00
Ludovic Courtès d831b19079
guix build: '--with-branch' strips slashes from the version string.
This fixes things like:

  guix build glibc \
    --with-git-url=glibc=git://sourceware.org/git/glibc.git \
    --with-branch=glibc=release/2.25/master

whereby slashes would before go straight to the 'version' field, leading
to an invalid store file name.

* guix/scripts/build.scm (transform-package-source-branch)[replace]:
Replace slashes with hyphens in BRANCH when building the version
string.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 845c44012c
guix build: '--with-commit' makes recursive checkouts.
This was an omission from commit
024a6bfba9.

* guix/scripts/build.scm (transform-package-source-commit): Add
'recursive?' field to SOURCE.
* tests/scripts-build.scm ("options->transformation, with-branch")
("options->transformation, with-commit"): New tests.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 14328b81a2
guix build: Transformation options match packages by spec.
This allows us to combine several transformations on a given package, in
particular '--with-git-url' and '--with-branch'.

Previously transformations would ignore each other since they would all
take (specification->package SOURCE) as their replacement source,
compare it by identity, which doesn't work if a previous transformation
has already changed SOURCE.

* guix/scripts/build.scm (evaluate-replacement-specs): Adjust to produce
an alist as expected by 'package-input-rewriting/spec', with a package
spec as the first element of each pair.
(evaluate-git-replacement-specs): Likewise.
(transform-package-inputs):  Adjust accordingly and use
'package-input-rewriting/spec'.
(transform-package-inputs/graft): Likewise.
(transform-package-source-branch, transform-package-source-commit): Use
'package-input-rewriting/spec'.
(transform-package-source-git-url): Likewise, and adjust the
REPLACEMENTS alist accordingly.
(options->transformation): Iterate over OPTS instead of over
%TRANSFORMATIONS.  Invoke transformations one by one.
* tests/scripts-build.scm ("options->transformation, with-input"):
Adjust test to compare packages by name rather than by identity.
("options->transformation, with-git-url + with-branch"): New test.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 0c0ff42a24
guix build: Factorize 'package-git-url'.
* guix/scripts/build.scm (package-git-url): New procedure.
(evaluate-git-replacement-specs): Use it.
2019-03-17 22:55:01 +01:00
Ludovic Courtès f258d88628
packages: Add 'package-input-rewriting/spec'.
* guix/packages.scm (package-input-rewriting/spec): New procedure.
* tests/packages.scm ("package-input-rewriting/spec")
("package-input-rewriting/spec, partial match"): New tests.
* doc/guix.texi (Defining Packages): Document it.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 880916ac52
guix build: Add '--with-git-url'.
* guix/scripts/build.scm (%not-equal): New variable.
(evaluate-git-replacement-specs): Use it instead of local variable
'not-equal'.
(transform-package-source-git-url): New procedure.
(%transformations): Add 'with-git-url'.
(%transformation-options, show-transformation-options-help): Add
'--with-git-url'.
* tests/scripts-build.scm ("options->transformation, with-git-url"):
New test.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 55da450a1f
scripts: 'warn-about-old-distro' looks at the age of the running Guix.
This fixes a discrepancy that could be seen when running:

  sudo guix system …

where 'guix' would warn about the age of root's Guix, even though the
running Guix is the user's, not root's.

* guix/scripts.scm (warn-about-old-distro)[false-if-not-found]: Remove.
Obtain the profile date by calling 'current-profile-date' instead of
stat'ing "current-guix".
2019-03-17 22:55:01 +01:00
Ludovic Courtès cd2e4b2a8d
describe: Add 'current-profile-date'.
* guix/describe.scm (current-profile-date): New procedure.
2019-03-17 22:55:01 +01:00
Ludovic Courtès 8ffab257dd
guix system: Fix success report of the bootloader installation.
Fixes <https://bugs.gnu.org/34890>.
Reported by Jack Hill <jackhill@jackhill.us>.

Regression introduced in 21fcfe1ee9.

* guix/scripts/system.scm (bootloader-installer-script): Ungexp DEVICE.
2019-03-17 16:30:00 +01:00
Tobias Geerinckx-Rice b56d160944
guix: Match package names case-insensitively.
* guix/scripts/package.scm (options->upgrade-predicate, process-query):
Use REGEXP/ICASE when matching package names.
2019-03-16 23:32:41 +01:00
Ludovic Courtès 21fcfe1ee9
bootloader: Use 'invoke/quiet' when running 'grub-install' and co.
This hides potentially confusing GRUB messages from the user, such as
"Installing for i386-pc platform."

* gnu/bootloader/extlinux.scm (install-extlinux): Use 'invoke/quiet'
instead of 'system*' and 'error'.
* gnu/bootloader/grub.scm (install-grub, install-grub-efi): Likewise.
* guix/scripts/system.scm (bootloader-installer-script): Guard against
'message-condition?' and handle them properly.
2019-03-16 18:15:13 +01:00
Ludovic Courtès 22f95e028f
tests: Add 'with-environment-variable'.
* tests/scripts.scm (with-environment-variable): Move to...
* guix/tests.scm (with-environment-variable): ... here.
* tests/build-utils.scm ("wrap-program, one input, multiple calls"):
Use it instead of 'setenv'.
2019-03-16 18:15:09 +01:00
P.C. Shyamshankar 41dfe40f5d
pack: Construct inferior package names correctly.
* guix/scripts/pack.scm (wrapped-package): now correctly constructs full
names of inferior packages.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2019-03-15 23:27:59 +01:00
Ludovic Courtès 99aec37a78
pack: "-RR" produces PRoot-enabled relocatable binaries.
* gnu/packages/aux-files/run-in-namespace.c (exec_with_proot): New
function.
(main): When 'clone' fails, call 'rm_rf'.
[PROOT_PROGRAM]: When 'clone' fails, call 'exec_with_proot'.
* guix/scripts/pack.scm (wrapped-package): Add #:proot?.
[proot]: New procedure.
[build]: Compile with -DPROOT_PROGRAM when PROOT? is true.
* guix/scripts/pack.scm (%options): Set the 'relocatable?' value to
'proot when "-R" is passed several times.
(guix-pack): Pass #:proot? to 'wrapped-package'.
* tests/guix-pack-relocatable.sh: Use "-RR" on Intel systems that lack
user namespace support.
* doc/guix.texi (Invoking guix pack): Document -RR.
2019-03-15 23:27:59 +01:00
Ludovic Courtès ee71d44e60
build-system/glib-or-gtk: Support #:disallowed-references.
* guix/build-system/glib-or-gtk.scm (glib-or-gtk-build): Add
 #:disallowed-references and honor it.
2019-03-15 23:27:58 +01:00
Guy Fleury Iteriteka bc4cea6f0e
download: Add MATE mirrors.
* guix/download.scm (%mirrors): Add mirrors for the MATE Desktop.
2019-03-15 13:05:08 -04:00
Leo Famulari e3900a4d64
build-system/go: Build with a filesystem union of Go dependencies.
This basically changes (guix build-system go) so that instead of looking
up its dependencies in a list of directories in $GOPATH, all the
Go dependencies are symlinked into a single directory.

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

* guix/build/go-build-system.scm (setup-go-environment): New variable.
(setup-environment, install-source): Remove variables.
(unpack): Unpack the source relative to $GOPATH.
(install): Do not install the compiled objects in the 'pkg' directory.
Install the source code in this phase, and only install the source of
the package named by IMPORT-PATH.
* doc/guix.texi (Build Systems): Adjust accordingly.
* gnu/packages/docker.scm (docker): Import (guix build union) on the build side
and adjust to build phase name changes in (guix build-system go).
* gnu/packages/shellutils.scm (direnv): Likewise.
* gnu/packages/databases.scm (mongo-tools)[arguments]:
Set '#:install-source #f'.
* gnu/packages/music.scm (demlo)[arguments]: Move the 'install-scripts'
phase after the 'install' phase.
2019-03-14 15:34:26 -04:00
Marius Bakke ebfe259f66
Merge branch 'master' into staging 2019-03-14 15:06:06 +01:00
Ludovic Courtès 59e8044588
Remove traces of "GuixSD".
* gnu/bootloader/extlinux.scm (extlinux-configuration-file): Remove
mentions of "GuixSD".
* gnu/bootloader/grub.scm (install-grub-efi): Likewise.
* gnu/build/vm.scm (make-iso9660-image): Change default #:volume-id to
"Guix_image".
(initialize-hard-disk): Search for the "Guix_image" label.
* gnu/ci.scm (system-test-jobs, tarball-jobs): Remove "GuixSD".
* gnu/installer/newt/welcome.scm (run-welcome-page): Likewise.
* gnu/packages/audio.scm (supercollider)[description]: Likewise.
* gnu/packages/curl.scm (curl): Likewise.
* gnu/packages/emacs.scm (emacs): Likewise.
* gnu/packages/gnome.scm (network-manager): Likewise.
* gnu/packages/julia.scm (julia): Likewise.
* gnu/packages/linux.scm (alsa-plugins): Likewise.
(powertop, wireless-regdb): Likewise.
* gnu/packages/package-management.scm (guix): Likewise.
* gnu/packages/polkit.scm (polkit): Likewise.
* gnu/packages/tex.scm (texlive-bin): Likewise.
* gnu/services/base.scm (file-systems->fstab): Likewise.
* gnu/services/cups.scm (%cups-activation): Likewise.
* gnu/services/mail.scm (%dovecot-activation): Likewise.
* gnu/services/messaging.scm (prosody-configuration)[log]: Likewise.
* gnu/system/examples/vm-image.tmpl (vm-image-motd): Likewise.
* gnu/system/install.scm (installation-os)[file-systems]: Change root
file system label to "Guix_image".
* gnu/system/mapped-devices.scm (check-device-initrd-modules):
Remove "GuixSD".
* gnu/system/vm.scm (system-docker-image): Likewise.
(system-disk-image)[root-label]: Change to "Guix_image".
* gnu/tests/install.scm (run-install): Remove "GuixSD".
* guix/modules.scm (guix-module-name?): Likewise.
* nix/libstore/optimise-store.cc: Likewise.
2019-03-13 23:12:43 +01:00
Ludovic Courtès 3f4f2ee404
describe: 'package-path-entries' no longer includes the "guix" entry.
Fixes <https://bugs.gnu.org/34833>
Reported by mikadoZero <mikadozero@yandex.com>.

By returning the "guix" entry, we were then adding it to
%PACKAGE-MODULE-PATH, causing the discovery code to scan the whole tree,
including gnu/installer modules, which would in turn lead to warnings.
Regression introduced in bfc9c33930.

* guix/describe.scm (package-path-entries): Use
'current-channel-entries', not 'current-profile-entries'.
2019-03-12 23:51:32 +01:00
Ludovic Courtès c9c51ac39a
Revert "packages: 'package-input-rewriting' can take a promise."
This reverts commit 7d2be1277b, which
turned out to be unhelpful for the problem at hand:

  https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00486.html
2019-03-12 23:51:32 +01:00
Ludovic Courtès bfc9c33930
packages: Add the channel .go files to the search path.
Until now %LOAD-COMPILED-PATH would wrongfully contain:

  CHANNEL/share/guile/site/X.Y

for each channel, thereby ignoring all the .go files of channels.  This
fixes it so that %LOAD-COMPILED-PATH instead contains:

  CHANNEL/lib/guile/X.Y/site-ccache

* guix/describe.scm (current-channel-entries): New procedure.
(package-path-entries): Change to return the %LOAD-COMPILED-PATH entries
as a second value.
* gnu/packages.scm (%package-module-path): Expect two values from
'package-path-entries' and augment %LOAD-COMPILED-PATH accordingly.
2019-03-11 23:12:26 +01:00
Marius Bakke 8c5533b582
Merge branch 'master' into staging 2019-03-10 18:38:25 +01:00
Ludovic Courtès 0bd1498fc4
upstream: Correctly report failure to update Git checkouts.
Fixes <https://bugs.gnu.org/34778>.
Reported by Gábor Boskovits <boskovits@gmail.com>.

* guix/upstream.scm (package-update/url-fetch): New procedure, with code
formerly in 'package-update'.
(%method-updates): New variable.
(package-update): Check the method to download PACKAGE's source, and
look up a corresponding update method in %METHOD-UPDATES, and raise an
error if none was found.
2019-03-08 23:21:59 +01:00
Ricardo Wurmus 8057c9e906
gnu: Add epl2.0.
* guix/licenses.scm (epl2.0): New variable.
2019-03-08 23:18:01 +01:00
Ludovic Courtès 4035fcba93
channels: Do not fail when the inferior lacks 'guix repl'.
Fixes <https://bugs.gnu.org/34637>.
Reported by Martin Flack <martin.flack@gmail.com>.

Previously we'd fail to build the package cache for old versions of Guix
that lack 'guix repl'.  Now we simply ignore the issue and keep going
without a cache.

* guix/inferior.scm (gexp->derivation-in-inferior): Add
 #:silent-failure? and honor it.
[drop-extra-keyword]: New procedure.
Use it.
* guix/channels.scm (package-cache-file): Pass #:silent-failure? #t.
2019-03-08 12:31:38 +01:00
Ludovic Courtès d40ec4a0d0
pack: Add '--save-provenance'.
* guix/scripts/pack.scm (show-help, %options): Add '--save-provenance'.
(guix-pack)[manifest-from-args]: Honor it.
* doc/guix.texi (Invoking guix pack): Document it.
2019-03-07 00:00:18 +01:00
Ludovic Courtès 2cb658a9a7
describe: Add 'package-provenance'.
* guix/scripts/package.scm (package-provenance): Move to...
* guix/describe.scm (package-provenance): ... here.
2019-03-07 00:00:18 +01:00
Caleb Ristvedt a4678c6ba1
database: Make 'register-items' transactional.
* guix/store/database.scm (SQLITE_BUSY, register-output-sql): New variables.
(add-references): Don't try finalizing after each use, only after all the
uses (otherwise a finalized statement would be used if #:cache? was #f).
(call-with-transaction): New procedure.
(register-items): Use call-with-transaction to prevent broken intermediate
states from being visible.

* .dir-locals.el (call-with-transaction): indent it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-03-07 00:00:18 +01:00
Marius Bakke 4f8dc1536a
Merge branch 'master' into staging 2019-03-04 22:31:59 +01:00
Ludovic Courtès dca5821958
environment: Rename '--inherit' to '--preserve'.
Suggested by Eric Bavier and Ricardo Wurmus.

* guix/scripts/environment.scm (show-help, %options): Emit a deprecation
warning for "--inherit" and add -E/--preserve.
* tests/guix-environment.sh: Adjust accordingly.
* doc/guix.texi (Invoking guix environment): Update accordingly.
2019-03-04 15:22:59 +01:00
Ludovic Courtès bab9cc4aff
environment: Remove deprecated -E/--exec option.
* guix/scripts/environment.scm (%options): Remove "--exec", which was
deprecated in commit 1de2fe95e0 in 2015.
* tests/guix-environment.sh: Remove use of '-E'.
2019-03-04 15:22:59 +01:00
Marius Bakke 19464173ba
Merge branch 'master' into staging 2019-03-01 17:33:00 +01:00
Ivan Petkov 7d141788b1
gnu: rust: Factor out "cargo-utils" from "cargo-build-system".
* guix/build/cargo-utils.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/build-system/cargo.scm (%cargo-utils-modules): New variable.
(%cargo-build-system-modules): Use it.
* guix/build/cargo-build-system.scm (file-sha256, generate-checksums): Move
from here...
* guix/build/cargo-utils.scm: ...to here.
* gnu/packages/rust.scm (rust-1.19.0)[arguments]<#:imported-modules>: Use
%cargo-utils-modules.
<#:phases>[patch-cargo-checksums]: Use (guix build cargo-utils).
* gnu/packages/gnuzilla.scm (icecat):
[arguments]<#:imported-modules>: Use %cargo-utils-modules.
<#phases>[patch-cargo-checksums]: import (guix build cargo-utils).

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2019-03-01 08:20:50 +01:00
Marius Bakke 2c76e19df4
Merge branch 'master' into staging 2019-02-20 17:01:39 +01:00
Ludovic Courtès 54eadc42d2
self: Generated (guix config) honors %CURRENT-SYSTEM.
Fixes <https://bugs.gnu.org/34468>.
Reported by Diego Nicola Barbato <dnbarbato@posteo.de>.

* guix/self.scm (%config-variables): Remove %SYSTEM.
(make-config.scm): Define '%system' to (%current-system).
2019-02-17 00:04:57 +01:00
Ludovic Courtès ba48895899
self: Bundle 'glibc-utf8-locales'.
This minimizes the risk of locale-related warnings, at least for those
who use one of the bundled UTF-8 locales.

* guix/self.scm (guix-command)[glibc-utf8-locales]: New variable.
In program body, set GUIX_LOCPATH.
2019-02-16 01:00:08 +01:00
Ludovic Courtès e6e599fa01
environment: Add '--inherit'.
* guix/scripts/environment.scm (purify-environment): Add 'white-list'
parameter and honor it.
(create-environment): Add #:white-list parameter and honor it.
(launch-environment): Likewise.
(launch-environment/fork): Likewise.
(show-help, %options): Add '--inherit'.
(guix-environment): Define 'white-list' and pass it to
'launch-environment/fork'.
* tests/guix-environment.sh: Test '--inherit'.
* doc/guix.texi (Invoking guix environment): Document it.
2019-02-16 01:00:08 +01:00
Marius Bakke 142cf42121
gnu-maintenance: Verify GPG signatures in KDE updater.
* guix/gnu-maintenance.scm (latest-kde-release): Remove #:file->signature.
2019-02-15 12:12:09 +01:00
Christopher Baines 0168473c0a
guix: ruby-build-system: Fix removal of extension related files.
This functionality was broken, possibly to do with the vendor related changes
in the ruby build system. These changes restore the file removal functionality
at the end of the install phase.

* guix/build/ruby-build-system.scm (install): Fix removal of files related to
native extensions.
2019-02-14 19:30:15 +00:00
Christopher Baines 9be39b4c67
guix: ruby-build-system: Do gem install --verbose.
This is helpful as it displays more information about what gem install is
doing, especially for packages with native extensions.

* guix/build/ruby-build-system.scm (install): Add --verbose to gem install command.
2019-02-14 19:30:14 +00:00
Christopher Baines ab149c6ba0
gnu: ruby-build-system: Change extract-gemspec to always return #t.
* guix/build/ruby-build-system.scm (extract-gemspec): Return #t right at the
end, rather than returning #<unspecified> when not handling a gem archive.
2019-02-14 19:30:12 +00:00
Ludovic Courtès 1e9698344d
guix system: List old generations from newest to oldest.
Previously 'guix system switch-generation' or 'delete-generations' would
yield a GRUB menu where entries for old generations were in the wrong
order (i.e., oldest first.)

* guix/scripts/system.scm (reinstall-bootloader): Reverse the list
returned by 'generation-numbers'.
2019-02-13 16:19:54 +01:00
Ludovic Courtès 499b166d1c
guix system: Add 'delete-generations'.
* guix/scripts/package.scm (delete-matching-generations): Export.
* guix/scripts/system.scm (show-help): Add 'delete-generations'.
(process-command): Honor it.
(guix-system): Support it.
* doc/guix.texi (Invoking guix system): Document it.
2019-02-13 16:19:54 +01:00
Ludovic Courtès 201253674b
pull: Speed up the new/upgraded package computation.
* guix/scripts/pull.scm (new/upgraded-packages): OLD no longer stores
all the versions of each package.  Remove 'vhash-fold*' call and reduce
the number of 'version>?' calls when computing UPGRADED.
2019-02-12 23:30:16 +01:00
Ludovic Courtès cf0eacceb4
pull: Move profile comparison to 'new/upgraded-packages'.
* guix/scripts/pull.scm (new/upgraded-packages): New procedure, with
code formerly in 'display-new/upgraded-packages'.
(display-new/upgraded-packages): Use it.
2019-02-12 23:30:16 +01:00
Ludovic Courtès 739380542d
inferior: Add 'inferior-available-packages'.
* guix/inferior.scm (inferior-available-packages): New procedure.
* tests/inferior.scm ("inferior-available-packages"): New test.
2019-02-12 23:30:16 +01:00
Ludovic Courtès 46765f82db
pull: Use 'fold-available-packages' for the current package list.
* guix/scripts/pull.scm (display-profile-news): Use
'fold-available-packages' instead of 'fold-packages' to compute OLD.
(profile-package-alist): Use 'inferior-available-packages'.
2019-02-12 23:30:16 +01:00
Ludovic Courtès 2637cfd7a4
Avoid name clash with 'build' from (guix store) and (guix status).
Since commit 976ef2d978, (guix status)
exports 'build', which clashes with 'build' from (guix store).

* build-aux/run-system-tests.scm: Select 'with-status-verbosity'
from (guix status).
* guix/scripts/archive.scm: Likewise.
* guix/scripts/build.scm: Likewise.
* guix/scripts/copy.scm: Likewise.
* guix/scripts/environment.scm: Likewise.
* guix/scripts/pack.scm: Likewise.
* guix/scripts/package.scm: Likewise.
* guix/scripts/pull.scm: Likewise.
* guix/scripts/system.scm: Likewise.
2019-02-11 23:23:28 +01:00
Ludovic Courtès 910d0121a8
pack, vm: Fix incorrect use of 'package-transitive-propagated-inputs'.
In practice the error was not triggered because
'package-transitive-propagated-inputs' currently returns the empty list
for these two packages.

* guix/scripts/pack.scm (gcrypt-sqlite3&co): Remove labels from the
result.
* gnu/system/vm.scm (gcrypt-sqlite3&co): Likewise.
2019-02-11 23:23:28 +01:00
Ludovic Courtès 1d8b10d00f
git: Add an exception printer for 'git-error'.
* guix/git.scm (print-git-error): New procedure.
<top level>: Call 'set-exception-printer!'.
2019-02-11 23:23:28 +01:00
Ludovic Courtès 70a50305c4
ui: Always print the exception upon load errors.
Fixes <https://bugs.gnu.org/34402>.
Reported by <pkill9@runbox.com>.

Previously 'display-error' could be called with the wrong number of
arguments (e.g., for 'git-error' exceptions), and thus nothing at all
was displayed.

* guix/ui.scm (report-load-error): Check whether ARGS matches the
parameters for 'display-error' and call 'print-exception' otherwise.
2019-02-11 23:23:28 +01:00
Ludovic Courtès 5ea206a8a9
status: Erase the current line upon new builds or downloads.
* guix/status.scm (print-build-event): Add 'erase-current-line*' call
upon 'build-started, 'substituter-started, 'download-started.
2019-02-11 23:23:27 +01:00
Ludovic Courtès 50a93adc05
Merge branch 'staging' 2019-02-09 15:14:59 +01:00
Ludovic Courtès bc041b3e26
git: Always use the system certificates by default.
'guix pull' was always doing it, and now '--with-branch' & co. will do
it as well.

* guix/git.scm (honor-system-x509-certificates!): New procedure.
(%certificates-initialized?): New variable.
(with-libgit2): Add call to 'honor-system-x509-certificates!'.
* guix/scripts/pull.scm (honor-x509-certificates): Call
'honor-system-x509-certificates!' and fall back to
'honor-lets-encrypt-certificates!'.
2019-02-08 10:41:13 +01:00
Ludovic Courtès 024a6bfba9
guix build: '--with-branch' & co. fetch submodules.
* guix/scripts/build.scm (transform-package-source-branch)[replace]: Add
'recursive?' field to the new package.
2019-02-08 10:41:13 +01:00
Ludovic Courtès 06fff484ce
git: Add a 'recursive?' field to <git-checkout> records.
* guix/git.scm (<git-checkout>)[recursive?]: New field.
(latest-repository-commit*): Add #:recursive? and honor it.
(git-checkout-compiler): Honor the 'recursive?' field of CHECKOUT.
2019-02-08 10:41:13 +01:00
Ludovic Courtès 60cbc6a8df
git: Support recursive updates of submodules.
* guix/git.scm: Autoload (git submodule).
(url-cache-directory): Add #:recursive? and honor it.
(call-with-repository): New procedure.
(with-repository): New macro.
(update-submodules): New procedure.
(update-cached-checkout): Add #:recursive? and #:log-port and honor
them.
(latest-repository-commit): Add #:recursive? and honor it.
[dot-git?]: Recognize ".git" regular files when RECURSIVE? is true.
2019-02-08 10:41:13 +01:00
Ludovic Courtès 024d5275c5
status: Do not systematically erase the previous line.
After a successful download, we'd erase the download-progress line, and
the end result would be two empty lines following the "downloading …"
line.

Reported by Ricardo Wurmus <rekado@elephly.net> at
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33470#27>.

* guix/status.scm (print-build-event)[erase-current-line*]: Set to a
no-op when PRINT-LOG? is true.
Move calls to 'erase-current-line*' to the 'build-succeeded' and
'build-failed' events.
2019-02-07 15:46:45 +01:00
Ludovic Courtès 487cbb0164
profiles: Raise an error for unmatched patterns.
Previously, "guix package -r something-not-installed" would silently
complete.  Now an error is raised.

* guix/profiles.scm (&unmatched-pattern-error): New condition type.
(manifest-matching-entries): Rewrite to raise an error when one of
PATTERNS is not matched.
* guix/ui.scm (call-with-error-handling): Handle 'unmatched-pattern-error?'.
* tests/guix-package.sh: Add test.
* tests/profiles.scm ("manifest-matching-entries"): Don't try to remove
unmatched pattern.
("manifest-matching-entries, no match"): New test.
("manifest-transaction-effects"): Remove 'remove' field.
2019-02-07 15:46:45 +01:00
Ludovic Courtès 8245bb74fc
monads, gexp: Prevent redefinition of syntax parameters.
Fixes <https://bugs.gnu.org/27476>.

This fixes multi-threaded compilation of this code where syntax
parameters could end up being redefined and where a race condition could
lead a thread to see the "wrong" value of the syntax parameter.

* guix/monads.scm (define-syntax-parameter-once): New macro.
(>>=, return): Use it.
* guix/gexp.scm (define-syntax-parameter-once): New macro.
(current-imported-modules, current-imported-extensions): Use it.
2019-02-06 23:06:18 +01:00
Julien Lepiller c3a191fafd
import: opam: Work around janestreet version numbers.
janestreet reversionned its packages and prefixed them with "v". Let the
importer know about that and choose "v" versions first.

* guix/import/opam.scm (find-latest-version): Work around version
rewrite from janestreet.
(opam->guix-package): Do not pass "v" to version number.
2019-02-05 22:33:13 +01:00
Julien Lepiller beee37ecdb
import: opam: Replace "_" with "-" in imported names.
* guix/import/opam.scm (ocaml-name->guix-name): Replace "_" with "-".
(opam->guix-packages): Add upstream name when we cannot guess it
properly.
2019-02-05 22:33:08 +01:00
Julien Lepiller 0f4432c620
import: opam: Fix conditions.
* guix/import/opam.scm (condition-eq, condition-neq): The first argument
can be empty.
* tests/opam.scm: Add test case.
2019-02-05 22:33:06 +01:00
Ludovic Courtès 596fb4baf0
status: Display the current build phase.
* guix/status.scm (spin!): Add 'phase' parameter and honor it.  Callers
updated.
(print-build-event)[report-progress]: Likewise.
2019-02-05 12:03:25 +01:00
Ludovic Courtès ba514b601b
status: Keep track of the current build phase.
* guix/status.scm (<build>)[phase]: New field.
(%phase-start-rx): New variable.
(update-build): Add clause to match %PHASE-START-RX and adjust the
'phase' field accordingly.
* tests/status.scm ("compute-status, build phase"): Add test
2019-02-05 12:03:25 +01:00
Ludovic Courtès c7465dcb96
status: Use 'define-immutable-record-type' and its functional setters.
* guix/status.scm (<build>): Define using
'define-immutable-record-type', and add 'set-build-completion' binding.
(update-build)[set-completion]: Remove.
Use 'set-build-completion' instead.
2019-02-05 12:03:25 +01:00
Gabriel Hondet 625a3daa12
gnu: dune: Update to 1.6.3.
* gnu/packages/ocaml.scm (dune): Update to 1.6.3.
* guix/build/dune-build-system.scm (build): Use --libdir.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2019-02-04 22:03:22 +01:00
Ludovic Courtès 7473bce207
status: Erase the progress bar or spinner.
Previously the progress bar wouldn't be erased by the time the next
"building foo" line would be printed.

* guix/status.scm (print-build-event)[erase-current-line*]: New
procedure.
Call it instead of (display "\r").
2019-02-04 16:20:01 +01:00
Ludovic Courtès 7c4700e9f9
store: 'log-file' honors 'GUIX_LOG_DIRECTORY'.
* guix/store.scm (derivation-log-file): Use %LOCALSTATEDIR or
"GUIX_LOG_DIRECTORY" instead of (dirname %STATE-DIRECTORY).
2019-02-04 00:03:30 +01:00
Ludovic Courtès 765a5bf167
self: Ensure the daemon refers to the right 'guix' command.
Previously it would refer to
/var/guix/profiles/per-user/root/current-guix/bin/guix, which would fail
when that profile does not exist.  This is notably the case when using
'channel-instance->package' as done in commit
7e6d8d366a.

* gnu/packages/package-management.scm (guix-daemon)[arguments]: In
'install phase, honor environment variable 'GUIX'.
* guix/self.scm (whole-package)[wrap]: New procedure.
Use it.
2019-02-04 00:03:30 +01:00
Ludovic Courtès a87d66f371
daemon: Rename 'NIX_STATE_DIR' and 'NIX_DB_DIR' environment variables.
Fixes <https://bugs.gnu.org/22459>.
Reported by Jeff Mickey <j@codemac.net>.

* guix/config.scm.in (%state-directory): Change NIX_STATE_DIR to
GUIX_STATE_DIRECTORY.
(%store-database-directory): Change NIX_DB_DIR to
GUIX_DATABASE_DIRECTORY.
* nix/libstore/globals.cc (Settings::processEnvironment): Likewise.
* guix/self.scm (make-config.scm): Likewise.
* build-aux/build-self.scm (make-config.scm): Likewise.
* build-aux/test-env.in: Likewise.
* tests/derivations.scm ("derivation #:leaked-env-vars"): Likewise.
* tests/guix-build.sh (GUIX_DAEMON_SOCKET): Likewise.
* tests/guix-daemon.sh (socket): Likewise.
2019-02-04 00:03:30 +01:00
Ludovic Courtès f6fe7da372
profiles: 'manual-database' hook reports progress.
* guix/profiles.scm (manual-database)[build](compute-entries): Write a
progress report.
2019-02-01 19:31:34 +01:00
Ludovic Courtès 35ef5bc866
guix package: '-A' no longer lists deprecated packages.
Fixes a regression introduced in
0ea939fb79.

* guix/scripts/package.scm (process-query) <'list-available>: Change
 #:superseded? to #:deprecated? since that's what
 'fold-available-packages' passes.
2019-02-01 19:28:49 +01:00
Marius Bakke 0747328e31
Merge branch 'master' into staging 2019-01-31 23:32:56 +01:00
Ludovic Courtès 2790b6670b
pull: Default to verbosity level 1.
* guix/scripts/pull.scm (%default-options): Change 'verbosity to 1.
2019-01-29 12:09:53 +01:00
Ludovic Courtès 35dcaa119e
self: Produce progress reports compatible with (guix status).
* guix/self.scm (compiled-modules)[build](report-load)
(report-compilation): Write "[M/N]" progress reports.
Use line-buffering.
2019-01-29 12:09:52 +01:00
Ludovic Courtès 3854c6429c
status: Print a progress bar for on-going builds when possible.
* guix/status.scm (print-build-event)[report-build-progress]: New
procedure.
[print-log-line]: Add ID parameter.  Call 'report-build-progress' when
appropriate.
Adjust callers.
2019-01-29 12:09:52 +01:00
Ludovic Courtès 73a8681a16
status: Keep track of build completion as reported by build tools.
* guix/status.scm (<build>)[completion]: New field.
(build): Add #:completion parameter.
(%percentage-line-rx, %fraction-line-rx): New variables.
(update-build): New procedure.
(compute-status): Add 'build-log' case.
* tests/status.scm ("compute-status, build completion"): New test.
2019-01-29 12:09:52 +01:00
Ludovic Courtès 976ef2d978
status: Record more information about builds.
* guix/status.scm (<build>): New record type.
(build, matching-build): New procedures.
(compute-status): Adjust to manipulate <build> records instead of
derivation file names in 'build-status-builds-completed' and
'build-status-building'.
(build-event-output-port)[process-line]: Use 'string-split' to preserve
spaces.
* tests/status.scm ("compute-status, builds + substitutes")
("compute-status, missing events"): Adjust to expect <build> records.
Produce complete "build-started" events.
("compute-status, multiplexed build output"): Likewise, and remove
"bar.drv" from 'builds-completed'.
2019-01-29 12:09:52 +01:00
Ludovic Courtès f674bc6620
channels: Do not offload package cache derivation.
* guix/channels.scm (package-cache-file): Pass #:local-build? to
'gexp->derivation-in-inferior'.
2019-01-29 12:09:52 +01:00
Ludovic Courtès d1d72830f2
pull: Don't trigger 'hash guix' hint needlessly.
Previously if ~/.config/guix/current/bin was in $PATH, we'd still
suggest to run 'hash guix' because we'd compare (which "guix") against
/var/guix/profiles/per-user/….

* guix/scripts/pull.scm (build-and-install): Check whether (which
"guix") matches PROFILE or its user-friendly variant.
2019-01-28 23:13:40 +01:00
Ludovic Courtès 3a8c4860fb
channels: Turn off deprecation warnings when loading 'build-self.scm'.
* guix/channels.scm (build-from-source): Parameterize
DEPRECATION-WARNING-PORT when loading SCRIPT.
2019-01-28 23:13:40 +01:00
Ludovic Courtès 7d2be1277b
packages: 'package-input-rewriting' can take a promise.
* guix/packages.scm (package-input-rewriting): Allow REPLACEMENTS to be
a promise.
* gnu/packages/guile.scm (package-for-guile-2.0): Delay the first
argument to 'package-input-rewriting'.
2019-01-28 15:45:48 +01:00
Ludovic Courtès e4ee842026
download: Ask not to use TLS 1.3.
Works around <https://bugs.gnu.org/34102>.
Reported by Marius Bakke <mbakke@fastmail.com>.

* guix/build/download.scm (tls-wrap): Add "-VERS-TLS1.3" to the priority
string when (gnutls-version) is not prefixed by "3.5".
2019-01-26 23:18:14 +01:00
Ludovic Courtès bd414e273c
weather: Add '--coverage'.
* guix/scripts/weather.scm (show-help, %options): Add '--coverage'.
(package-partition-boundary, package->output-mapping)
(substitute-oracle, report-package-coverage-per-system)
(report-package-coverage): New procedures.
(guix-weather): Honor '--coverage'.
* doc/guix.texi (Invoking guix weather): Document it.
2019-01-25 14:06:37 +01:00
Ludovic Courtès af77219e8a
refresh: Better account for private and generated packages.
Until now, private and generated packages (e.g., those created by
'texlive-union') we missing from the list passed to 'node-back-edges',
which would lead to inaccurate dependent counts.

Previously we'd get:

  $ guix refresh -l texlive-fonts-cm
  Building the following 80 packages would ensure 116 dependent packages
  are rebuilt: …

Now we have:

  $ Building the following 240 packages would ensure 597 dependent
  packages are rebuilt: …

* guix/scripts/refresh.scm (list-dependents): Call 'package-closure'.
2019-01-25 14:06:37 +01:00
Ludovic Courtès 4d6ce0f12c
refresh: Fix format string that would lead '-l' to print incorrect numbers.
The skip "~*" argument was misplaced, leading the number of dependents
to be skipped (instead of the number of covering packages.)  Thus, we'd
get:

  $ guix refresh -l ocaml4.02-ppx-deriving@4.1
  Building the following package would ensure 1 dependent packages are rebuilt: bap@1.3.0

instead of:

  Building the following package would ensure 26 dependent packages are rebuilt: bap@1.3.0

* guix/scripts/refresh.scm (list-dependents): Move "~*" in the right
place, to skip (length covering) rather than (length dependents).
2019-01-25 14:06:37 +01:00
Ludovic Courtès 731c1a20bc
weather: Ignore deprecated packages but not hidden packages.
* guix/scripts/weather.scm (all-packages): Pass #:select? to
'fold-packages'.
2019-01-25 14:06:37 +01:00
Ludovic Courtès 3e223a22a7
packages: Add 'package-closure'.
* guix/packages.scm (package-closure): New procedure.
* tests/packages.scm ("package-closure"): New test.
2019-01-25 14:06:37 +01:00
Ludovic Courtès bbb2bd50dc
records: Make 'report-duplicate-field-specifier' available at expansion-time.
Fixes a regression in 'guix pack -R' introduced with commit
c2dcff41c2.  The imported modules of
'c-compiler' would be compiled in this order: first (guix records),
then (guix search-paths).  Consequently,
'report-duplicate-field-specifier' would be reported as unbound while
compiling (guix search-paths), leading to a build failure.

* guix/records.scm (report-invalid-field-specifier)
(report-duplicate-field-specifier): Move within 'eval-expand'.
2019-01-24 20:48:14 +01:00
Ludovic Courtès 2c5ee9bba4
tests: Remove duplicate field initializers.
Fixes a regression introduced in
c2dcff41c2, whereby many tests in
'tests/packages.scm' would trigger a syntax error due to duplicate field
intializers in forms like:

  (dummy-package "foo" (version "0"))

* guix/tests.scm (dummy-package, dummy-origin): Rewrite to inherit from
a base record.  This restores the semantics from before
c2dcff41c2.
* tests/services.scm ("instantiate-missing-services, indirect"): Remove
duplicate 'extensions' field.
2019-01-24 20:47:21 +01:00
Ricardo Wurmus da94575858
licenses: Add lppl1.1+.
* guix/licenses.scm (lppl1.1+): New variable.
2019-01-24 13:46:39 +01:00
Ludovic Courtès e6b065b299
ui: Don't report "build failed:" for daemon error messages.
Until now we'd get things like:

  guix build: error: build failed: build of `/gnu/store/….drv' failed

or:

  $ guix gc -d /sdf
  guix gc: error: build failed: path `/sdf' is not in the store

which is kinda ridiculous.

* guix/ui.scm (call-with-error-handling): Remove "build failed:" prefix
for 'store-protocol-error?'.
2019-01-23 23:35:12 +01:00
Ludovic Courtès ba5e89be8c
deduplication: Ignore EMLINK.
Until now 'guix offload' would fail (transient failure) upon EMLINK.

* guix/store/deduplication.scm (replace-with-link)
(deduplicate): Ignore EMLINK.
2019-01-23 23:35:12 +01:00
Ludovic Courtès 5f2daffe09
self: System tests depend on CLI modules.
This is because (gnu tests docker) depends on (guix scripts pack).

* guix/self.scm (compiled-guix)[*system-test-modules*]: Add dependency
on *CLI-MODULES*.
2019-01-22 23:04:05 +01:00
Ludovic Courtès 02ec889e6b
offload: 'status' reports the time difference.
* guix/scripts/offload.scm (check-machine-status): Report the time
difference for each MACHINE.
2019-01-22 23:04:05 +01:00
Ludovic Courtès c2dcff41c2
records: Detect duplicate field initializers.
* guix/records.scm (report-duplicate-field-specifier): New procedure.
(make-syntactic-constructor): Call it.
* tests/records.scm ("define-record-type* & duplicate initializers"):
New test.

Co-authored-by: Mark H Weaver <mhw@netris.org>
2019-01-22 23:04:05 +01:00
Ludovic Courtès c498aaaf11
compile: Let compiler warnings through during the load phase.
Previous warnings and errors such as those raised by (guix records)
would not be displayed during the load phase.

* guix/build/compile.scm (load-files): Remove 'parameterize' around
'resolve-interface' call.
(compile-files)[build]: Move 'with-fluids' for *CURRENT-WARNING-PREFIX*
to...
<top level>: ... here.
2019-01-22 23:04:05 +01:00
Ludovic Courtès 567f0d2590
self: Remove leftover export.
* guix/self.scm: Remove 'reload-guix' export.
2019-01-22 23:04:05 +01:00
Ludovic Courtès f9e8a12379
store: Rename '&nix-error' to '&store-error'.
* guix/store.scm (&nix-error): Rename to...
(&store-error): ... this, and adjust users.
(&nix-connection-error): Rename to...
(&store-connection-error): ... this, and adjust users.
(&nix-protocol-error): Rename to...
(&store-protocol-error): ... this, adjust users.
(&nix-error, &nix-connection-error, &nix-protocol-error): Define these
condition types and their getters as deprecrated aliases.
* build-aux/run-system-tests.scm, guix/derivations.scm,
guix/grafts.scm, guix/scripts/challenge.scm,
guix/scripts/graph.scm, guix/scripts/lint.scm,
guix/scripts/offload.scm, guix/serialization.scm,
guix/ssh.scm, guix/tests.scm, guix/ui.scm,
tests/derivations.scm, tests/gexp.scm, tests/guix-daemon.sh,
tests/packages.scm, tests/store.scm, doc/guix.texi: Adjust to use the
new names.
2019-01-21 23:09:55 +01:00
Ludovic Courtès de9fbe9cdc
store: Rename <nix-server> to <store-connection>.
* guix/store.scm (<nix-server>): Rename to...
(<store-connection>): ... this.  Adjust users accordingly.
(nix-server?, nix-server-major-version)
(nix-server-minor-version, nix-server-socket)
(nix-server-version): Define as deprecated aliases.
* guix/inferior.scm: Adjust accordingly.
* guix/ssh.scm: Likewise.
2019-01-21 23:09:55 +01:00
Ludovic Courtès 3a0b2c6c6e
deprecation: Send warnings to (current-error-port) by default.
* guix/deprecation.scm (deprecation-warning-port): Default
to (current-error-port).
2019-01-21 23:09:55 +01:00
Ludovic Courtès 1b7dd99738
deprecation: Add 'define-deprecated/alias'.
* guix/deprecation.scm (define-deprecated/alias): New macro.
2019-01-21 23:09:55 +01:00
Arun Isaac cb5fe915d2
import: github: Improve readability.
* guix/import/github.scm (latest-released-version): Use any and cond instead
of a recursive loop and an if-else ladder respectively.
2019-01-21 17:59:15 +05:30
Arun Isaac 6b7ea49bed
import: github: Use prereleases when package has no releases.
* guix/import/github.scm (latest-released-version): Use preleases when package
has no releases.
2019-01-21 17:59:15 +05:30
Ludovic Courtès c49b45c917
pull: Add missing import.
Fixes <https://bugs.gnu.org/34136>.
Reported by Pierre Neidhardt <mail@ambrevar.xyz>.

Fixes wrong-type-arg crash of "guix pull -p /does-not-exist -l".

* guix/scripts/pull.scm: Use (srfi srfi-34).
2019-01-20 23:54:54 +01:00
Ludovic Courtès 54800977d9
self: Build the (gnu tests …) modules.
* guix/self.scm (compiled-guix)[*system-modules*]: Remove gnu/tests/*
from #:extra-files.
[*system-test-modules*]: New variable.
[build-modules]: Add them.
2019-01-20 23:54:54 +01:00
Arun Isaac 2034a231dc
import: github: Check if git URIs are GitHub URIs.
This fixes a regression introduced in 9a5091d0c1
whereby packages with git origin URIs not hosted on GitHub would be wrongly
detected as being covered under the github updater.
Reported by Efraim Flashner <efraim@flashner.co.il>.

* guix/import/github.scm (updated-github-url): Check if git URIs are GitHub
URIs.
2019-01-21 01:17:52 +05:30
Ludovic Courtès f58f676b12
channels: Use 'fold2'.
* guix/channels.scm (latest-channel-instances): Use 'fold2' instead of
'fold'.
2019-01-20 18:45:40 +01:00
Ludovic Courtès ab6025b52c
channels: Gracefully report the lack of a 'guix' channel.
* guix/channels.scm (channel-instance-derivations): Raise an '&message'
condition when CORE-INSTANCE is #f.
2019-01-20 18:11:11 +01:00
Ludovic Courtès acefa7408b
channels: Build channel modules in an inferior.
This ensures that channel modules are compiled with the right Guile,
that they get to see the right modules, and so on.  IOW, it avoids bugs
such as those addressed by commits
3c0e16391e and
cb341c1219.

* guix/channels.scm (standard-module-derivation): Add 'core'
parameter.  Rewrite in terms of 'gexp->derivation-in-inferior'.
(build-from-source): Add #:core parameter and pass it to
'standard-module-derivation'.
(build-channel-instance): Add 'core' parameter and pass it on.
(channel-instance-derivations)[dependencies]: Remove.
Adjust 'build-channel-instance' call.
2019-01-20 17:57:14 +01:00
Ludovic Courtès 1fafc383b1
inferior: 'gexp->derivation-in-inferior' honors EXP's load path.
Previously the imported modules and extensions of EXP would be missing
from the load path of 'guix repl'.

* guix/inferior.scm (gexp->derivation-in-inferior)[script]: New
variable.
[trampoline]: Write (primitive-load #$script) to PIPE.  Add #$output.
* tests/channels.scm ("channel-instances->manifest")[depends?]: Check
for requisites rather than direct references.
Adjust callers accordingly.
2019-01-20 17:57:14 +01:00
Ludovic Courtès ed75bdf35c
channels: Don't pull from the same channel more than once.
Previous 'channel-instance->manifest' would call
'latest-channel-derivation', which could trigger another round of
'latest-repository-commit' for no good reason.

* guix/channels.scm (resolve-dependencies): New procedure.
(channel-instance-derivations)[edges]: New variable.
[instance->derivation]: New procedure.
* tests/channels.scm (make-instance): Use 'checkout->channel-instance'
instead of 'channel-instance'.
("channel-instances->manifest"): New test.
2019-01-20 17:57:14 +01:00
Efraim Flashner 4e1f9a2f2c
lint: check-source-unstable-tarball: Don't assume uri length.
* guix/scripts/lint.scm (check-source-unstable-tarball): Replace third
with code to make sure there are enough elements to check.
2019-01-20 11:43:28 +02:00
Ludovic Courtès 38b77f3464
profiles: Allow a profile to be added as an entry of another profile.
* guix/build/profiles.scm (build-etc/profile): When 'OUTPUT/etc/profile'
already exists, delete it first.
(build-profile): Likewise for 'OUTPUT/manifest'.
* tests/profiles.scm ("profile in profile"): New test.
2019-01-20 01:42:11 +01:00
Ludovic Courtès 8bb62ae10c
self: Add gnu/tests/* to the installed files.
* guix/self.scm (compiled-guix)[*system-modules*]: Add gnu/tests/*.
2019-01-19 01:26:34 +01:00
Ludovic Courtès 3bbd6919bd
pull: Suggest running 'hash guix' if needed.
Fixes <https://bugs.gnu.org/33647>.
Suggested by Diego Nicola Barbato <dnbarbato@posteo.de>.

* guix/scripts/pull.scm (build-and-install): Before returning, display a
hint if (which "guix") is not in PROFILE.
2019-01-18 17:51:34 +01:00
Ludovic Courtès 9fe3f11398
serialization: 'restore-file' errors out upon non-convertible file names.
Fixes <https://bugs.gnu.org/33603>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* guix/serialization.scm (port-conversion-strategy): New variable.
(restore-file): Parameterize it.
* tests/nar.scm ("restore-file with non-UTF8 locale"): New test.
2019-01-18 17:51:34 +01:00
Christopher Baines cf22e99f02
guix: Add guard to texlive-configuration profile hook.
It is possible to generate a profile where this hook will crash, as the
texmf.cnf file does not exist to be patched by substitute*. A simple example
is the profile just containing texlive-fonts-txfonts.

* guix/profiles.scm (texlive-configuration): Check that the texmf.cnf file
exists before trying to change it.
2019-01-18 16:15:33 +00:00
Ricardo Wurmus 8e9ca3ea2c
scripts: Fix typo.
* guix/scripts/download.scm (show-help): Fix typo.
2019-01-17 17:58:35 +01:00
Ludovic Courtès 077589459c
syscalls: 'device-in-use?' returns #f upon EINVAL.
This mirrors the behavior of the 'fdisk_device_is_used' function of
util-linux.

* guix/build/syscalls.scm (device-in-use?): Return #f upon EINVAL.
2019-01-17 14:04:28 +01:00
Ludovic Courtès a1f5dfc202
syscalls: 'device-in-use?' does not create a port.
* guix/build/syscalls.scm (device-in-use?): Use 'open-fdes' rather than
'open-file'.
2019-01-17 14:04:27 +01:00
Mathieu Othacehe b08bea0497
build: syscalls: Add device-in-use?.
This new procedure uses BLKRRPART to determine whether or not a device is
busy. It is useful when a device does not appear as mounted but is maybe used
by the kernel. This is the case with overlayfs lowerdir backend device for
example.

* guix/build/syscalls.scm (device-in-use?): New exported procedure.
2019-01-17 14:04:22 +01:00
Mathieu Othacehe a49d633c0c
installer: Move everything to the build side.
* gnu/installer.scm: Rename to ...
* gnu/installer/record.scm: ... this.
* gnu/installer/build-installer.scm: Move everything to the build side and
rename to gnu/installer.scm.
* gnu/installer/newt.scm: Remove all the gexps and add depencies to newt
modules as this code will only be used on the build side by now.
* gnu/local.mk (GNU_SYSTEM_MODULES): Adapt it,
(dist_installer_DATA): New rule to install installer's aux-files.
* gnu/system/install.scm (%installation-services): Use only
'installer-program' from (gnu installer). The installer is now choosen on the
build side.
* guix/self.scm (*system-modules*): Restore previous behaviour and add all
installer files to #:extra-files field of the scheme-node.
* po/guix/POTFILES.in: Adapt it.
2019-01-17 14:04:21 +01:00
Mathieu Othacehe 16006a05a1
guix: self: Do not install (gnu system install).
As we do not want to add a dependency to newt and the graphical installer
in (guix self), do not install (gnu system install).

* guix/self.scm (*system-modules*): Remove (gnu system install) from
"guix-system" scheme-node.
2019-01-17 14:04:21 +01:00
Arun Isaac 9a5091d0c1
import: github: Do not update URI for packages using git-fetch.
* guix/import/github.scm (updated-github-url): Return the unchanged source URI
for packages using git-fetch.
[updated-url]: Do not handle URIs which end with ".git".
2019-01-16 20:49:14 +05:30
Ludovic Courtès b9da4b931d
status: Distinguish 'package-cache' profile hook.
* guix/status.scm (hook-message): Handle 'package-cache'.
2019-01-15 20:24:09 +01:00
Ludovic Courtès 0ea939fb79
guix package: '--list-available' can use data from the cache.
* gnu/packages.scm (fold-available-packages): New procedure.
* guix/scripts/package.scm (process-query): Use it instead of
'fold-packages'.
* tests/packages.scm ("fold-available-packages with/without cache"):
New test.
2019-01-15 20:24:09 +01:00
Ludovic Courtès ee8099f5b6
edit: Use 'specification->location' to read information from the cache.
That way 'guix edit' doesn't need to load any package module.

* gnu/packages.scm (find-package-locations, specification->location):
New procedures.
* guix/scripts/edit.scm (package->location-specification): Rename to...
(location->location-specification): ... this.  Expect a location object
instead of a package.
(guix-edit): Use 'specification->location' instead of
'specification->package'.
* tests/packages.scm ("find-package-locations")
("find-package-locations with cache")
("specification->location"): New tests.
2019-01-15 20:24:09 +01:00
Ludovic Courtès 5fbdc9a5aa
channels: Compute a package cache and use it.
* gnu/packages.scm (cache-is-authoritative?, load-package-cache)
(cache-lookup, generate-package-cache): New procedures.
(%package-cache-file): New variable.
(find-packages-by-name): Rename to...
(find-packages-by-name/direct): ... this.
(find-packages-by-name): Rewrite to use the package cache when
'cache-is-authoritative?' returns true.
* tests/packages.scm ("find-packages-by-name + version, with cache")
("find-packages-by-name with cache"): New tests.
* guix/channels.scm (package-cache-file): New procedure.
(%channel-profile-hooks): New variable.
(channel-instances->derivation): Use it in #:hooks.
* guix/scripts/package.scm (build-and-use-profile): Add #:hooks and
honor it.
* guix/scripts/pull.scm (build-and-install): Pass #:hooks to
UPDATE-PROFILE.
2019-01-15 20:24:09 +01:00
Ludovic Courtès 1d90e9d7c9
discovery: Add 'fold-module-public-variables*'.
* guix/discovery.scm (fold-module-public-variables*): New procedure.
2019-01-15 20:24:09 +01:00
Ludovic Courtès ae92782240
inferior: Add 'gexp->derivation-in-inferior'.
* guix/inferior.scm (gexp->derivation-in-inferior): New procedure.
2019-01-15 20:24:09 +01:00
Ludovic Courtès 465a0d65ae
guix package: Avoid 'find-newest-available-packages'.
* guix/scripts/package.scm (transaction-upgrade-entry): Use
'find-best-packages-by-name' instead of
'find-newest-available-packages'.
* tests/packages.scm ("transaction-upgrade-entry, zero upgrades")
("transaction-upgrade-entry, one upgrade")
("transaction-upgrade-entry, superseded package"): Adjust accordingly.
2019-01-15 20:24:09 +01:00