Commit Graph

3603 Commits (b9b53fb4ffa188a2dad2b3062a552877f1124750)

Author SHA1 Message Date
Sahithi Yarlagadda 80ec1b73d2
ui: Add support for colorization.
* guix/ui.scm (ansi-color-tables): New variable.
(color, colorize-string): New procedures.

Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
2018-09-09 22:26:54 +02:00
Ludovic Courtès 5dec93bb8b
gexp: 'file-union' accepts directory names.
* guix/gexp.scm (file-union): Import (guix build utils).  Make the
parent directories of TARGET.
* tests/gexp.scm ("file-union"): New test.
2018-09-08 23:02:01 +02:00
Ludovic Courtès da34a19f3a
guix describe: Display information about the current generation.
* guix/scripts/describe.scm (display-profile-info)[number]: Use the
current generation number instead of the last generation number.
2018-09-07 14:19:42 +02:00
Ludovic Courtès 2b73d82830
guix package: Record package provenance in manifest entries.
* guix/profiles.scm (package->manifest-entry): Add #:properties and
honor it.
* guix/scripts/package.scm (package-provenance)
(package->manifest-entry*): New procedures.
(transaction-upgrade-entry, options->installable): Use
'package->manifest-entry*' instead of 'package->manifest-entry'.
2018-09-07 11:40:25 +02:00
Ludovic Courtès bd7470185b
Add 'guix describe'.
* guix/scripts/describe.scm: New file.
* Makefile.am (MODULES): Add it.
(SH_TESTS): Add tests/guix-describe.sh.
* po/guix/POTFILES.in: Add it.
* guix/scripts/pull.scm (display-profile-content): Export.
* guix/describe.scm (current-profile, current-profile-entries): Export.
* tests/guix-describe.sh: New file.
* doc/guix.texi (Features): Mention 'guix pull' and provenance tracking.
(Invoking guix pull): Link to 'guix describe'.
(Channels): Likewise.
(Invoking guix describe): New node.
2018-09-07 11:40:22 +02:00
Ludovic Courtès ee94cfeb99
pull: Add '--profile'.
* guix/scripts/pull.scm (show-help, %options): Add '--profile'.
(build-and-install): Change 'config-dir' argument to 'profile'.
(guix-pull): Honor '--profile'.
* doc/guix.texi (Invoking guix pull): Document it.
2018-09-07 11:40:18 +02:00
Ludovic Courtès 37a6cdbf1b
git: Don't require users to specifiy "origin/" for branches.
Fixes <https://bugs.gnu.org/32618>.
Reported by Eric Brown <brown@fastmail.com>.

* guix/git.scm (update-cached-checkout): Remove "origin/" from default
REF.  Define CANONICAL-REF and use it instead of REF.
(latest-repository-commit): Remove "origin/" from default REF.
* guix/channels.scm (%default-channels): Remove "origin/" from
'branch'.
2018-09-05 23:50:38 +02:00
Ludovic Courtès cb341c1219
channels: Fix external channel builds.
This fixes a regression introduced in
ca71942445 whereby external channels would
fail to build due to the lack of (gcrypt …) modules.

* guix/channels.scm (channel-instance-derivations): Add 'guile-gcrypt'.
Pass it along CORE to 'build-channel-instance'.
2018-09-05 23:33:49 +02:00
Ludovic Courtès 030f1367f0
channels: Add 'latest-channel-derivation' convenience procedure.
* guix/channels.scm (latest-channel-derivations): Remove.
(latest-channel-instances*, latest-channel-derivation): New procedures.
2018-09-05 12:01:48 +02:00
Ludovic Courtès ca71942445
Switch to Guile-Gcrypt.
This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)

* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt.  Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this.  Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this.  Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
 #:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions  Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules.  Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
2018-09-04 17:25:11 +02:00
Ludovic Courtès 7e1d229019
inferior: Add home-page and location package accessors.
* guix/inferior.scm (inferior-package-home-page)
(inferior-package-location): New procedures.
* tests/inferior.scm ("inferior-packages"): Test them.
2018-09-04 17:22:55 +02:00
Ludovic Courtès 0d39a3b989
Add (guix channels) and use it in (guix scripts pull).
* guix/channels.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/scripts/pull.scm: Use it.
(%default-options): Remove 'repository-url' and 'ref'.
(show-help, %options): Add '--channels'.
(%self-build-file, %pull-version, build-from-source)
(whole-package-for-legacy, derivation->manifest-entry): Remove.  These
now exist in a similar form in (guix channels).
(build-and-install): Change 'source' to 'instances'.  Remove #:url,
 #:branch, and #:commit.  Rewrite using 'channel-instances->manifest'.
(channel-list): New procedure.
(guix-pull): Parameterize %REPOSITORY-CACHE-DIRECTORY.  Call
'honor-lets-encrypt-certificates!' unconditionally.  Load
~/.config/guix/channels.scm.  Rewrite to use (guix channels).
[use-le-certs?]: Remove.
* po/guix/POTFILES.in: Add (guix channels).
* doc/guix.texi (Invoking guix pull): Group the description of '--url',
'--commit', and '--branch'.  Remove mention of 'GUIX_PULL_URL'.  Add
references to "Channels".  Document '--channels'.
(Channels): New node.
(Defining Packages): Link to "Channels" instead of "Package Modules".
(Invoking guix edit): Link to "Package Modules" instead of "Defining
Packages".
(Package Modules): Document both GUIX_PACKAGE_PATH and channels.
2018-09-02 16:51:40 +02:00
Ludovic Courtès fe634eaf93
Add (guix describe) and use it to initialize '%package-search-path'.
* guix/describe.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/packages.scm (%default-package-module-path): New variable.
(%package-module-path): Honor 'package-path-entries'.
* build-aux/update-NEWS.scm (main): Use %DEFAULT-PACKAGE-MODULE-PATH
instead of (last (%package-module-path)).
2018-09-02 16:43:10 +02:00
Ludovic Courtès 02fa1d251c
discovery: Add 'scheme-modules*'.
* guix/self.scm (scheme-modules*): Move to...
* guix/discovery.scm (scheme-modules*): ... here.  New procedure.  Make
'sub-directory' an optional parameter.
2018-09-02 16:43:10 +02:00
Ludovic Courtès 301aa9e76c
pack: Correctly report "unknown pack format" errors.
* guix/scripts/pack.scm (guix-pack): Fix "unknown pack format" error
message.
2018-08-31 17:26:56 +02:00
Ludovic Courtès 8e1395be5c
records: Adjust to test changes in 'record-abi-mismatch-error'.
Fixes a test failure introduced in
de5cbd4a38.

* guix/records.scm (abi-check): Refer to TYPE in an unquoted context so
we get at the RTD.
* tests/records.scm ("ABI checks"): Adjust 'catch' handler to changes
in the 'record-abi-mismatch-error' arguments.
2018-08-31 17:26:56 +02:00
Ricardo Wurmus ac906cb7bb
import: pypi: Support recursive importing.
* guix/import/pypi.scm (guess-requirements): Use upstream names.
(compute-inputs): Return the upstream dependency names as an additional value.
(make-pypi-sexp): Likewise.
(pypi->guix-package): Memoize it.
(pypi-recursive-import): New procedure.
* guix/scripts/import/pypi.scm (show-help, %options): Accept "recursive"
option.
(guix-import-pypi): Use pypi-recursive-import.
* doc/guix.texi (Invoking guix import): Document it.
2018-08-30 15:22:22 +02:00
Ricardo Wurmus e37f889404
import: pypi: Also guess dependencies from *.egg-info/requires.txt.
* guix/import/pypi.scm (guess-requirements): Extract "requires.txt" from the
egg-info directory in addition to "requirements.txt"; strip off version
constraints; use call-with-temporary-directory.
2018-08-30 15:22:14 +02:00
Ricardo Wurmus a3ece51a29
import: stackage: Support recursive importing.
* guix/import/hackage.scm (hackage-name->package-name): Export procedure.
* guix/import/stackage.scm (lts-info-packages-lts-info): Fix match expression.
(stackage-recursive-import): New procedure.
(stackage->guix-package): Memoize results.
* guix/scripts/import/stackage.scm (show-help, %options,
guix-import-stackage): Support recursive importing.
* doc/guix.texi (Invoking guix import): Document option.
2018-08-30 15:22:06 +02:00
Ludovic Courtès de5cbd4a38
records: Adjust 'record-abi-mismatch-error' arguments.
Previously, 'display-error' (as used by 'warn-about-load-error', for
instance) would be called with a wrong number of arguments when a
'record-abi-mismatch-error' was caught:

  warning: failed to load '(gnu tests install)':
  Backtrace:
  [...]
  ERROR: In procedure display-error:
  Wrong number of arguments to #<procedure display-error (_ _ _ _ _ _)>

Now you get warnings and error reports as intended:

  warning: failed to load '(gnu tests install)':
  In procedure abi-check: <openssh-configuration>: record ABI mismatch; recompilation needed
  warning: failed to load '(gnu tests ssh)':
  In procedure abi-check: <openssh-configuration>: record ABI mismatch; recompilation needed

* guix/records.scm (print-record-abi-mismatch-error): Remove.
Remove top-level call to 'set-exception-printer!'.
(abi-check): Use arguments as expected by 'display-error'.
2018-08-29 23:32:01 +02:00
Ludovic Courtès a0a2c2f16a
pull: Use (git) and (guix git) unconditionally.
The autoload hack was added a year ago, before 0.14.0, i.e., before any
release would depend on Guile-Git.  Both 0.14.0 and 0.15.0 required
Guile-Git, and 'guix pull' now automatically pulls it in, so this hack
is no longer necessary.

* guix/scripts/pull.scm: Use (git) and (guix git).  Remove top-level
call to 'module-autoload!'.
(ensure-guile-git!): Remove.
(guix-pull): Remove call to 'ensure-guile-git!'.
2018-08-27 23:22:17 +02:00
Ludovic Courtès f2d0a2cf5c
self: Shrink the module search path of the 'guix' command.
Previously we'd have lots of useless entries on the search paths, such
as libtasn1, libidn2, zlib, gmp, etc. because they are propagated by
gnutls.

* guix/self.scm (guix-command)[source-directories, object-directories]:
New variables.  Use them in the body of "guix-command".  Filter their
items with 'file-exists?'.
2018-08-27 23:22:17 +02:00
Ludovic Courtès 8a928aa729
cve: Update feed URL.
* guix/cve.scm (yearly-feed-uri): Remove "static." from the URL since
the web site now redirects to the URL without "static.".
2018-08-26 01:47:40 +02:00
Ludovic Courtès 93c333895a
grafts: Add (guix build debug-link) and use it.
Fixes <https://bugs.gnu.org/19973>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/build/debug-link.scm: New file.
* guix/build/graft.scm (%graft-hooks): New variable.
(graft): Add #:hooks and honor it.
* guix/grafts.scm (graft-derivation/shallow): Add (guix build
debug-link) and (guix elf) to #:modules.
* tests/debug-link.scm: New file.
* Makefile.am (MODULES): Add guix/build/debug-link.scm.
(SCM_TESTS): Add tests/debug-link.scm.
2018-08-24 18:01:05 +02:00
Ludovic Courtès e4297aa8b9
grafts: Add high-level 'graft' procedure on the build side.
* guix/build/graft.scm (graft): New procedure.
* guix/grafts.scm (graft-derivation/shallow)[build]: Use it instead of
inline code.
2018-08-24 17:57:56 +02:00
Ludovic Courtès a81b59b1bf
inferior: Adjust for Guile 2.0.
Partly fixes <https://bugs.gnu.org/32326>.
Reported by Michael Bowcutt <mbowcutt@riseup.net>.

* guix/inferior.scm (open-inferior): Wrap 'setvbuf' call in 'cond-expand'.
2018-08-21 23:27:08 +02:00
Pierre Neidhardt dece8c91a9
build-system/asdf: Fix typo in "dependency".
* guix/build-system/asdf.scm (default-lisp): Fix typo in "dependency".
2018-08-21 16:27:03 +02:00
Ludovic Courtès bab4dc58f7
import: github: Filter out tags that don't look like version numbers.
* guix/import/github.scm (latest-released-version): Filter out RELEASE
if it doesn't start with digit.
2018-08-20 16:32:18 +02:00
Ludovic Courtès 45c01189cc
import: github: Get /tags when /releases returns the empty list.
This allows "guix refresh" to work for many packages where it would
previously fail with "no updater for PACKAGE".

* guix/import/github.scm (fetch-releases-or-tags): New procedure.
(latest-released-version): Use it instead of calling 'json-fetch'.
Adjust 'hash-ref' call.
2018-08-20 16:32:18 +02:00
Ludovic Courtès 2766282f5a
import: github: Request API v3 in the 'Accept' header.
* guix/import/json.scm (json-fetch): Add #:headers argument and honor it.
* guix/import/github.scm (latest-released-version): Pass #:headers to
'json-fetch'.
2018-08-20 16:32:18 +02:00
Marius Bakke df570bf271
Merge branch 'master' into staging 2018-08-16 20:56:38 +02:00
Ricardo Wurmus a928596162
import: hackage: Support recursive importing.
* guix/import/hackage.scm (hackage-recursive-import): New procedure.
(hackage-module->sexp): Return dependencies alongside dependencies.
(hackage->guix-package): Memoize results.
* guix/scripts/import/hackage.scm (show-help, %options, guix-import-hackage):
Support recursive importing.
* doc/guix.texi (Invoking guix import): Document option.
2018-08-11 18:53:46 +02:00
Tobias Geerinckx-Rice 9aba9b1278
Migrate search.cpan.org home pages to metacpan.org.
The venerable search.cpan.org has retired[0].

[0]: https://log.perl.org/2018/05/goodbye-search-dot-cpan-dot-org.html

* guix/import/cpan.scm (cpan-home): Generate metacpan.org home page URIs.
Update all previously generated ones in (gnu packages) to their
canonical new homes.
2018-08-11 17:22:31 +02:00
Marius Bakke 7b38f045c0
Merge branch 'master' into staging 2018-08-10 15:32:51 +02:00
Ricardo Wurmus f60784228a
import: cabal, hackage: Avoid error when custom setup section is missing.
Fixes <https://debbugs.gnu.org/32387>.

* guix/import/cabal.scm (eval-cabal): Avoid mis-match when the custom-setup
section cannot be created.
* guix/import/hackage.scm (cabal-custom-setup-dependencies->names): Do not
crash when cabal-package-custom-setup returns #F.
2018-08-07 20:39:12 +02:00
Marius Bakke 869250809b
Merge branch 'master' into staging 2018-07-30 18:08:28 +02:00
Ludovic Courtès b90d97ec2e
ssh: Display the size of the store items being sent.
* guix/ssh.scm (send-files): Compute the size of MISSING and display
it.
2018-07-29 18:50:28 +02:00
Marius Bakke 1af575f04d
Merge branch 'master' into staging 2018-07-28 18:34:59 +02:00
Marius Bakke 94eb59fb4a
build-system/meson: Remove RUNPATH workarounds.
* guix/build-system/meson.scm (default-patchelf): Remove.
(lower)[build-inputs]: Remove PATCHELF.
(meson-build): Don't delete 'fix-runpath' phase on armhf.
* guix/build/meson-build-system.scm (configure): Add "--c_link_args" and
  "-cpp_link_args" instead of setting LDFLAGS.
(meson-build): Don't apply 'fix-runpath' phase.
2018-07-28 14:54:18 +02:00
Danny Milosavljevic d804d0b9ef
import: hackage: Emit native-inputs in the importer.
* guix/import/cabal.scm (cabal-custom-setup-dependencies): Export.
(cabal-package-custom-setup): Export.
(<cabal-package>): New field "custom-setup".
(make-cabal-package): Modify.
(eval-cabal): Modify.
* guix/import/hackage.scm (cabal-dependencies->names): Factor out...
(cabal-test-dependencies->names): ...this.
(cabal-custom-setup-dependencies->names): New procedure.
(hackage-module->sexp): Modify.
2018-07-27 11:42:53 +02:00
Danny Milosavljevic 8376f10a30
ruby-build-system: Make phase "replace-git-ls-files" handle more cases.
* guix/build/ruby-build-system.scm (replace-git-ls-files): Modify.
2018-07-24 22:55:38 +02:00
Marius Bakke 8440db459a
import: PyPI: Update redirected URL.
* guix/import/pypi.scm (guix-package->pypi-name, pypi->guix-package): Update
docstrings.
(pypi-package?): Test for pypi.org, too.
(pypi-fetch): s/pypi.python.org/pypi.org/
* tests/pypi.scm ("guix-package->pypi-name, new URL style",
"pypi->guix-package", "pypi->guix-package, wheels"): Likewise.
2018-07-24 17:42:04 +02:00
Ludovic Courtès 2a3b1b3235
build-system: Add 'guile-build-system'.
* guix/build-system/guile.scm, guix/build/guile-build-system.scm: New
files.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document 'guile-build-system'.
2018-07-23 12:25:31 +02:00
Marius Bakke e9be2c5409
Revert "guix: Compress and decompress xz archives in parallel."
Threaded compression makes archives non-deterministic: the result depends on
the number of threads used for compressing.  See <https://bugs.gnu.org/31015>.

This reverts commit 63102406f2.
2018-07-22 18:01:35 +02:00
Ludovic Courtès e475211869
database: Reset timestamps to one second after the Epoch.
Previously, store items registered in the database by this code (for
instance, store items retrieved by 'guix offload' and passed to
'restore-file-set') would have an mtime of 0 instead of 1.

This would cause problems for things like .go files: Guile would
consider them to be older than the corresponding .scm file, and
consequently it would ignore them and possibly use another (incorrect)
.go file.

Reported by Ricardo Wurmus.

* guix/store/database.scm (reset-timestamps): Pass 1, not 0, to
'utime'.
* tests/store-database.scm ("register-path"): Check the mtime of FILE
and REF.
2018-07-20 15:01:33 +02:00
Ludovic Courtès 4f89a8eec6
deduplication: Work around Guile bug in 'seek'.
Fixes <https://bugs.gnu.org/32161>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

This mostly reverts 83099892e0.

* guix/store/deduplication.scm (counting-wrapper-port): New procedure.
(nar-sha256): Use it.
2018-07-20 15:01:33 +02:00
Leo Famulari 82549f2328
build-system/go: Use invoke instead of system*.
* guix/build/go-build-system.scm (unpack, build): Use invoke.
(install-source): Unconditionally return #t.
(check): Use invoke and unconditionally return #t.
2018-07-19 19:12:54 -04:00
Julien Lepiller 79d4d47b99
guix: ant-build-system: Reorder before generating INDEX.LIST.
* guix/build/ant-build-system.scm (%standard-phases): Add
reorder-jar-content phase.
2018-07-19 19:46:31 +02:00
Ludovic Courtès 83099892e0
deduplication: Remove 'counting-wrapper-port'.
* guix/store/deduplication.scm (counting-wrapper-port): Remove.
(nar-sha256): Call 'port-position' directly on PORT.
2018-07-19 17:12:48 +02:00
Ludovic Courtès c71cd4a61f
hash: sha256 port now implements 'port-position'.
* guix/hash.scm (open-sha256-port)[position]: New variable.
[get-position]: New procedure.
Pass it to 'make-custom-binary-output-port'.
* tests/hash.scm ("open-sha256-port, hello"): Test 'port-position'.
2018-07-19 17:08:53 +02:00
Ludovic Courtès f5db54eaa5
self: Use the new 'imported-files'.
That way, the source of most nodes is now a content-addressed store item
instead of a derivation.

* guix/self.scm (<file-mapping>): New record type.
(file-mapping-compiler): New procedure.
(scheme-node): Use 'file-mapping' instead of 'imported-files'.
(imported-files): Remove.
2018-07-19 11:48:04 +02:00
Ludovic Courtès e529d46828
gexp: 'imported-files/derivation' can copy files instead of symlinking.
* guix/gexp.scm (imported-files/derivation): Add #:symlink? and honor
it.
(imported-files): Pass #:symlink? to 'imported-files/derivation'.
* tests/gexp.scm ("imported-files with file-like objects"): Add 'file=?'
and use it instead of calling 'readlink'.
2018-07-19 11:48:04 +02:00
Ludovic Courtès 8df2eca6b0
gexp: 'imported-files' no longer creates a derivation by default.
* guix/gexp.scm (gexp->derivation): Add #:import-creates-derivation?.
Pass #:derivation? to 'imported-modules' and 'compiled-modules'.  In -L
argument, check whether MODULES is a derivation.
(%not-slash): New variable.
(file-mapping->tree): New procedure.
(imported-files): Rename to...
(imported-files/derivation): ... this.
(imported-files): New procedure.  Rewrite in terms of
'interned-file-tree' when possible; add #:derivation? parameter.
(imported-modules, compiled-modules): Add #:derivation? parameter and
pass it to 'imported-files'.
* guix/packages.scm (patch-and-repack): Pass
 #:import-creates-derivation? to 'gexp->derivation'.
* tests/gexp.scm ("imported-files"): Adjust to no longer expect a
derivation.
2018-07-19 11:48:04 +02:00
Ludovic Courtès 4d20d87b53
gexp: Remove unnecessary 'mlet'.
* guix/gexp.scm (imported-modules): Use 'let' instead of 'mlet'.
2018-07-19 11:48:04 +02:00
Ludovic Courtès 7f11efbac7
store: Add 'add-file-tree-to-store'.
* guix/store.scm (%not-slash): New variable.
(add-file-tree-to-store, interned-file-tree): New procedures.
* tests/store.scm ("add-file-tree-to-store"): New test.
2018-07-19 11:48:04 +02:00
Ludovic Courtès b94b698d4e
serialization: Add 'write-file-tree'.
* guix/serialization.scm (write-contents-from-port): New procedure.
(write-contents): Write in terms of 'write-contents-from-port'.
(filter/sort-directory-entries, write-file-tree): New procedures.
(write-file): Rewrite in terms of 'write-file-tree'.
* tests/nar.scm ("write-file-tree + restore-file"): New test.
2018-07-19 11:48:04 +02:00
Christopher Baines 0d354666d3
ruby-build-system: Error or return #t from all phases.
Previously, if the tests didn't pass, the check phase would evaluate to #f,
but the package would be built sucessfully. This changes all the phases to
raise exceptions if errors are encountered, and return #t otherwise.

This involves using invoke rather than system*, so that exceptions are raised
if the program exits with a status other than 0, and also returning #t at the
end of functions.

* gnu/build/ruby-build-system.scm (unpack): Use invoke rather than system*,
and return #t at the end.
(build, check): Use invoke rather than system*.
(install): Remove the use of "and", and rewrite the error handling to raise an
exception.
(wrap): Return #t.
2018-07-15 22:19:39 +01:00
Leo Famulari 27f7cbc91d
utils: Really clean up temporary directories.
Fixes <https://bugs.gnu.org/32126>.

* guix/utils.scm (call-with-temporary-directory): Use DELETE-FILE-RECURSIVELY
instead of RMDIR.
2018-07-13 17:33:45 -04:00
Ludovic Courtès bca302c67a
pull: Display new/upgraded packages upon completion.
* guix/scripts/pull.scm (display-profile-news): New procedure.
(build-and-install): Call it.
(display-new/upgraded-packages): Add #:heading and honor it.
2018-07-13 17:28:40 +02:00
Ludovic Courtès dc733e6a12
pull: Use (guix inferior) to display new and upgraded packages.
* guix/scripts/pull.scm (display-profile-content): Call
'display-generation'.
(display-new/upgraded-packages, display-profile-content-diff): New
procedures.
(process-query)[list-generation]: Remove.
[list-generations]: New procedure.
Adjust accordingly.
* doc/guix.texi (Invoking guix pull): Update example of '-l'.
2018-07-13 17:28:40 +02:00
Ludovic Courtès 2ca299caf6
Add (guix inferior) and (guix scripts repl).
* guix/inferior.scm, guix/scripts/repl.scm, tests/inferior.scm: New
files.
* Makefile.am (MODULES): Add 'guix/scripts/repl.scm' and
'guix/inferior.scm'.
(SCM_TESTS): Add 'tests/inferior.scm'.
* doc/guix.texi (Invoking guix repl): New node.
2018-07-13 17:28:39 +02:00
Ludovic Courtès bc6e291ef0
guix package: Use relative symlinks to generations.
Reported by Roel Janssen <roel@gnu.org>
at <https://lists.gnu.org/archive/html/guix-devel/2018-07/msg00036.html>.

* guix/profiles.scm (switch-to-generation): Use (basename generation) as
the symlink target.
* guix/scripts/package.scm (build-and-use-profile): Likewise,
use (basename name) as the symlink target.
* tests/guix-package.sh: Adjust --roll-back test accordingly.  Add
explicitly test with '-p foo/prof'.
2018-07-13 17:28:39 +02:00
Oleg Pykhalov ffc3fcade3
git: Call 'url-cache-directory' outside 'update-cached-checkout'.
* guix/git.scm (update-cached-checkout): Call 'url-cache-directory' in
'cache-directory' key argument.
(latest-repository-commit): Call 'url-cache-directory'.
2018-07-13 16:24:48 +03:00
Danny Milosavljevic e29067d22e
import: hackage: Fix typo.
* guix/import/cabal.scm (cabal-custom-setuo-name): Rename to...
(cabal-custom-setup-name): ...this.
2018-07-13 15:23:40 +02:00
Marius Bakke 49b6dc2b4e
Merge branch 'staging' 2018-07-13 00:25:45 +02:00
Danny Milosavljevic e39a44f340
import: hackage: Evaluate "-any" and "-none" version comparison operators.
* guix/import/cabal.scm (eval-cabal): Modify.
* tests/hackage.scm (test-cabal-4): New variable and test.
(test-cabal-5): New variable and test.
(test-cabal-6): New variable and test.
2018-07-12 20:35:04 +02:00
Danny Milosavljevic ecba50bb79
import: hackage: Support "-any" and "-none" version comparison operators.
* guix/import/cabal.scm (make-cabal-parser): Modify.
(is-any): New variable.
(is-none): New variable.
(lex-any): New procedure.
(lex-none): New procedure.
(lex-word): Modify.
(eval-cabal): Modify.
2018-07-12 09:06:48 +02:00
Danny Milosavljevic 314b63e0b4
import: hackage: Support "custom-setup" field.
Fixes <https://bugs.gnu.org/23961>.

* guix/import/cabal.scm (make-cabal-parser): Modify.
(is-custom-setup): New variable.
(lex-custom-setup): New procedure.
(is-id): Modify.
(lex-version): Modify.
(<cabal-custom-setup>): New record type.
(eval-cabal): Modify.
(dependencies): Add parameter.
2018-07-12 09:06:48 +02:00
Jan Nieuwenhuizen e8e1f295f1
gexp: Allow bytevector as content of `plain-file'.
This allows for using a package source directly from git, doing something like

    (define (command->bytevector command)
      (let ((port (apply open-pipe* OPEN_READ command)))
        (let ((output (get-bytevector-all port)))
          (close-port port)
          output)))

    (define-public hello-git
      (package
        (name "hello")
        (version "git")
        (source (let* ((commit "stable-2.0")
                       (content (command->bytevector
                                 `("git" "archive" "--format" "tar" "--prefix"
                                   ,(string-append commit "/") ,commit)))
                       (file-name (string-append "hello-" commit)))
                  (plain-file file-name content)))
        ...
        ))

* guix/gexp.scm (<plain-file>): Also allow bytevector content.
(plain-file-compiler): Handle bytevector content.
* doc/guix.texi (G-Expressions): Describe plain-file now also taking
bytevectors.
2018-07-12 06:22:04 +02:00
Jan Nieuwenhuizen f3a422511f
store: Add `binary-file'.
* guix/store.scm (binary-file): New function.
* doc/guix.texi (The Store Monad): Describe binary-file.
2018-07-12 06:22:04 +02:00
Ludovic Courtès daf76c7cd5
gnu-maintenance: Get GNU metadata from rec files.
Suggested by Mike Gerwitz <mtg@gnu.org>.

* guix/gnu-maintenance.scm (%package-list-url): Use the .rec file.
(%package-description-url): Likewise.
(official-gnu-packages)[read-records]: Skip record descriptors.
Rename fields to use underscores instead of hyphens.
2018-07-11 16:07:04 +02:00
Oleg Pykhalov 88388766f7
import: gem: Add recursive import.
* doc/guix.texi (Invoking guix import): Document gem recursive import.
* guix/import/gem.scm (gem->guix-package): Return package and dependencies
values.
(gem-recursive-import): New procedure.
* guix/scripts/import/gem.scm (show-help, %options): Add recursive option.
(guix-import-gem): Use 'gem-recursive-import'.
* tests/gem.scm (test-json): Rename to 'test-foo-json'.
("gem->guix-package"): Use 'test-foo-json'.
(test-bar-json, test-bundler-json): New variables.
("gem-recursive-import"): New test.
2018-07-11 07:08:54 +03:00
Danny Milosavljevic a59b0fa2d7
build-system/haskell: Make phases fail on error.
* guix/build/haskell-build-system.scm (configure): Make it fail on error.
(run-setuphs): Make it fail on error.
2018-07-11 02:45:53 +02:00
Ludovic Courtès dc013aff81
ui: Fix typo.
* guix/ui.scm (display-profile-content-diff): Fix typo in docstring.
2018-07-11 00:53:04 +02:00
Ludovic Courtès 78d55b703d
profiles: Introduce 'profile-search-paths' and use it.
* guix/profiles.scm (profile-search-paths): New procedure.
* guix/scripts/environment.scm (evaluate-search-paths): Remove.
(create-environment): Replace 'paths' with 'manifest'.  Use
'profile-search-paths' instead of 'evaluate-search-paths'.
(show-search-paths): Likewise.
(launch-environment): Replace 'paths' with 'manifest'.  Make 'pure?' a
keyword parameter.
(launch-environment/fork, launch-environment/container): Likewise.
(guix-environment): Remove 'paths' variable.  Adjust callers of the
above procedures accordingly.
2018-07-11 00:52:36 +02:00
Ludovic Courtès 10f0a40c16
environment: Simplify code by using manifests internally.
* guix/scripts/environment.scm (strip-input-name)
(package+propagated-inputs, package-or-package+output?)
(compact): Remove.
(inputs->profile-derivation): Rename to...
(manifest->derivation): ... this.  Replace 'inputs' parameter with
'manifest'.
(input->manifest-entry): New procedure.
(package-environment-inputs): Rewrite to return a list of manifest
entries.
(options/resolve-packages): Rewrite to return a manifest.
(guix-environment): Remove 'inputs'.  Define 'paths' in terms of
'manifest-search-paths'.
2018-07-11 00:52:36 +02:00
Ludovic Courtès f03df3ee75
profiles: Factorize 'manifest-search-paths'.
* guix/profiles.scm (manifest-search-paths): New procedure.
(profile-derivation)[builder]: Use it.
* guix/build/profiles.scm (build-etc/profile): Remove $PATH.
2018-07-11 00:52:36 +02:00
Julien Lepiller b24443bff9
guix: Add opam importer.
* guix/scripts/import.scm (importers): Add opam.
* guix/scripts/import/opam.scm: New file.
* guix/import/opam.scm: New file.
* tests/opam.scm: New file.
* Makefile.am: Add them.
* doc/guix.texi (Invoking guix import): Document it.
2018-07-10 10:11:01 +02:00
Marius Bakke 873325b030
Merge branch 'master' into staging 2018-07-08 23:58:22 +02:00
Kyle Meyer 85c3fbf5de
ui: Add -V as short option for --version.
* guix/ui.scm (run-guix): Add -V as the short option for --version for
consistency with most commands.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-07-07 18:10:31 +02:00
Kyle Meyer 7ede577a5f
scripts: Add missing -V option to commands that document it.
* guix/scripts/container.scm (guix-container):
* guix/scripts/import.scm (guix-import):
* guix/scripts/substitute.scm (guix-substitute): Add -V as the short option
for --version to match show-help's description.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-07-07 18:10:31 +02:00
Kyle Meyer 7a369f6d2f
weather: Fix pasto in --version output.
* guix/scripts/weather.scm (%options): Correct the command name passed to
show-version-and-exit.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-07-07 18:10:31 +02:00
Ludovic Courtès 5adb2df0a2
pack: Use guile-for-build for the target system.
Until now, running "guix pack -s i686-linux" on an x86_64-linux machine,
for instance, would use an x86_64 guile for module derivations.  This
was OK until now, but would break when passing "--localstatedir" due to
the introduction of guile-sqlite3: we'd be using the i686 guile-sqlite3
along with the x86_64 guile.

* guix/scripts/pack.scm (guix-pack): Pass the 'system option from OPTS
to 'package-derivation'.
2018-07-05 13:35:21 +02:00
Ludovic Courtès 5b0c648a7c
profiles: 'info-dir-file' hook now produces 'dir.LANG' files.
Previously, entries for 'guix.fr.info' would end up in 'dir', above the
'guix.info' entries; consequently, running 'info guix' would actually
open 'guix.fr.info', which was confusing for non-French readers.

* guix/profiles.scm (info-dir-file)[glibc-utf8-locales]: New variable.
[build](info-file-language): New procedure.
(install-info): Use it, to create 'dir.LANG' files.
Set GUIX_LOCPATH.
2018-07-04 10:52:59 +02:00
Ludovic Courtès 86eee976f5
Revert "packages: Optimize 'package-transitive-supported-systems'."
This reverts commit 24420f5ffa.

This broke 'package-transitive-supported-systems', which would return
the union of supported systems instead of the intersection.
2018-07-03 17:50:04 +02:00
Ludovic Courtès f3f1d0a557
guix system: Make 'init' idempotent again.
This fixes a regression introduced in
df2f6400b1fbc282ef4d6dd7124ea1c17adc23c2: since the new
'register-path' (actually 'reset-timestamps') would make files
read-only, 'delete-file-recursively' would fail to delete them.  Thus,
re-running 'guix system init' on an already-populated store would fail
with a 'delete-file' EPERM.

* guix/scripts/system.scm (copy-item): Use 'lstat' instead of
'file-exists?'.  Call 'make-file-writable' on each directory below
DEST.
2018-07-03 17:50:04 +02:00
Ludovic Courtès 90b144d22d
ui: Report file names in 'system-error' exceptions from 'delete-file'.
* guix/ui.scm (delete-file): New error-reporting wrapper.
2018-07-03 17:50:04 +02:00
Ludovic Courtès e5e5119855
database: 'reset-timestamps' now correctly handles symlinks.
* guix/store/database.scm (reset-timestamps): Use 'utime' with
AT_SYMLINK_NOFOLLOW for symlinks.
2018-07-03 17:50:04 +02:00
Ludovic Courtès 25c7ff6a3e
syscalls: Define AT_SYMLINK_NOFOLLOW et al.
* guix/build/syscalls.scm (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR)
(AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, AT_EMPTY_PATH): New variables.
* tests/syscalls.scm ("utime with AT_SYMLINK_NOFOLLOW"): New test.
2018-07-03 17:50:04 +02:00
Ludovic Courtès a5b34d9d24
deduplication: Remove 'false-if-system-error', now unused.
* guix/store/deduplication.scm (false-if-system-error): Remove.
2018-07-03 17:50:04 +02:00
Oleg Pykhalov ae6fa00af0
import: elpa: Check if 'fetch-elpa-package' rest argument is null.
* guix/import/elpa.scm (fetch-elpa-package): Check if 'rest' is null.
2018-07-03 07:19:13 +03:00
Ludovic Courtès 3dbf331942
deduplication: Place link files under /gnu/store/.links.
Previously they'd always be placed next to TO-REPLACE, which would lead
to EPERM in some cases.

* guix/store/deduplication.scm (replace-with-link): Add #:swap-directory
parameter and honor it.  Add call to 'make-file-writable'.  Catch
'system-error' around 'rename-file'.
(deduplicate): Pass #:swap-directory and remove uses of
'false-if-system-error'.
* tests/store-deduplication.scm ("deduplicate"): Add 'chmod' call.
2018-07-03 00:39:11 +02:00
Ludovic Courtès af2f8ae5f1
deduplication: Fix incorrect use of 'throw'.
* guix/store/deduplication.scm (get-temp-link): In handler, fix call to
'throw'.
2018-07-03 00:39:11 +02:00
Ludovic Courtès 71bf6cb700
guix system: init: Check the available space before copying.
* guix/scripts/system.scm (copy-closure): Call 'query-path-info*' on
TO-COPY and REFS.  Compute the total size.  Call 'check-available-space'.
2018-07-03 00:39:11 +02:00
Ludovic Courtès 8120b23e51
ui: Make 'check-available-space' public.
* guix/ui.scm (check-available-space): Add optional 'directory'
parameter, defaulting to (%store-prefix).  Honor it.  Make public.
2018-07-03 00:39:10 +02:00
Ludovic Courtès 0744a9f002
store: Add 'query-path-info*'.
* guix/scripts/size.scm (query-path-info*): Move to...
* guix/store.scm (query-path-info*): ... here.
2018-07-03 00:39:10 +02:00
Ludovic Courtès 24420f5ffa
packages: Optimize 'package-transitive-supported-systems'.
This version is 13% faster than the one above when timing:

  (fold-packages (lambda (p x)
		   (package-transitive-supported-systems p))
		 '())

* guix/packages.scm (package-transitive-supported-systems): Make
'systems' a set instead of calling 'lset-intersection' repeatedly.
2018-07-03 00:39:10 +02:00
Ludovic Courtès 084f64cb03
self: Build with Guile 2.2.4.
* guix/self.scm (guile-for-build): In the "2.2" case, choose
GUILE-2.2.4.
2018-07-02 15:28:35 +02:00
Ludovic Courtès 8970a886e6
self: Use #:guile-for-build in the shebang of the 'guix' executable.
* guix/self.scm (guix-command): Add #:guile and pass it to 'program-file'.
(whole-package): Add #:guile and pass it to 'guix-command'.
(compiled-guix): Pass #:guile to 'guix-command' and 'whole-package'.
2018-07-02 15:28:35 +02:00
Ludovic Courtès 223fa5b327
utils: Micro-optimize 'source-properties->location'.
* guix/utils.scm (source-properties->location): Destructure LOC with
'match', adding a fast path without 'assq-ref' calls.
2018-07-02 15:28:35 +02:00