Commit Graph

4408 Commits

Author SHA1 Message Date
Martin Becze ed661e38d8
import: crate: Add '--recursive'.
* guix/scripts/import/crate.scm (show-help, guix-import-crate): Add '--recursive'.
* doc/guix.texi (Invoking guix import): Mention '--recursive'.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2019-10-01 23:34:31 +02:00
Martin Becze f837293202
import: crate: Support recursive imports.
* guix/import/crate.scm (crate-recursive-import): New procedure.
(crate->guix-package): Return dependencies as a second value.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-10-01 23:34:30 +02:00
Konrad Hinsen 13169000f6
pull: Do not use '~*', which 'msgfmt' fails to interpret.
Really fixes <https://bugs.gnu.org/37505>.
This is a followup to f751b4646d3989d76dad9e33e39f9724c7c50be6.

* guix/scripts/pull.scm (display-channel-news): Remove second occurrence
of '~*' in a format string.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-10-01 23:34:30 +02:00
Christopher Baines 2cd599f005
inferior: Change to use the (guix repl) module.
Rather than (guix scripts repl), from which the machine-repl procedure was
removed in [1].

1: 92a4087bf4

* guix/inferior.scm (inferior-pipe): Load (guix repl) rather than (guix
scripts repl).
2019-10-01 19:01:20 +01:00
Ludovic Courtès 43f7fd8783
pull: Do not use '~*', which 'msgfmt' fails to interpret.
Fixes <https://bugs.gnu.org/37505>.
Reported by Konrad Hinsen <konrad.hinsen@fastmail.net>.

* guix/scripts/pull.scm (display-channel-news): Use ~a instead of ~*
when reporting new channels.
2019-10-01 10:50:24 +02:00
Ludovic Courtès 8b4615ab54
ui: 'show-what-to-build' colorizes store file names.
* guix/ui.scm (colorize-store-file-name): New procedure.
(show-what-to-build)[colorize-store-item]: New variable.
Use it throughout.
2019-10-01 10:50:24 +02:00
Ludovic Courtès 7089f98ef1
syscalls: 'define-as-needed' does not re-export local variables.
Fixes <https://bugs.gnu.org/36723>.
Reported by Timothy Sample <samplet@ngyro.com>.

* guix/build/syscalls.scm (define-as-needed): Rewrite to use lower-level
module primitives; define VARIABLE only if it's not already defined to
avoid "re-exporting local variable" error.
2019-09-29 23:02:35 +02:00
Ludovic Courtès a3af06ad65
offload: Include the port number in the machine lock file name.
This is useful when a single machine appears several time, with
different port numbers.

* guix/scripts/offload.scm (machine-slot-file): Add MACHINE's port to
the file name.
2019-09-28 22:56:40 +02:00
Eric Bavier 21391f8c83
compile: Fix race condition on completion progress.
This prevent a race condition where multiple compilation threads could report
the same progress.

* guix/build/compile.scm (compile-files)<completed>: Rename to...
<progress>: ...this.  Increment in same mutex region as the compilation is
reported.
2019-09-27 23:00:16 -05:00
Ludovic Courtès 8727e0304b
self: Mark trivial "-modules" derivations as non-substitutable.
The resulting nar takes ~500KiB and it's quicker to build it locally
than to download it.

* guix/self.scm (node-source+compiled): Pass #:options to
'computed-file'.
2019-09-26 23:15:28 +02:00
Hartmut Goebel dec845606d
guix download: Ensure destination file-name is valid in the store.
Avoid invalid store-file-name by explicitly passing the destination
name, replacing any character not allowed in the store-file-name by an
underscore.

Fixes <http://issues.guix.gnu.org/issue/26175>

* guix/scripts/download.scm (safe-naensure-valid-store-file-nameme):
  New function. (download-to-store*): Use it to generate a "safe"
  basename of URL.
2019-09-26 17:48:08 +02:00
Ludovic Courtès 3972dc5d43
guix package: Add '--list-profiles'.
* guix/scripts/package.scm (show-help, %options): Add '--list-profiles'.
(process-query): Honor it.
* tests/guix-package.sh: Add test.
2019-09-26 11:43:26 +02:00
Ludovic Courtès d26c290b7d
pull: Dim the commit ID when displaying news.
* guix/scripts/pull.scm (display-news-entry): Dim the commit line.
2019-09-25 15:46:48 +02:00
Ludovic Courtès 0876e9c116
colors: Add 'dim'.
* guix/colors.scm (coloring-procedure): New procedure.
(%highlight-color): Remove.
(highlight): Define in terms of 'coloring-procedure'.
(dim): New procedure.
2019-09-25 15:46:47 +02:00
Ludovic Courtès 7b3f56f5d7
pull: Use ~/.cache/guix/checkouts instead of ~/.cache/guix/pull.
Previously 'channel-news-for-commit' would use the former while 'guix
pull' would use the latter.  Consequently, the first 'guix pull -N'
would clone the repository anew.

* guix/scripts/pull.scm (guix-pull): Remove 'cache', and leave
%REPOSITORY-CACHE-DIRECTORY to its default value.
2019-09-23 23:41:19 +02:00
Ludovic Courtès 7b7e5b88fc
gexp: Remove unused procedure.
* guix/gexp.scm (syntax-location-string): Remove.
2019-09-23 23:41:19 +02:00
Ludovic Courtès 24ab804ce1
gexp: Catch and report non-self-quoting gexp inputs.
Previously we would, for example, generate build scripts in the store;
when trying to run them, we'd get a 'read' error due to the presence
of #<foo> syntax in there.

* guix/gexp.scm (gexp->sexp)[self-quoting?]: New procedure.
[reference->sexp]: Check whether the argument in a <gexp-input> box is
self-quoting.  Raise a '&gexp-input-error' condition if it's not.
* tests/gexp.scm ("lower-gexp, non-self-quoting input"): New test.
2019-09-23 23:41:19 +02:00
Ludovic Courtès 7abd5997f4
repl, marionette: 'self-quoting?' matches keywords.
* guix/repl.scm (self-quoting?): Add 'keyword?' and 'array?'; remove
'vector?' and 'bytevector?'.
* gnu/tests.scm (marionette-shepherd-service) <start>: Likewise.
<modules>: Remove (rnrs bytevector).
2019-09-23 23:41:19 +02:00
Ludovic Courtès 4f8c29a75c
show, search: Add '--load-path'.
* guix/scripts/search.scm (show-help, %options): Add -L/--load-path.
* guix/scripts/show.scm (show-help, %options): Add -L/--load-path.
2019-09-23 23:41:19 +02:00
Vagrant Cascadian 5da7a04abd
build: ruby-build-system: Fix typo.
* guix/build/ruby-build-system: Fix spelling of "invocation".
2019-09-23 12:08:13 -07:00
Vagrant Cascadian fa4867cc99
import: stackage: Fix typo.
* guix/import/stackage: Fix spelling of "version".
2019-09-23 12:06:46 -07:00
Vagrant Cascadian a130544d60
inferior: Fix typo.
* guix/inferior: Fix spelling of "specifications".
2019-09-23 12:03:00 -07:00
Vagrant Cascadian 7f69414927
lint: Fix typo.
* guix/lint: Fix spelling of "mentioning".
2019-09-23 12:00:03 -07:00
Vagrant Cascadian 77c2eafbbb
scripts: container: Fix typo.
* guix/scripts/container/exec (show-help): Fix spelling of COMMAND.
2019-09-23 11:56:40 -07:00
Ludovic Courtès b69ce8a872
deploy: Add '--verbosity' and properly interpret build log.
This is a followup to 91300526b7.

* guix/scripts/deploy.scm (show-help, %options): Add '--verbosity'.
(guix-deploy): Wrap 'with-store' in 'with-status-verbosity'.
2019-09-23 11:57:39 +02:00
Ludovic Courtès dabdd7d465
pull: Display news titles directly upon 'pull'.
* guix/scripts/pull.scm (display-profile-news): Return true when there's
more to display.
(display-news-entry-title): New procedure.
(display-news-entry): Use it.
(display-channel-specific-news): Return true when there's more to
display.
(display-channel-news-headlines): New procedure.
(build-and-install): Call it.  When 'display-channel-news-headlines' or
'display-profile-news' returns #t, print a hint to run "pull --news".
(display-new/upgraded-packages): Return true when there's more to display.
2019-09-23 10:38:44 +02:00
Ludovic Courtès 192ee02aeb
pull: '-l' displays channel news.
* guix/scripts/pull.scm (display-channel-news): Make 'previous' a
parameter.
(process-query)[list-generations]: Call 'display-channel-news'.
2019-09-23 10:38:44 +02:00
Ludovic Courtès 7faffdc2d5
pull: Display channel news.
* guix/scripts/pull.scm (display-news-entry)
(display-channel-specific-news): New procedures.
(display-channel-news): Call it.
(display-new/upgraded-packages): Adjust hint message.
* doc/guix.texi (Invoking guix pull): Mention it.
2019-09-23 10:38:44 +02:00
Ludovic Courtès a725504a3a
ui: Add 'current-message-language'.
* guix/ui.scm (%default-message-language): New variable.
(current-message-language): New procedure.
2019-09-23 10:38:44 +02:00
Ludovic Courtès 9719e8d37a
channels: Allow news entries to refer to a tag.
Suggested by Ricardo Wurmus <rekado@elephly.net>.

* guix/channels.scm (<channel-news-entry>)[tag]: New field.
(sexp->channel-news-entry): Accept either 'commit' or 'tag' in 'entry'
forms.
(resolve-channel-news-entry-tag): New procedure.
(channel-news-for-commit): Move 'with-repository' form one level
higher.  Call 'resolve-channel-news-entry-tag' on all the news entries.
* guix/tests/git.scm (populate-git-repository): Add clause for 'tag'.
* tests/channels.scm ("channel-news, one entry"): Create a tag and add
an entry with a tag.  Check that the tag is resolved and also visible in
the <channel-news-entry> record.
* doc/guix.texi (Channels): Mention tags in news entries.
2019-09-23 10:38:44 +02:00
Ludovic Courtès 8ba7fd3cd6
channels: Add support for a news file.
* guix/channels.scm (<channel-metadata>)[news-file]: New field.
(read-channel-metadata): Set the 'news-file' field.
(read-channel-metadata-from-source): Likewise.
(<channel-news>, <channel-news-entry>): New record types.
(sexp->channel-news-entry, read-channel-news)
(channel-news-for-commit): New procedures.
* guix/tests/git.scm (populate-git-repository): For 'add', allow
CONTENTS to be a procedure.
* tests/channels.scm ("channel-news, no news")
("channel-news, one entry"): New tests.
* doc/guix.texi (Channels): Document it.
2019-09-23 10:38:44 +02:00
Ludovic Courtès 873f6f1334
git: Add 'commit-difference'.
* guix/git.scm (commit-closure, commit-difference): New procedures.
* guix/tests/git.scm, tests/git.scm: New files.
* Makefile.am (dist_noinst_DATA): Add guix/tests/git.scm.
(SCM_TESTS): Add tests/git.scm.
2019-09-23 10:38:43 +02:00
Ludovic Courtès a78dcb3d59
git: 'update-cached-checkout' avoids network access when unnecessary.
* guix/git.scm (reference-available?): New procedure.
(update-cached-checkout): Avoid call to 'remote-fetch' when REPOSITORY
already contains REF.
2019-09-23 10:38:43 +02:00
Ludovic Courtès 961b95c985
pull: '--news' shows the list of channels added or removed.
* guix/scripts/pull.scm (display-channel, channel=?)
(display-channel-news, display-news): New procedures.
(process-query): Call 'display-news' instead of 'display-profile-news'.
2019-09-23 10:38:43 +02:00
Ludovic Courtès 660dbe6564
guix package: '--show' ignores deprecated packages.
* guix/scripts/package.scm (process-query) <'show>: Remove superseded
packages.
* tests/guix-package-aliases.sh: Add test.
2019-09-21 16:48:36 +02:00
zimoun aeb51370da
guix package: Add 'guix show' alias.
* guix/scripts/show.scm: New file.
* Makefile.am (MODULES): Add it.
* po/guix/POTFILES.in: Add it.
* tests/guix-package-aliases.sh: Add test.
* doc/guix.texi (Invoking guix package): Document it and use it in a example.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-09-21 16:48:36 +02:00
Ludovic Courtès 7150743522
inferior: Propagate '&store-protocol-error' error conditions.
Until now '&store-protocol-error' conditions raised in the inferior
would not be correctly propagated because SRFI-35 records lack a read
syntax.

Reported at <https://bugs.gnu.org/37449>
by Carl Dong <contact@carldong.me>.

* guix/inferior.scm (port->inferior): Import (srfi srfi-34) in the inferior.
(inferior-eval-with-store): Define 'error?' and 'error-message'.  Wrap
call to PROC in 'guard'.  Check the response of INFERIOR for a
'store-protocol-error' or a 'result' tag.
* tests/inferior.scm ("inferior-eval-with-store, &store-protocol-error"):
New test.
2019-09-21 16:48:36 +02:00
Efraim Flashner 3fd738f31b
import/github: Check for more version prefixes.
* guix/import/github.scm (latest-released-version): Allow the
version string to begin with the word 'version'.
2019-09-20 09:02:33 +03:00
zimoun d2cdef6560
ui: 'relevance' connects regexps with a logical and.
Fixes <https://bugs.gnu.org/36763>.
Previously, the logical and connecting the regexps did not output the expected
results (introduced in 8874faaaac).

* guix/ui.scm (relevance)
[score]: Change its arguments.
[regexp->score]: New procedure.
* tests/ui.scm ("package-relevance"): Add test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-09-19 23:24:04 +02:00
Konrad Hinsen da55110712
scripts: pull: Add options for generation management
* guix/scripts/pull.scm (%options) Add --roll-back, --switch-generation,
--delete-generations
(process-generation-change): New function
(guix-pull): Execute generation management operations

* doc/guix.texi: Document the generation management operations

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-09-18 23:08:29 +02:00
Ludovic Courtès ee25048e51
pull: Work around Ubuntu's 'sudo'.
Partly fixes <https://bugs.gnu.org/36785>.
Reported by Julien Lepiller <julien@lepiller.eu>.

* guix/scripts/pull.scm (ensure-default-profile): Do not call
'migrate-generations' when "SUDO_USER" is set.
2019-09-18 23:08:29 +02:00
Ludovic Courtès 45fbc15a48
import: pypi: Refresher recognizes pythonhosted.org source URLs.
This is a followup to a537620054.
Since that commit, 'pypi-package?' would return false for most Python
packages, and thus "guix refresh python-xxx" would report that no
updaters apply to the package.

* guix/import/pypi.scm (pypi-package?)[pypi-url?]: Recognize
"files.pythonhosted.org" URLs.
2019-09-18 23:08:29 +02:00
Ludovic Courtès f9c0400392
guix package: "guix package -f FILE" ensures FILE returns a package.
* guix/scripts/package.scm (options->installable): Add clause for
'install option with a non-package object.
* tests/guix-package.sh: Add test.
2019-09-18 23:08:28 +02:00
Efraim Flashner 74e7465c9b
Revert "build-system/r: Use %bioconductor-version."
This reverts commit 41ca406fa5.

This commit breaks 'guix pull', as reported by Hao Chen.
2019-09-16 14:34:15 +03:00
Ricardo Wurmus 41ca406fa5
build-system/r: Use %bioconductor-version.
* guix/build-system/r.scm (bioconductor-uri): Use %bioconductor-version
instead of hard-coding the version string.
2019-09-16 12:26:25 +02:00
Ricardo Wurmus 76c0b60821
import/cran: Export %bioconductor-version.
* guix/import/cran.scm (%bioconductor-version): Export it.
2019-09-16 12:26:25 +02:00
Ludovic Courtès 0074844366
pack: Provide a meaningful "repository name" for Docker.
Previously, images produced by 'guix pack -f docker' would always show
up as "profile" in the output of 'docker images'.  With this change,
'docker images' shows a name constructed from the packages found in the
image--e.g., "bash-coreutils-grep-sed".

* guix/docker.scm (canonicalize-repository-name): New procedure.
(generate-tag): Remove.
(manifest): Add optional 'tag' parameter and honor it.
(repositories): Likewise.
(build-docker-image): Add #:repository parameter and pass it to
'manifest' and 'repositories'.
* guix/scripts/pack.scm (docker-image)[build]: Compute 'tag' and pass it
as #:repository to 'build-docker-image'.
2019-09-16 10:25:31 +02:00
Ludovic Courtès 9bbaf2ae72
pack: Add packages in the order in which they appear on the command line.
* guix/scripts/pack.scm (guix-pack)[manifest-from-args](packages):
Reverse order of packages taken from OPTS.
2019-09-16 10:25:16 +02:00
Ricardo Wurmus 6e377b8893
import/utils: beautify-description: Recognize more fragments.
* guix/import/utils.scm (beautify-description): Handle additional common
initial sentence fragments in descriptions.
2019-09-14 00:37:47 +02:00
Efraim Flashner 3af85f832d
build-system/cargo: Remove unused function.
* guix/build/cargo-build-system.scm (touch): Remove it.
2019-09-13 15:20:27 +03:00