Commit Graph

3895 Commits

Author SHA1 Message Date
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
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