Commit Graph

3864 Commits

Author SHA1 Message Date
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
Ludovic Courtès
461d6c2eff
profiling: Add a "gc" profiling component.
* guix/profiling.scm (show-gc-stats): New procedure.
<top level>: Call 'register-profiling-hook!'.
2019-01-15 20:24:08 +01:00
Ricardo Wurmus
b96909c5c1
guix: scons: Fix module reference.
* guix/build-system/scons.scm (default-scons): Find "scons" package in
(gnu packages python-xyz) instead of (gnu packages python).
2019-01-15 18:15:07 +01:00
Ricardo Wurmus
743497b565
guix: Add profile hook to build TeX live configuration.
* guix/profiles.scm (texlive-configuration): New procedure.
(%default-profile-hooks): Add it.
* guix/status.scm (hook-message): Handle "texlive-configuration" hook type.
2019-01-15 13:05:22 +01:00
Ludovic Courtès
0c1bc5ecbe
status: Spin only on TTYs.
* guix/status.scm (isatty?*): New procedure.
(spin!): Do nothing when port matches ISATTY?*.
(color-output?): Use ISATTY?*.
2019-01-15 12:05:25 +01:00
Ludovic Courtès
35225dc579
guix package: '--upgrade' preserves package order.
Fixes <https://bugs.gnu.org/31142>.
Reported by Chris Marusich <cmmarusich@gmail.com>.

* guix/scripts/package.scm (options->installable)[upgraded]: Use 'fold'
instead of 'fold-right'.  This reverts
eca16a3d1d.
* tests/guix-package-net.sh: Add 'guix package u' test.
2019-01-15 12:05:25 +01:00
Ludovic Courtès
0ee1e47edb
copy: Add '--verbosity'.
This fixes a regression introduced in
f1de676ea8 since %DEFAULT-OPTIONS was
missing the 'debug key that 'set-build-options-from-command-line'
expects.

* guix/scripts/copy.scm (show-help, %options): Add '--verbosity'.
(%default-options): Rename 'verbosity' to 'debug'.  Add
'print-build-trace?', 'print-extended-build-trace?',
'multiplexed-build-output?', and 'verbosity'.
(guix-copy): Wrap body in 'with-status-verbosity'.
2019-01-14 23:43:49 +01:00
Ludovic Courtès
60029204ee
pull: Don't prepend "origin/" to branch names.
This is a followup to 37a6cdbf1b.

* guix/scripts/pull.scm (%options): Don't prepend "origin/" to branch
names.
2019-01-14 23:43:49 +01:00
Ricardo Wurmus
91e05559bd
import: cran: Suggest input changes.
* guix/import/cran.scm (latest-cran-release, latest-bioconductor-release):
Return input-changes.
2019-01-12 23:35:11 +01:00
Ricardo Wurmus
7e634c2f53
refresh: Suggest input changes when updating.
* guix/upstream.scm (<upstream-source>)[input-changes]: New field.
(<upstream-input-change>): New record.
(upstream-input-change?, upstream-input-change-name,
upstream-input-change-type, upstream-input-change-action, changed-inputs): New
procedures.
(package-update): Pass along input changes.
* guix/script/refresh.scm (update-package): Process input changes.
2019-01-12 23:35:11 +01:00
Ludovic Courtès
f1de676ea8
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for.  The new option provides a consistent way to choose
whether or not to display the build log.

* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
 #:verbosity.
(%standard-build-options): Change "verbosity" to "debug".  Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.  Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-11 12:14:38 +01:00
Ludovic Courtès
7804c45b9c
status: Add 'with-status-verbosity'.
* guix/status.scm (logger-for-level, call-with-status-verbosity): New
procedures.
(with-status-verbosity): New macro.
* guix/scripts/environment.scm (guix-environment): Use
'with-status-verbosity' instead of 'with-status-report'.
* guix/scripts/pack.scm (guix-pack): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* build-aux/run-system-tests.scm (run-system-tests): Likewise.
2019-01-11 12:14:38 +01:00
Ludovic Courtès
7489207ff7
refresh: Turn on warnings when '--manifest' is used.
* guix/scripts/refresh.scm (guix-refresh): Set WARN? when '-m' is used.
2019-01-11 12:14:38 +01:00
Ludovic Courtès
fca43e14f7
refresh: Refactor option handling and '--recursive'.
This allows us to combine '--recursive' with other options (-u, -m,
etc.), turns off warnings when '--recursive' is used, and avoids the
hazards of I/O in the presence of multithreading.

* guix/scripts/refresh.scm (options->packages): New procedure, with code
formerly in 'guix-refresh'.
(refresh-recursive): Remove.
(guix-refresh)[keep-newest, core-package?, args-packages, packages]:
Remove.
[warn?]: Set to #f when RECURSIVE? is true.
Call 'options->packages' in monadic context.
2019-01-11 12:14:38 +01:00
Ricardo Wurmus
bf6fb59a33
build-system: texlive: Do not hide build output.
* guix/build/texlive-build-system.scm (compile-with-latex): Use "nonstopmode"
instead of "batchmode".
2019-01-10 22:43:09 +01:00
Ricardo Wurmus
ac5c9f6ba6
build-system: texlive: Do not truncate lines.
* guix/build/texlive-build-system.scm (configure): Set environment variables
to prevent build output lines from being truncated.
2019-01-10 22:43:09 +01:00
Ricardo Wurmus
d4d9a1ece0
gnu: Update texlive packages.
* guix/build-system/texlive.scm (%texlive-tag, %texlive-revision): Update to
texlive-2018.2, revision 49435.
* gnu/packages/tex.scm (texlive-dvips, texlive-generic-unicode-data,
texlive-generic-dehyph-exptl, texlive-generic-hyph-utf8, texlive-fontname,
texlive-fonts-cm, texlive-tex-plain, texlive-latex-base,
texlive-latex-graphics, texlive-latex-graphics, texlive-latex-oberdiek,
texlive-latex-tools, texlive-latex-l3kernel, texlive-latex-l3packages,
texlive-latex-fontspec, texlive-latex-amsmath, texlive-latex-amscls,
texlive-latex-babel, texlive-latex-cyrillic, texlive-latex-eqparbox,
texlive-latex-ifplatform, texlive-latex-etoolbox, texlive-latex-galois,
texlive-latex-polyglossia, texlive-tex-texinfo, texlive-latex-changebar,
texlive-latex-fancyhdr, texlive-latex-overpic, texlive-latex-parskip,
texlive-metapost, texlive-latex-ucs, texlive-generic-pdftex,
texlive-latex-media9, texlive-latex-ocgx2, texlive-latex-koma-script,
texlive-generic-listofitems, texlive-bibtex, texlive-context-base): Update
hashes.
(texlive-latex-fontspec)[arguments]: Remove custom build target.
(texlive-latex-dinbrief)[arguments]: Add build phase "fix-encoding-error".
(texlive-latex-xkeyval): New variable.
(texlive-latex-pstool)[source]: Fetch from new location.
[build-system]: Use trivial-build-system.
[arguments]: Write simple builder.
[propagated-inputs]: Add texlive-latex-l3kernel, texlive-latex-tools, and
texlive-latex-xkeyval.
[synopsis]: Fix typo.
2019-01-10 22:43:09 +01:00
Ludovic Courtès
787da810a0
Add (guix deprecation).
* guix/deprecation.scm: New file.
* Makefile.am (MODULES): Add it.
* po/guix/POTFILES.in: Add it.
2019-01-10 14:59:22 +01:00
Arun Isaac
40fa21c22e
guix: lint: Warn only if GitHub URI is not same as the package URI.
* guix/scripts/lint.scm (check-github-url): Warn only if the GitHub URI
obtained after following redirects is not same as the original URI.
* tests/lint.scm ("github-url: already the correct github url"): New test.
2019-01-10 15:39:35 +05:30
Ludovic Courtès
804b9b18ac
build-system/asdf: 'package-with-build-system' accesses inputs lazily.
Fixes a bug whereby we would, at the top-level (while evaluation
lisp.scm package definitions), attempt to access package inputs.
Because of circular dependencies, this could lead to unbound variables
as reported by Arun Isaac <arunisaac@systemreboot.net> at
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33801#56>.

* guix/build-system/asdf.scm (package-with-build-system)[transform]
(new-propagated-inputs): Turn into a procedure.
Adjust user accordingly.
2019-01-09 15:01:40 +01:00
Ludovic Courtès
6e54e488c6
self: Drop support for Guix < 0.15 on Guile 2.0.
* guix/self.scm (false-if-wrong-guile, package-for-guile): Remove.
(specification->package): Remove "guile2.0-" variants.
(compiled-guix): #:guile-for-build defaults to (default-guile).
Use 'specification->package' instead of 'package-for-guile'.
(guile-for-build): Remove.
(guix-derivation): Use 'default-guile' instead of 'guile-for-build'.
Check whether we're running on Guile 2.0 with PULL-VERSION < 1.
2019-01-09 14:47:53 +01:00
Ludovic Courtès
76832d3420
Remove most uses of the _IO*F constants.
These constants, for use with 'setvbuf', were deprecated in Guile 2.2
and disappeared in Guile 3.0.  Here we keep these constants in
build-side code where removing them is not feasible.

* guix/build/download-nar.scm (download-nar): Adjust 'setvbuf' calls to
the Guile 2.2+ API.
* guix/build/download.scm (open-socket-for-uri): Likewise.
(open-connection-for-uri, url-fetch): Likewise.
* guix/build/make-bootstrap.scm (make-stripped-libc): Likewise.
* guix/build/union.scm (setvbuf) [guile-2.0]: New conditional wrapper.
(union-build): Adjust to new API.
* guix/ftp-client.scm (ftp-open, ftp-list, ftp-retr): Likewise.
* guix/http-client.scm (http-fetch): Likewise.
* guix/inferior.scm (proxy): Likewise.
* guix/scripts/substitute.scm (fetch, http-multiple-get): Likewise.
* guix/self.scm (compiled-modules): Likewise.
* guix/ssh.scm (remote-daemon-channel, store-import-channel)
(store-export-channel): Likewise.
* guix/ui.scm (initialize-guix): Likewise.
* tests/publish.scm (http-get-port): Likewise.
* guix/store.scm (%newlines): Adjust comment.
2019-01-09 14:47:53 +01:00
Ludovic Courtès
c3d9bca48a
download: Remove Guile 2.0 workaround.
* guix/build/download.scm: Remove Guile 2.0 workaround.
2019-01-09 14:47:53 +01:00
Ludovic Courtès
a65177a657
maint: Remove 'cond-expand' forms for Guile 2.0.
Note: Leave 'cond-expand' forms used in the build-side modules that can
run on %BOOTSTRAP-GUILE, which is currently Guile 2.0.

* guix/build/compile.scm: Move 'use-modules' clause from 'cond-expand'
to 'define-module' form.
(%default-optimizations): Remove 'cond-expand'.
* guix/build/download.scm (tls-wrap): Remove 'cond-expand'.
* guix/build/syscalls.scm: Remove 'cond-expand' form around
'%set-automatic-finalization-enabled?!' and
'without-automatic-finalization'.
* guix/inferior.scm (port->inferior): Remove 'cond-expand'.
* guix/scripts/pack.scm (wrapped-package)[build]: Remove 'cond-expand'.
* guix/status.scm (build-event-output-port): Remove 'cond-expand'.
* guix/store.scm (open-inet-socket): Remove 'cond-expand'.
* guix/ui.scm (install-locale): Remove 'cond-expand'.
* tests/status.scm ("current-build-output-port, UTF-8 + garbage"):
Remove 'cond-expand'.
* tests/store.scm ("current-build-output-port, UTF-8 + garbage"):
Remove 'cond-expand'.
2019-01-09 14:47:53 +01:00
Ludovic Courtès
a21a906fcd
pull: Document '--system'.
Fixes <https://bugs.gnu.org/34010>.
Reported by Alex Kost <alezost@gmail.com>.

This is a followup to 5923102f7b.

* guix/scripts/pull.scm (show-help): Add '--system'.
2019-01-08 18:38:15 +01:00
Ludovic Courtès
08fdee3911
self: Compress Info files.
Fixes <https://bugs.gnu.org/33993>.
Reported by Adonay Felipe Nogueira <adfeno@hyperbola.info>.

* guix/self.scm (info-manual): Compress Info files.
2019-01-08 18:38:15 +01:00
Ludovic Courtès
efff32452a
gexp: 'gexp->script' does not emit load-path expression when unnecessary.
This removes two elements from %LOAD-PATH and %LOAD-COMPILED-PATH of the
'guix' command and thus further reduces the number of 'stat' calls it
makes.

* guix/gexp.scm (load-path-expression): Return #f when MODULES and
EXTENSIONS are both empty.
(gexp->script): Don't emit anything when SET-LOAD-PATH is #f.
2019-01-07 23:50:56 +01:00
Ludovic Courtès
49c35bbb71
self: Move all modules into a single directory.
This halves the number of elements in %LOAD-PATH and %LOAD-COMPILED-PATH
and halves the number of 'stat' calls as reported by:

  env -i $(type -P guix) build -e '(@ (gnu packages base) coreutils)' -nd

* guix/self.scm (node-source+compiled, guile-module-union): New
procedures.
(guix-command): Remove 'compiled-modules' parameter.  Remove
'source-directories' and 'object-directories' variables and add
'module-directory'.  Change command so that it adds nothing but
MODULE-DIRECTORY to %LOAD-PATH and %LOAD-COMPILED-PATH.
(whole-package): Remove #:compiled-modules.  Assume MODULES contains
'share/guile/site' and 'lib/guile' and adjust code accordingly.
(compiled-guix): When PULL-VERSION is 1, use 'node-source+compiled'
only.  Remove #:compiled-modules argument to 'whole-package'.
* guix/channels.scm (whole-package-for-legacy): Add 'module+compiled'
and pass it to 'whole-package'.
2019-01-07 23:50:56 +01:00
Julien Lepiller
f31ce9ecf1
import: opam: Parse comments.
* guix/import/opam.scm: Add comment support in parser.
2019-01-07 22:05:51 +01:00
Julien Lepiller
755e6d4a0a
import: opam: Add updater.
* guix/import/opam.scm (%opam-updater): New variable.
2019-01-07 22:05:45 +01:00
Julien Lepiller
6090b0beb0
import: opam: Add recursive option.
* guix/script/import/opam.scm: Add recursive option.
* guix/import/opam.scm (opam->guix-package): return two values.
(opam-recursive-import): New variable.
2019-01-07 22:05:43 +01:00
Ludovic Courtès
54ddb6a154
lint: Avoid 'dirname' call at the top level.
* guix/scripts/lint.scm (%distro-directory): Wrap in 'mlambda'.
(check-patch-file-names): Adjust accordingly.
2019-01-07 14:41:00 +01:00
Ludovic Courtès
46cf4cd676
Remove (guix build pull).
This module had been unused since commit
5f93d97005 (Oct. 2017).

* guix/build/pull.scm: Delete.
* Makefile.am (MODULES): Remove.
2019-01-07 14:40:59 +01:00