Commit Graph

3212 Commits

Author SHA1 Message Date
Ludovic Courtès 16de45557f
ui: 'display-hint' preserves Texinfo formatting.
The previous method would mess up with @example formatting, for
instance.

* guix/ui.scm (display-hint): Parameterize '%text-width' instead of
using 'fill-paragraph'.
2018-03-07 11:22:42 +01:00
Ludovic Courtès e1ba6d49ea
ui: Display fix hints in the case where we have location info.
* guix/ui.scm (call-with-error-handling): Display fix-hints in the
error + message case.
2018-03-07 11:22:42 +01:00
Ludovic Courtès ca23693d28
linux-initrd: Factorize 'check-device-initrd-modules'.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Move to...
* gnu/system/linux-initrd.scm (check-device-initrd-modules): ... here.
New procedure.
* po/guix/POTFILES.in: Add it.
* guix/scripts/system.scm (check-initrd-modules)[check-device]: Remove.
Use 'check-device-initrd-modules' instead.
2018-03-07 11:22:42 +01:00
Ludovic Courtès 7949c140b1
ui: 'load*' no longer fails on Guile 2.2.3 upon EACCES or similar.
Previously, if ~/.cache was not write-accessible, 'guix' would exit with
code 1 without printing any message.  That was because the 'make-stack'
call would fail since the exception (a 'system-error) came from
'compile-file', which was called at a point where TAG wasn't installed
yet.  Secondly, to mimick auto-compilation behavior, we just swallow
'system-error raised by 'compile-file'.

Reported by Clément Lassieur.

* guix/ui.scm (load*): Move 'compile-file' call in the dynamic extent of
TAG.  Catch 'system-error around it and ignore it.
2018-03-06 10:50:39 +01:00
Ludovic Courtès f44c7aaccd
ui: Better workaround for lack of '%fresh-auto-compile' on 2.2.3.
Fixes <https://bugs.gnu.org/29226> for the most part.

* guix/ui.scm (load*): Add call to 'compile-file' on 2.2.3.
2018-03-05 10:54:45 +01:00
Danny Milosavljevic 329dabe13b
git-download: Fetch only the required commit, if possible.
* guix/build/git.scm (git-fetch): Fetch only the required commit, if possible.
2018-03-04 14:43:38 +01:00
Clément Lassieur bdcf0e6fd4
services: messaging: Prosody config supports file-like objects.
* doc/guix.texi (Messaging Services): Update accordingly.
* gnu/services/configuration.scm (serialize-configuration,
serialize-maybe-stem, serialize-package): Return strings or string-valued
gexps (these procedures were only used for their side-effects).
* gnu/services/messaging.scm (serialize-field, serialize-field-list,
enclose-quotes, serialize-raw-content, serialize-ssl-configuration,
serialize-virtualhost-configuration-list,
serialize-int-component-configuration-list,
serialize-ext-component-configuration-list,
serialize-virtualhost-configuration, serialize-int-component-configuration,
serialize-ext-component-configuration, serialize-prosody-configuration):
Return strings or string-valued gexps and stop printing.
(prosody-activation): Use SERIALIZE-PROSODY-CONFIGURATION's return value with
MIXED-TEXT-FILE instead of using its output with PLAIN-FILE.
(serialize-non-negative-integer, serialize-non-negative-integer-list): Convert
numbers to strings.
(file-object?, serialize-file-object, file-object-list?,
serialize-file-object-list): New procedures.
(ssl-configuration)[capath, cafile], (prosody-configuration)[plugin-paths,
groups-file]: Replace FILE-NAME with FILE-OBJECT.
* guix/gexp.scm (file-like?): New exported procedure.
2018-03-03 18:21:52 +01:00
Ludovic Courtès 424cea8083
guix system: Check for the lack of modules in the initrd.
* guix/scripts/system.scm (check-mapped-devices): Take an OS instead of
a list of <mapped-device>.  Pass #:needed-for-boot? and #:initrd-modules
to CHECK.
(check-initrd-modules): New procedure.
(perform-action): Move 'check-mapped-devices' call first.  Add call to
'check-initrd-modules'.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): New
procedure.
(check-luks-device): Add #:initrd-modules and #:needed-for-boot?.  Use
them to call 'check-device-initrd-modules'.
2018-03-02 13:53:15 +01:00
Ludovic Courtès f14c933df1
Add (guix glob).
* guix/glob.scm, tests/glob.scm: New files.
* Makefile.am (MODULES): Add guix/glob.scm.
(SCM_TESTS): Add tests/glob.scm.
2018-03-02 13:46:25 +01:00
Mike Gerwitz e37944d827
environment: Add --user.
This change allows overriding the home directory of all filesystem mappings to
help hide the identity of the calling user in a container.

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

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

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

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

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-03-02 11:55:42 +01:00
Ludovic Courtès b402f4ee34
import: cpan: Drop "v" prefix from version strings.
Fixes <https://bugs.gnu.org/30641>.
Reported by Oleg Pykhalov <go.wigust@gmail.com>.

* guix/import/cpan.scm (cpan-version): Drop the "v" prefix when it is
there.
2018-03-01 14:54:55 +01:00
Ludovic Courtès 435603a1d6
profiles: 'manifest-add' truly deletes duplicate entries.
Fixes <https://bugs.gnu.org/30569>.
Reported by Andreas Enge <andreas@enge.fr>.

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

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

* guix/import/utils.scm (alist->package): Check whether 'license' is
false and set the 'license' field to #f in this case.
* tests/import-utils.scm ("alist->package with false license"): New
test.
2018-02-16 11:10:12 +01:00
Ludovic Courtès 485d355cad
pack: Adjust '--manifest' documentation.
Reported by Konrad Hinsen <konrad.hinsen@fastmail.net>.

* guix/scripts/pack.scm (show-help): Adjust --manifest documentation.
2018-02-16 00:45:29 +01:00
Oleg Pykhalov 06a9dc2fd0
union: Wrap collisions with newlines.
* guix/build/union.scm (union-build): Wrap collisions with newlines.
2018-02-15 20:51:51 +03:00
Konrad Hinsen 4a979afe1b
pack: Add '--manifest'.
* guix/scripts/pack.scm (%options, show-help): Add --manifest.
(guix-pack)[manifest-from-args]: New procedure.
Use it.
* doc/guix.texi (Invoking guix pack): Document --manifest.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-02-15 15:40:36 +01:00
Mark H Weaver a7fb298665
Merge branch 'master' into core-updates 2018-02-11 04:05:07 -05:00
Björn Höfling 0a574d7bf7
licenses: Add W3C license.
* gnu/license.scm (w3c): New variable.
2018-02-10 19:03:57 +01:00
Ludovic Courtès 8446dc5a36
ssh: Work around 'select' bug in Guile.
Fixes <https://bugs.gnu.org/30365>.

* guix/ssh.scm (remote-daemon-channel)[redirect]: Define 'select*' and
use it.
2018-02-09 11:23:27 +01:00
Mark H Weaver efe2a2833c
Merge branch 'master' into core-updates 2018-02-09 01:46:34 -05:00
Maxim Cournoyer 7c599eac0c
emacs-build-system: Do not patch files containing NULs.
This is a temporary workaround for <https://bugs.gnu.org/30116>, where
'substitute*' throws on files containing NUL characters.

* guix/build/emacs-build-system.scm (patch-el-files): Filter out elisp files
that contain NUL characters.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2018-02-05 16:54:27 +01:00
Maxim Cournoyer 58b6812fd4
emacs-build-system: Reinstate the check phase.
* guix/build/emacs-build-system.scm (%standard-phases): Reinstate the check
phase from the gnu-build-system.
* guix/build-system/emacs.scm (emacs-build)[tests?]: But do not enable it by default.
[parallel-tests?]: Add argument.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-02-05 16:54:27 +01:00
Maxim Cournoyer b7dee6a0b8
emacs-build-system: Add set-emacs-load-path phase.
This generalizes the mechanism by which the Emacs dependencies are made visible,
so that any build phase can make use of them.

* guix/build/emacs-build-system.scm (%legacy-install-suffix): New variable.
(%install-suffix): Redefine in terms of %legacy-install-suffix.
(set-emacs-load-path): Add new phase used for dependency resolution.
(build): Remove ad-hoc dependency discovery mechanism.
(emacs-input->el-directory): Add new procedure.
(emacs-inputs-el-directories): Use it.
(package-name-version->elpa-name-version): Fix typo.
(%standard-phases): Include the new `set-emacs-load-path' phase. Refactor to
make the ordering of the phases clearer.
* guix/build/emacs-utils.scm (emacs-byte-compile-directory): Remove the
optional `dependency-dirs' argument, which is now obsoleted by the
`set-emacs-load-path' phase.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-02-05 16:54:27 +01:00
Marius Bakke bee7bb315c
Merge branch 'master' into core-updates 2018-02-01 13:18:47 +01:00
Maxim Cournoyer 8fbc1a2208
download: Fix return value of the url-fetch procedure.
Fixes <https://bugs.gnu.org/30270>.
Regression was introduced by commit 347fa4aebf.

* guix/build/download.scm (url-fetch): Return `file' instead of #t upon success.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-01-28 23:14:55 +01:00
Mark H Weaver b89d8a4271
Merge branch 'master' into core-updates 2018-01-26 00:15:26 -05:00
Tobias Geerinckx-Rice 980bcecdab
build-system/dub: Fix typo.
* guix/build/dub-build-system.scm (grep, grep*): Correct ‘occurence’.
2018-01-26 00:09:19 +01:00
Mark H Weaver a102d359a6
Merge branch 'master' into core-updates 2018-01-23 17:01:07 -05:00
Ludovic Courtès 33988f9b58
publish: Restore gzip compression in cache-less mode.
Fixes <https://bugs.gnu.org/30184>.
Regression introduced in 297e04d660.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/scripts/publish.scm (nar-response-port): Add 'compression'
parameter and honor it.
(http-write): Get 'x-nar-compression' from the initial RESPONSE.
2018-01-22 11:15:50 +01:00
Ludovic Courtès 33033a620e
services: shepherd: Make 'shepherd-configuration-file' non-monadic.
Suggested by atw on #guix.

* gnu/services/shepherd.scm (shepherd-service-file): Use 'scheme-file'
instead of 'gexp->file'.
(shepherd-configuration-file): Likewise, and adjust to non-monadic
style.
(shepherd-boot-gexp): Adjust accordingly.
* guix/scripts/system.scm (upgrade-shepherd-services): Use
'lower-object' in addition to 'shepherd-service-file'.
2018-01-21 00:24:02 +01:00
Mark H Weaver e074a655dd
Merge branch 'master' into core-updates 2018-01-19 23:59:20 -05:00
Ludovic Courtès 20fe727105
packages: 'package-mapping' maps replacement.
* guix/packages.scm (package-mapping): Apply PROC to 'replacement' as well.
2018-01-20 00:45:29 +01:00
Tobias Geerinckx-Rice 162a137400
gnu: Consistently Write ‘file system(s)’.
It is the GNU way.

* doc/guix.texi (Build Systems, DNS Services): Write ‘file system(s)’.
* gnu/build/vm.scm (create-ext-file-system, create-fat-file-system):
Likewise.
* gnu/packages/backup.scm (dirvish, rsnapshot)[description]: Likewise.
* gnu/packages/check.scm (python-testpath)[description]: Likewise.
* gnu/packages/disk.scm (pydf)[description]: Likewise.
* gnu/packages/file-systems.scm (disorderfs)[synopsis, description]: Likewise.
(glusterfs)[description]: Likewise.
* gnu/packages/haskell.scm (ghc-directory, ghc-system-fileio-bootstrap)
(ghc-system-fileio)[synopsis]: Likewise.
(ghc-fsnotify)[description]: Likewise.
* gnu/packages/linux.scm (proot)[description]: Likewise.
(jmtpfs)[synopsis, description]: Likewise.
* gnu/packages/mate.scm (caja, caja-extensions)[description]: Likewise.
* gnu/packages/storage.scm (ceph)[description]: Likewise.
* gnu/packages/sync.scm (lsyncd)[description]: Likewise.
* gnu/packages/syncthing.scm (syncthing)[synopsis]: Likewise.
(go-github-com-zillode-notify)[description]: Likewise.
* gnu/services/nfs.scm (pipefs-service-type): Likewise.
* guix/scripts/system.scm (perform-action): Likewise.
2018-01-19 17:28:31 +01:00
Ludovic Courtès 8102cf0b37
gnu: commencement: Memoize 'linux-libre-headers-boot0'.
Fixes <https://bugs.gnu.org/30155>.

The effect can be seen in the package graph produced by:

  guix graph -e '(@@ (gnu packages commencement) static-bash-for-glibc)'

This reduces the number of "duplicate" nodes in this graph, i.e.,
distinct package objects that correspond to the same derivation (objects
that are not 'eq?' but semantically equal.)

* gnu/packages/commencement.scm (linux-libre-headers-boot0): Make an
'mlambda' instead of a 'lambda'.
(hurd-core-headers-boot0): Ditto.
2018-01-18 16:14:06 +01:00
Ludovic Courtès 92423868bc
ui: Disable '%fresh-auto-compile' only for Guile 2.2.3.
Mitigates <https://bugs.gnu.org/29881>.
Reported by Diego Nicola Barbato <dnbarbato@posteo.de>.

* guix/ui.scm (load*): Unset '%fresh-auto-compile' only on Guile 2.2.3.
2018-01-15 23:29:33 +01:00
Ludovic Courtès 309121a113
offload: Look at machine loads for the past minute.
Previously we were looking at the load of the past 5 minutes, which
means that, after a build, we could end up waiting for 5 minutes for
that metric to be low enough.

* guix/scripts/offload.scm (machine-load): Compute RAW based on ONE, not
FIVE.
2018-01-15 23:29:33 +01:00
Danny Milosavljevic b640370d82
ruby-build-system: Fix build error.
* gnu/build/ruby-build-system.scm: Import (ice-9 rdelim).

Follow-up to d9df4bf055.
2018-01-15 16:56:03 +01:00
Christopher Baines 2c2ec3d04a
ruby-build-system: Add a new wrap phase.
Wrap files in bin/ and sbin/ with the location of the gem itself and the
location of any other gems in use (GEM_PATH). This ensures that the bin files
will run with the right environment when executed.

It does however mean that native-inputs will also get wrapped up in any
binaries, which is not good, as it increases the size of the closure, and
risks this code being used at runtime.

* guix/build/ruby-build-system.scm (wrap): New procedure.
  (%standard-phases): Add the wrap phase.
2018-01-14 22:16:20 +00:00
Christopher Baines d9df4bf055
ruby-build-system: Add wrap-ruby-program.
A modified copy of wrap-program from (guix build utils). The wrap-program
procedure doesn't work well for Ruby scripts, as it breaks using the -S flag
with ruby to execute the script, as when -S is passed to ruby, it expects the
script on the PATH to use ruby in the shebang, and not bash.

Therefore, to wrap the program, but keep the shebang as ruby, wrap it with a
ruby script instead.

wrap-ruby-program uses .real/foo rather than .foo-real, as this might be
neater. This procedure also includes a call to Gem.clear_paths to make it
possible to set the GEM_PATH through this method, and for it to take effect.

* gnu/build/ruby-build-system.scm (wrap-ruby-program): New procedure.
2018-01-14 22:16:15 +00:00
Christopher Baines 3cb3fa6747
guix: build: ruby-build-system: Install to the vendor directory
* guix/build/ruby-build-system.scm (install): Install gems to the vendor
  directory, rather than the GEM_HOME. The vendor directory does not include
  the version of ruby used to install the gem in the path, which makes it
  easier to add it to the GEM_PATH for all versions of ruby to use.
  (gem-home): Remove procedure.
* gnu/packages/ruby.scm (ruby, ruby-2.1)[native-search-paths]: Switch to
  lib/ruby/vendor_ruby.
  (ruby-1.8)[native-search-paths]: Remove native-search-paths.
  (gem-directory): Remove procedure.
  (ruby-ansi, ruby-ae)[arguments]: Remove use of gem-directory.
  (ruby-metaclass, ruby-instantiator, ruby-introspection, ruby-mocha,
  ruby-nokogiri, ruby-minitest-tu-shim, ruby-redcloth)[arguments]: Remove use
  of gem-home.
  (ruby-git, ruby-httpclient)[arguments]: Remove use of GEM_HOME.
* gnu/packages/databases.scm (es-dump-restore)[arguments]: Remove use of
  GEM_HOME.
2018-01-14 22:16:08 +00:00
Ludovic Courtès 0dcf675c56
ssh: Switch back to 'get-bytevector-some'.
This mostly reverts 17af5d51de.
Suggested by Andy Wingo <wingo@igalia.com>.

* guix/ssh.scm (remote-daemon-channel)[redirect]: Remove 'read!' FFI
hack.  Use buffered ports.
2018-01-12 23:41:15 +01:00
Ludovic Courtès 4eb0f9ae05
offload: 'test' reports Guile and module errors more nicely.
Fixes <https://bugs.gnu.org/26008>.
Reported by Myles English <mylesenglish@gmail.com>.

* guix/ssh.scm (retrieve-files*): Move error reporting to...
(report-guile-error, report-module-error): ... here.  New procedures.
* guix/scripts/offload.scm (assert-node-repl): Use 'report-guile-error'.
(assert-node-has-guix): Explicitly check for 'use-modules' first.  Use
'report-module-error'.
2018-01-12 23:41:15 +01:00
Ludovic Courtès 5a5e34e358
offload: 'test' gracefully handles 'node-repl-error'.
Fixes <https://bugs.gnu.org/28057>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/scripts/offload.scm (assert-node-has-guix): Catch
'node-repl-error' and call 'leave'.
2018-01-12 23:41:15 +01:00
Ludovic Courtès 0e3c8528af
ssh: 'retrieve-files' now only retrieves what's missing.
* guix/ssh.scm (retrieve-files): Remove the subset of FILES that is
valid in LOCAL.
(store-export-channel): Add comment.
2018-01-12 23:41:15 +01:00