Commit Graph

6642 Commits

Author SHA1 Message Date
Julien Lepiller
319b8331b2
guix: self: Do not record reference to gcc-toolchain.
The ld-wrapper from gcc-toolchain records a reference to the library
path through rpath, but this is not needed.  By explicitely using rpath
flags instead, we save 150 MB of closure.

* guix/self.scm (quiet-guile): Do not record reference to gcc-toolchain.
2022-06-18 22:12:56 +02:00
Fredrik Salomonsson
c3afbd05bf
guix: emacs-utils: Add emacs-header-parse.
* guix/build/emacs-utils.scm (emacs-header-parse): New procedure.

* tests/build-emacs-utils.scm ("emacs-header-parse: fetch version",
  "emacs-header-parse: fetch keywords", "emacs-header-parse: fetch
  nonexistent author"): New tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-06-17 23:39:32 +02:00
Fredrik Salomonsson
f8275916fc
guix: emacs-utils: Add emacs-batch-script.
* guix/build/emacs-utils.scm (emacs-batch-script): New procedure.

* tests/build-emacs-utils.scm: New file.

* Makefile.am (TESTS): Add `tests/build-emacs-utils.scm'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-06-17 23:39:31 +02:00
Liliana Marie Prikler
956f0b4465
guix: Modernize renpy-build-system.
* guix/build-system/renpy.scm (build): Drop trailing #t.
(install, install-desktop-file): Likewise.  Also add inputs and use
search-input-file for /bin/sh and /bin/renpy.
2022-06-17 18:49:06 +02:00
Taiju HIGASHI
c8803d89fe
ui: Improve pager selection logic when less is not installed.
* guix/ui.scm (find-available-pager): New procedure.
(call-with-paginated-output-port): Use it.
* guix/utils.scm (call-with-environment-variables): Allow clearing of
specified environment variables.
* tests/ui.scm (make-empty-file, assert-equals-find-available-pager):
New procedures.
("find-available-pager, GUIX_PAGER takes precedence")
("find-available-pager, PAGER takes precedence")
("find-available-pager, 'less' takes precedence")
("find-available-pager, 'more' takes precedence")
("find-available-pager, no pager"): New tests.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-06-16 23:57:41 +02:00
Ludovic Courtès
925a57c5d0
shell: Fix '--export-manifest' for cached profiles and when '-p' is used.
Fixes <https://issues.guix.gnu.org/55521>.

* guix/scripts/shell.scm (export-manifest): When computing 'manifest',
honor the 'profile key.
* tests/guix-shell-export-manifest.sh: Add test.
2022-06-16 23:57:40 +02:00
Ludovic Courtès
4231031b69
shell: Do not auto-detect manifest when '-p' is used.
Previous, "guix shell -p /path/to/profile" would have manifest/guix.scm
auto-detection turned on.

* guix/scripts/shell.scm (auto-detect-manifest)[options-contain-payload?]:
Return #t for 'profile.
2022-06-16 23:57:40 +02:00
Ludovic Courtès
c8e393ffe2
packages: Change the order of %SUPPORTED-SYSTEMS.
Commit 2a34333d0c led to a couple of test
failures in tests/packages.scm and tests/lint.scm due to the different
ordering.

* guix/packages.scm (%supported-systems): Move %64BIT-SUPPORTED-SYSTEMS
first.
2022-06-16 23:57:40 +02:00
Josselin Poiret
f404112007
channels: Print backtrace when generating package cache fails.
* guix/channels.scm (package-cache-file): Add a throw handler around
the generate-package-cache call, and print backtrace in it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-06-16 12:50:06 +02:00
Ludovic Courtès
53b9c27aa5
upstream: 'package-update' reports "unknown upstream releases" errors.
Fixes <https://issues.guix.gnu.org/55987>.
Reported by John Kehayias <john.kehayias@protonmail.com>.

* guix/upstream.scm (package-update): Instead of calling
'package-latest-release*', call 'package-latest-release' and distinguish
between "up-to-date" and "unknown upstream releases".  Raise an error in
the latter case.
2022-06-15 23:49:24 +02:00
Ludovic Courtès
5c06eedf08
refresh: Switch to SRFI-71.
* guix/scripts/refresh.scm (update-package): Use SRFI-71 'let' instead
of SRFI-11 'let-values'.
2022-06-15 23:49:24 +02:00
Ludovic Courtès
5d4b189120
challenge: When using '--diff', do not attempt to chmod symlinks.
This is a followup to 2a2856d5cc.

* guix/scripts/challenge.scm (make-directory-writable): Do not call
'make-file-writable' on symlinks.
2022-06-15 23:49:23 +02:00
Hartmut Goebel
0d9f1f15cb
import: Add hex.pm importer.
hex.pm is a package repository for Erlang and Elixir.

* guix/scripts/import.scm (importers): Add "hexpm".
* guix/scripts/import/hexpm.scm, guix/import/hexpm.scm,
  guix/hexpm-download.scm: New files.
* guix/import/utils.scm (source-spec->object): Add "hexpm-fetch" to list of
  fetch methods.
* guix/upstream.scm (package-update/hexpm-fetch): New function.
  (%method-updates) Add it.
* Makefile.am: Add them.
2022-06-15 10:18:34 +02:00
Hartmut Goebel
97586ca1cb
build-system: Add 'rebar-build-system'.
* guix/build-system/rebar.scm, guix/build/rebar-build-system.scm: New files.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Update rebar-build-system section.
2022-06-15 10:17:25 +02:00
Hartmut Goebel
2f3cea45b9
Revert "Add (guix extracting-download)."
This reverts commit f63c79bf76, which was missed
when reverting the #51061 patch series for now in
a1679b74c9.
2022-06-15 10:17:24 +02:00
Ludovic Courtès
3d0749b4e3
ssh: Add #:connection-timeout parameter to 'open-ssh-session'.
* guix/ssh.scm (open-ssh-session): Add #:connection-timeout parameter
and honor it.
2022-06-15 00:25:20 +02:00
Ludovic Courtès
9be470b5d2
pull: Tweak cache directory validation code.
This is a followup to 7c52cad046.

* guix/scripts/pull.scm (guix-pull): Move cache directory validation
code to...
(validate-cache-directory-ownership): ... here.  New procedure.  Use
SRFI-71 instead of SRFI-11.  Use 'formatted-message' for the error
message, with ASCII quotation marks, and use Texinfo markup for
'&fix-hint'.
2022-06-15 00:25:17 +02:00
Tobias Geerinckx-Rice
998d9a6183
pull: Fix typo in error message.
* guix/scripts/pull.scm (guix-pull): Report the right user name/ID.
2022-06-12 02:00:00 +02:00
Ludovic Courtès
2a2856d5cc
challenge: Actually delete nars that have been extracted.
Fixes <https://issues.guix.gnu.org/55809>.
Reported by Vagrant Cascadian <vagrant@reproducible-builds.org>.

* guix/scripts/challenge.scm (make-directory-writable): New procedure.
(call-with-mismatches)[restore-file*]: New procedure.
Use it instead of 'restore-file'.
2022-06-13 12:27:34 +02:00
Efraim Flashner
2a34333d0c
guix: packages: Add %32bit-supported-systems, %64bit-supported-systems.
* guix/packages.scm (%32bit-supported-systems,
%64bit-supported-systems): New variables.
(%supported-systems): Rewrite using %32bit-supported-systems,
%64bit-supported-systems.
2022-06-12 13:50:43 +03:00
Maxim Cournoyer
8994e13b9f
least-authority: Fix typo.
* guix/least-authority.scm (least-authority-wrapper): Fix typo in doc.
2022-06-10 23:52:34 -04:00
Tobias Geerinckx-Rice
7c52cad046
pull: Fail if cache directory ownership is suspect.
New users frequently run ‘sudo guix pull’ which breaks subsequent
unprivileged ‘guix pull’s until manually fixed with chmod -R.

* guix/scripts/pull.scm (guix-pull): Fail if the cache directory (or
its innermost extant parent) is not owned by the user pulling the Guix,
with a hint about ‘sudo -i’.
2022-06-05 02:00:00 +02:00
Josselin Poiret
5011866692
guix: platform: Fix typo in lookup-platform-by-target.
* guix/platform.scm (lookup-platform-by-target): Fix typo system ->
target.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-06-08 12:02:03 +02:00
Antero Mejr
7041fe0646
packages: Add 'specifications->packages'.
* gnu/packages.scm (specifications->packages): New procedure.
* guix/scripts/home/import.scm (manifest+configuration-files->code): Use it.
* tests/home-import.scm (match-home-environment-no-services)
(match-home-environment-no-services-nor-packages)
(match-home-environment-bash-service)
(match-home-environment-bash-service-with-alias): Adjust 'packages'
field accordingly.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-06-06 22:43:30 +02:00
Lars-Dominik Braun
143141726e
import: hackage: Filter upper/mixed case dependencies too.
* guix/import/hackage.scm (filter-dependencies): Convert OWN-NAMES
to lowercase before filtering.
(hackage-module->sexp): Remove #f from OWN-NAMES, which is used for
unnamed (default) libraries.
* tests/hackage.scm (test-cabal-internal-library-ignored): Add mismatched
uppercase letters.
2022-06-06 13:26:51 +02:00
Lars-Dominik Braun
dedfcaa8e2
import: hackage: Filter internal libraries from inputs and native-inputs.
Fixes <https://issues.guix.gnu.org/54760>.

* guix/import/hackage.scm (filter-dependencies): Support multiple
OWN-NAMES.
(hackage-module->sexp): Filter OWN-NAMES from HACKAGE-DEPENDENCIES and
HACKAGE-NATIVE-DEPENDENCIES.
* tests/hackage.scm (test-cabal-internal-library-ignored): New variable.
("hackage->guix-package test internal libraries are ignored"): New testcase.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
c3fbaee345
import: cabal: Support library names
* guix/import/cabal.scm (make-cabal-parser): Add name to section.
(is-lib): Add optional name to regular expression.
(lex-rx-res): Support selecting different substring.
(lex-lib): Match 2nd substring from IS-LIB.
(lex-line): Adapt to changes for lex-lib.
(cabal-library): Add name field and export CABAL-LIBRARY-NAME.
(eval): Remove special case for 'library, which is not required any more.
(make-cabal-section): Move special case for LIBRARY.
* tests/hackage.scm (test-read-cabal-library-name): New variable.
("read-cabal test 1"): Adapt testcase to changed internal structure.
("read-cabal test: library name"): New testcase.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
e3337f35af
import: cabal: Allow curly bracket before else statement.
* guix/import/cabal.scm (is-else): Turn into procedure.
(lex-line): Move IS-ELSE…
(lex-word): …here.
* tests/hackage.scm (test-cabal-elif-brackets): Extend testcase.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
001e0bac99
import: cabal: Allow properties without space between key and value.
* guix/import/cabal.scm (lex-word): Add colon to delimiters.
* tests/hackage.scm (test-cabal-property-no-space): New variable.
("hackage->guix-package test properties without space"): New test.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
0972feaff1
import: cabal: Allow curly brackets in more positions.
* guix/import/cabal.scm (is-layout-property): Do not expect end of line.
(lex-layout-property): Check for newline.
(lex-property): Stop reading on closing curly bracket.
* tests/hackage.scm (test-read-cabal-2): New variable.
("read-cabal test: if brackets on the same line"): New test.
2022-06-06 13:26:45 +02:00
Lars-Dominik Braun
2c5d18e421
import: cabal: Support elif statement.
Fixes <https://issues.guix.gnu.org/54752>.

* guix/import/cabal.scm (make-cabal-parser): Replace if-then-else grammar case with elif-else, modify if-then accordingly.
(is-elif): New procedure.
(lex-elif): Likewise.
(is-id): Add elif keyword.
(lex-word): Add test for elif.
* tests/hackage.scm (test-cabal-if): New variale.
(test-cabal-else): Likewise.
(test-cabal-elif): Likewise.
(test-cabal-elif-brackets): Likewise.
(match-ghc-elif): Likewise.
("hackage->guix-package test lonely if statement",
"hackage->guix-package test else statement",
"hackage->guix-package test elif statement",
"hackage->guix-package test elif statement with brackets"): New tests.
2022-06-06 13:26:09 +02:00
Tobias Geerinckx-Rice
91363452f2
guix system: Don't suggest reconfiguration during reconfiguration.
* guix/scripts/system.scm (process-action):
Add 'reconfigure to the warning's guard clause.

Reported by johnjaye on #guix.
2022-05-29 02:00:00 +02:00
Ludovic Courtès
35c1edb20a
guix home: Add 'edit' sub-command.
* guix/scripts/home/edit.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/scripts/home.scm (show-help): Add "edit".
(process-command): Handle it.
(guix-home): Add it.
* po/guix/POTFILES.in: Add 'guix/scripts/home/edit.scm'.
* doc/guix.texi (Invoking guix home): Document it.
2022-06-04 12:04:24 +02:00
Ludovic Courtès
3f83c0b7c7
guix system: Add 'edit' sub-command.
* guix/scripts/system/edit.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/scripts/system.scm (show-help): Mention "edit".
(actions): Add it.
(process-command): Handle it.
* doc/guix.texi (Invoking guix system): Document it.
* po/guix/POTFILES.in: Add guix/scripts/system/edit.scm.
2022-06-04 12:04:24 +02:00
Ludovic Courtès
f9fb00ff08
edit: Extract 'spawn-editor' procedure.
* guix/scripts/edit.scm (spawn-editor): New procedure, with code from...
(guix-edit): ... here.  Use it.
2022-06-04 12:04:24 +02:00
zimoun
104b4e25ab
cache: Catch invalid 'last-expiry-cleanup'.
Fixes <http://issues.guix.gnu.org/55638>.

* guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]:
Use 'get-string-all' + 'string->number' instead of 'read'; ignore
invalid numbers.
* tests/cache.scm ("maybe-remove-expired-cache-entries, empty cache")
("maybe-remove-expired-cache-entries, corrupted cache"): New tests.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-06-04 12:04:23 +02:00
Ludovic Courtès
2acc83daa5
shell: '--export-manifest -D x -D y' generates a valid manifest.
* guix/scripts/shell.scm (manifest->code*): Add missing 'list' in
generated 'concatenate-manifests' call.
* tests/guix-shell-export-manifest.sh: Add test.
2022-06-01 22:22:19 +02:00
Tobias Geerinckx-Rice
22f56dda8e
import: minetest: Fix typo.
* guix/import/minetest.scm (important-dependencies): Fix ‘choosen’ typo.
2022-05-29 02:00:07 +02:00
Maxim Cournoyer
5d8fb87127
gnu: Remove python2-setuptools.
* gnu/packages/python-xyz.scm (python2-setuptools): Delete variable.
(python-setuptools)[properties]: Delete field.
* gnu/packages/syncthing.scm (syncthing-gtk): Delete commented native input.
* guix/lint.scm (check-inputs-should-not-be-an-input-at-all): Remove obsolete entries.
2022-05-31 14:54:16 -04:00
Maxim Cournoyer
be672f1f7f
gnu: bazaar: Obsolete with breezy.
* gnu/packages/version-control.scm (bazaar): Deprecate package.
* guix/build/bzr.scm (bzr-fetch): Adjust to use breezy; delete trailing #t.
* guix/bzr-download.scm (bzr-package): Replace bazaar by breezy.
2022-05-31 14:54:02 -04:00
Maxim Cournoyer
bec1c89891
gnu: Remove python2-mccabe.
* gnu/packages/python-xyz.scm (python2-mccabe): Delete variable.
2022-05-31 14:53:37 -04:00
Maxim Cournoyer
53cd5923ef
diagnostics: Fix typo about 0-indexed COL in location.
* guix/diagnostics.scm (source-properties->location): The location column is
0-indexed, not 1-indexed (the same as in source-properties, so the code is
accurate).
2022-05-31 14:52:14 -04:00
Maxim Cournoyer
d7c4e7a0c2
utils: Add a %guix-source-root-directory procedure.
* guix/utils.scm (%guix-source-root-directory): New procedure.
2022-05-31 14:52:14 -04:00
Maxim Cournoyer
5bc1ede862
utils: Add a 'delete-expression' procedure.
* guix/utils.scm: Fix copyright lines and order imports.
(edit-expression): Fix typo in doc.  Add a new 'include-trailing-newline?'
keyword argument.  Update doc.
(delete-expression): New procedure.
2022-05-31 14:52:13 -04:00
Maxim Cournoyer
51b6715960
packages: Fix typo in package-superseded doc.
* guix/packages.scm (package-superseded): Fix typo.
2022-05-31 14:52:13 -04:00
Ludovic Courtès
1ae0e1dc29
store: 'map/accumulate-builds' preserves caches.
Fixes <https://issues.guix.gnu.org/55721>.

Starting from the switch to functional object caches ca.
9e5812ac59, we would be losing accumulated
caches when aborting to the build handler.  This patch fixes that.

In particular, by preserving '%reference-cache-id', we avoid redundant
'query-references' RPCs, which accounted for a large part of the extra
processing time.

* guix/store.scm (build-accumulator): When returning an <unresolved>
node, call 'set-store-connection-caches!' before and after to preserve
caches.
(map/accumulate-builds): Pass STORE as the first argument to
the <unresolved> continuation.
2022-05-30 16:34:39 +02:00
Ludovic Courtès
40530ffd15
store: Record cache lookups in 'references/cached'.
* guix/store.scm (references/cached): Add call to
'record-cache-lookup!'.
2022-05-29 23:56:01 +02:00
Ricardo Wurmus
e640da33f3
Merge branch 'wip-r' 2022-05-29 11:49:03 +02:00
Ricardo Wurmus
371a83b764
scripts/import: Use pretty printer from (guix scripts style).
* guix/scripts/import.scm (guix-import): Use pretty-print-with-comments.
(newline-rewriting-port): Remove procedure.
2022-05-29 00:01:46 +02:00
Ricardo Wurmus
556ca8ba21
guix: Upgrade to Bioconductor 3.15.
* guix/build-system/r.scm (bioconductor-uri): Bump Bioconductor version to
3.15.
* guix/import/cran.scm (%bioconductor-version): Same.
2022-05-28 23:19:05 +02:00