Commit graph

6866 commits

Author SHA1 Message Date
Ludovic Courtès
7866294e32
deduplicate: Use 'sendfile' only with file ports.
Fixes a regression introduced in b129026e2e.

* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile'
only when INPUT' is a file port.
2022-12-10 18:13:39 +01:00
Ludovic Courtès
b129026e2e
deduplicate: Use 'sendfile' for small file copies.
* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile'
instead of 'dump-port'.
* tests/store-deduplication.scm ("copy-file/deduplicate, below %deduplication-minimum-size"):
New test.
2022-12-10 10:56:48 +01:00
Ludovic Courtès
0406df0b9b
environment: '-C' doesn't throw when the NSS is dysfunctional.
Previously, if the name service switch was dysfunctional, as can happen
on foreign distros lacking nscd, "guix shell -C" would crash with a
backtrace on the uncaught 'getpwuid' exception.  To address that, catch
the exception and deal with it gracefully.

Reported by remsd1 on #guix.

* guix/scripts/environment.scm (launch-environment/container): Wrap
'getpwuid' call in 'false-if-exception'.
2022-12-09 09:59:53 +01:00
Ludovic Courtès
754a7660a1
records: 'match-record' checks fields at macro-expansion time.
This allows 'match-record' to be more efficient (field offsets are
computed at compilation time) and to report unknown fields at
macro-expansion time.

* guix/records.scm (map-fields): New macro.
(define-record-type*)[rtd-identifier]: New procedure.
Define TYPE as a macro and use a separate identifier for the RTD.
(lookup-field, match-record-inner): New macros.
(match-record): Rewrite in terms of 'match-error-inner'.
* tests/records.scm ("match-record, simple")
("match-record, unknown field"): New tests.
* gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file'
local variable to 'main-log-file'.
* gnu/services/getmail.scm (serialize-getmail-configuration-file): Move
after <getmail-configuration-file> definition.
2022-12-08 13:21:23 +01:00
Ludovic Courtès
1b06e77108
modules: Recognize #:declarative?.
This addition has become necessary since commit
54003af85c, which makes use
of #:declarative? in modules produced by 'make-config.scm'.

Reported by zimoun <zimon.toutoune@gmail.com>.

* guix/modules.scm (extract-dependencies): Recognize #:declarative?,
which was introduced in Guile 3.0.8.
2022-12-02 23:20:54 +01:00
Ludovic Courtès
047425a662
syscalls: Adjust for lack of 'libutil.so' on glibc >= 2.34.
This is a re-implementation of 3c8b6fd94c
done in a way that works for both glibc >= 2.34 and earlier versions.

* guix/build/syscalls.scm (syscall->procedure): When LIBRARY is true,
fall back to global symbols if (dynamic-link library) fails.

(cherry picked from commit 3f6c32a88f)
2022-12-02 14:58:26 +01:00
Antero Mejr
50546f9c0c
licenses: Add EUPL 1.1.
* guix/licenses.scm (eupl1.1): New variable.

Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2022-11-26 09:07:29 +01:00
zimoun
f4a7ccc976
guix: Upgrade to Bioconductor 3.16.
* guix/build-system/r.scm (bioconductor-uri): Bump Bioconductor version to
3.16.
* guix/import/cran.scm (%bioconductor-version): Same.
2022-11-24 12:31:11 +01:00
Ludovic Courtès
d33ed58169
offload: Increase default 'overload-threshold' value.
When offloading to a single machine, the previous default value would
lead 'guix offload' to wait possibly for several minutes between
subsequent builds until normalized load would finally go below 0.6.
Increasing it mitigates that.

* guix/scripts/offload.scm (<build-machine>)[overload-threshold]: Bump
to 0.8.
* doc/guix.texi (Daemon Offload Setup): Likewise.
2022-11-23 19:34:42 +01:00
Ludovic Courtès
d07dd4ccdf
reconfigure: Use SRFI-71 instead of SRFI-11.
* guix/scripts/system/reconfigure.scm (upgrade-shepherd-services)
(channel-relations): Use SRFI-71.
2022-11-22 09:43:54 +01:00
Ludovic Courtès
b2b9571935
offload: Gracefully handle 'guix repl' protocol errors.
Fixes <https://issues.guix.gnu.org/59447>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.

Previously, if a machine had a buggy 'guix repl', 'guix offload' would
crash with a backtrace instead of just ignoring the machine.

* guix/scripts/offload.scm (remote-inferior*): New procedure.
(check-machine-availability)[if-true]: New procedure.
Use 'remote-inferior*' and 'if-true'.
(check-machine-status): Use 'remote-inferior*'.
2022-11-22 09:43:54 +01:00
Ludovic Courtès
60bea07593
inferior: Raise '&inferior-protocol-error' on invalid response.
* guix/inferior.scm (&inferior-protocol-error): New condition type.
(read-repl-response): Add default 'match' clause and raise it.
2022-11-22 09:43:54 +01:00
Vivien Kraus
9283c80e60
guix: modify-input: Recommend prepend instead of append.
* doc/guix.texi (Defining Package Variants): Document the "prepend" clause of
modify-inputs first.
* guix/packages.scm (modify-inputs): use "prepend" in the docstring.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-11-21 14:25:13 +00:00
Ludovic Courtès
82bde985f4
style: '-f' reads input files as UTF-8 by default.
Reported by mirai on #guix.

* guix/scripts/style.scm (format-whole-file): Wrap body in
'with-fluids'.  Pass #:guess-encoding to 'call-with-input-file'.
2022-11-20 23:20:31 +01:00
Ricardo Wurmus
c585b4bc68
file-systems: Always do recursive bind mounts.
Fixes <https://issues.guix.gnu.org/59185>.

* guix/build/syscalls.scm (MS_REC): New variable.
* gnu/build/file-systems.scm (mount-flags->bit-mask): Set MS_REC bit when
bind-mounting.
2022-11-20 21:27:10 +01:00
pelzflorian (Florian Pelz)
da6c6763fa
scripts: Use translations for guix.pot for service descriptions.
Previously, service descriptions appeared in both guix.pot and
packages.pot, but only translations of packages.pot were used.
Now, translations are only done with guix.pot.

This is better, because translators are more likely to translate
guix.pot, and is also easier, because files in gnu/{home/,}services
need to be in po/guix/POTFILES.in anyway and po/guix/Makevars
already acts on the 'description' keyword because of lint checkers.

* guix/scripts/home.scm (service-type-description-string):
Use translations from guix.pot.
* guix/scripts/system/search.scm (service-type-description-string)
(service-type->recutils): Likewise.
* po/packages/POTFILES.in: Move files in gnu/services to ...
* po/guix/POTFILES.in: ... here.
2022-11-20 16:01:08 +01:00
jgart
670d30972f
import: egg: Fix typo in docstring.
* gnu/import/egg.scm (Commentary): Fix typo in Commentary docstring.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-11-20 12:00:04 +00:00
jgart
b50be211c0
scripts: describe: Add branch information to recutils output.
* guix/scripts/describe.scm (channel->recutils): Add branch information.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-19 19:54:15 +01:00
jgart
f1354e7926
scripts: describe: Add branch information to json output.
* guix/scripts/describe.scm (channel->json): Add branch information.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-19 19:54:14 +01:00
Ludovic Courtès
a644c3a375
pack: Remove use of GOOPS in 'deb' backend.
* guix/scripts/pack.scm (debian-archive)[build]: Remove use of (oop goops).
Introduce 'keyword-ref' and use it instead of 'get-keyword'.
2022-11-19 19:54:14 +01:00
Philip McGrath
fd5e642513
import/utils: spdx-string->license: Support '+' operator.
Previously, '+' was supported only via special cases for deprecated
GNU identifiers like 'GPL-N+'.  This commit adds support
for other uses of '+', such as 'AFL-2.0+' and 'LPPL-1.0+'.

Strictly speaking, '+' is an operator, not part of the SPDX license
identifier, but it is useful to handle it here.

* guix/import/utils.scm (spdx-string->license): Support '+' operator.
* tests/import-utils.scm ("spdx-string->license"): Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-18 15:44:38 +01:00
Philip McGrath
07482dc051
import/utils: spdx-string->license: Match case-insensitively.
SPDX specifies that license identifiers (unlike the 'AND', 'OR', and
'WITH' operators) are matched case-insensitively.

* guix/import/utils.scm (%spdx-license-identifiers): New variable.
(spdx-string->license): Search in '%spdx-license-identifiers' using
'string-ci=?'.
* tests/import-utils.scm ("spdx-string->license"): New test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-11-18 15:44:38 +01:00
Philip McGrath
b253efef23
import/utils: spdx-string->license: Fix incorrect docstring.
The result of 'spdx-string->license' is a symbol, not a license object.

* guix/import/utils.scm (spdx-string->license): Fix docstring.
(license->symbol): Mention 'license:' prefix in docstring.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-18 15:44:38 +01:00
Tobias Geerinckx-Rice
0081807e16
guix: Replace defective freemirror.org.
This ‘mirror’ is particularly problematic because it's the only one checked
by ‘guix refresh’.

* guix/gnu-maintenance.scm (%savannah-base): Substitute freedif.org.
* guix/download.scm (%mirrors): Likewise.

Reported by sash-kan on #guix.
2022-11-13 01:00:07 +01:00
Ricardo Wurmus
4073f43cbc
import/cran: Add package mapping for freetype.
* guix/import/cran.scm (transform-sysname): Map "freetype2" to "freetype".
2022-11-16 15:43:04 +01:00
Maxim Cournoyer
788602b37f
shell: Detect --symlink spec problems early.
* guix/scripts/pack.scm (symlink-spec-option-parser): Remove extraneous
char-set.  Raise an exception when the target is an absolute file name.
(guix-pack): Move with-error-handler earlier.
* guix/scripts/shell.scm (guix-shell): Likewise.
* guix/scripts/environment.scm (guix-environment): Wrap the whole
guix-environment* call with the with-error-handling handler.
* tests/guix-environment-container.sh: Add tests.
* tests/guix-pack.sh: Adjust symlink spec.
2022-11-15 14:15:11 -05:00
Maxim Cournoyer
b31ea797ed
guix: shell: Add '--symlink' option.
* guix/scripts/pack.scm (%options): Extract symlink parsing logic to...
(symlink-spec-option-parser): ... here.
(self-contained-tarball/builder): Add a comment mentioning why a relative file
name is used for the link target.
* guix/scripts/environment.scm (show-environment-options-help): Document new
--symlink option.
(%default-options): Add default value for symlinks.
(%options): Register new symlink option.
(launch-environment/container): Add #:symlinks argument and extend doc, and
create symlinks using evaluate-populate-directive.
(guix-environment*): Pass symlinks arguments to launch-environment/container.
* doc/guix.texi (Invoking guix shell): Document it.
* tests/guix-shell.sh: Add a --symlink (negative) test.
* tests/guix-environment-container.sh: Add tests.
2022-11-15 14:15:11 -05:00
Ludovic Courtès
54003af85c
self: Mark the generation (guix config) as non-declarative.
Fixes <https://issues.guix.gnu.org/58927>.
Reported by Maxime Devos <maximedevos@telenet.be>
and Marius Bakke <marius@gnu.org>.

Starting from 076e825dc5, "guix --version"
would print "0" as the version number, due to '%guix-version' being
inlined in (guix ui) when compiling '*core-modules*' in (guix self).

* guix/self.scm (make-config.scm): Pass #:declarative? #f.
2022-11-14 12:31:33 +01:00
Ludovic Courtès
c6cb7243fb
gnu-maintenance: 'release-file?' excludes "valgrind-3.20.0.RC1.tar.bz2".
* guix/gnu-maintenance.scm (%alpha-tarball-rx): Add "." before
"(alpha|beta|...)".
* tests/gnu-maintenance.scm ("release-file?"): Add test for Valgrind.
2022-11-11 23:17:43 +01:00
Ludovic Courtès
9a35e4c5bd
gnu-maintenance: 'gnu' updater prefers tarball with same compression.
Fixes <https://issues.guix.gnu.org/59168>.

Previously 'guix build make --with-latest=make' would pick ".tar.lz",
rather than "tar.gz", because "tar.lz" happened to come first in the
<upstream-source> 'urls' field.

* guix/gnu-maintenance.scm (latest-gnu-release)[archive-type]
[better-tarball?]: New variables.
Sort TARBALLS according to BETTER-TARBALL?.
2022-11-11 23:17:43 +01:00
Ludovic Courtès
692d987d0f
upstream: Factorize 'package-archive-type'.
* guix/upstream.scm (package-archive-type): New procedure.
(package-update/url-fetch): Use it.
2022-11-11 23:17:42 +01:00
Ludovic Courtès
19206eee69
grafts: Run with a UTF-8 locale.
Fixes <https://issues.guix.gnu.org/55968>.
Reported by Maxime Devos <maximedevos@telenet.be>.

* guix/grafts.scm (%graft-with-utf8-locale?): New parameter.
(graft-derivation/shallow)[glibc-locales, set-utf8-locale]: New
variables.
[build]: Use 'set-utf8-locale'.
* tests/gexp.scm, tests/grafts.scm, tests/packages.scm: Set
'%graft-with-utf8-locale?' to #f.
2022-11-11 23:17:42 +01:00
Marius Bakke
bdfa795c98
build-system/dub: Avoid usage of (guix build syscalls).
* guix/build/dub-build-system.scm (configure): Use MKDTEMP instead of MKDTEMP!.
2022-11-11 18:09:58 +01:00
Marius Bakke
8b2a9be465
build-system/clojure: Avoid usage of (guix build sycalls).
* guix/build/clojure-build-system.scm (reset-class-timestamps): Use MKDTEMP
from Guile core instead of MKDTEMP!.
2022-11-11 18:09:58 +01:00
Marius Bakke
a6343af221
build-system/ant: Avoid usage of (guix build syscalls).
* guix/build/ant-build-system.scm (strip-jar-timestamps): Use MKDTEMP from
Guile core rather than MKDTEMP!.
* guix/build/java-utils.scm (install-jar-file-with-pom): Likewise.
2022-11-11 18:09:58 +01:00
Ricardo Wurmus
d4ec49d1da
import/cran: Add package name mapping for "booktabs".
* guix/import/cran.scm (transform-sysname): Add mapping for "booktabs".
2022-11-11 15:10:21 +01:00
Ricardo Wurmus
7d6843b631
import/cran: Add more strings to the list of invalid packages.
* guix/import/cran.scm (invalid-packages): Add "c++", "c++17", and
"posix.1-2001" to list of invalid packages.
2022-11-11 15:10:21 +01:00
(unmatched-parenthesis
a6d2ae431a
gnu: Add go-github-com-creack-pty.
* gnu/packages/golang.scm (go-github-com-creack-pty): New variable.
* guix/build-system/go.scm (go-target): Add to exported variables.

Signed-off-by: Raghav Gururajan <rg@raghavgururajan.name>
2022-11-10 23:17:18 -05:00
Ludovic Courtès
3bd4b92f55
build-system/gnu: Turn #:phases into a gexp when cross-compiling.
Previously, we'd get this error:

  $ guix build --target=aarch64-linux-gnu r-minimal -d --no-grafts
  guix build: error: path ‘/gnu/store/[^-]+-glibc-[^-]+-static’ is not valid

This is because the sexp would be passed as an input of the surrounding
gexp in 'gnu-cross-build', and thus
"/gnu/store/[^-]+-glibc-[^-]+-static" would be interpreted as a source
file name, as in this example:

  scheme@(guix gexp)> #~(foo #$(list 'whatever "/gnu/store/[^-]+-glibc-[^-]+-static"))
  $11 = #<gexp (foo #<gexp-input (whatever "/gnu/store/[^-]+-glibc-[^-]+-static"):out>) 7f098badec30>
  scheme@(guix gexp)> (gexp-inputs $11)
  $12 = (#<gexp-input "/gnu/store/[^-]+-glibc-[^-]+-static":out>)

Fixes <https://issues.guix.gnu.org/59073>.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/build-system/gnu.scm (gnu-cross-build): When PHASES is a pair,
pass it through 'sexp->gexp'.
2022-11-08 14:06:00 +01:00
Christopher Baines
da21c5d45f
build-system/linux-module: Add #:source-directory to linux-module-build-cross.
Otherwise computing cross-compilation derivations for packages (e.g. xpadneo)
using the #:source-directory argument fails with this error:

  Unrecognized keyword: #:source-directory

* guix/build-system/linux-module.scm (linux-module-build-cross): Support
 #:source-directory.
2022-11-07 20:35:40 +01:00
Efraim Flashner
97d565c786
guix gc: Add '--vacuum-database'.
* guix/scripts/gc.scm (show-help, %options): Add '--vacuum-database'.
* guix/store/database.scm (vacuum-database): New procedure.
* doc/guix.texi (Invoking guix gc): Document the option.
2022-11-06 14:02:08 +02:00
John Kehayias
905443abb7
shell: Fix '--emulate-fhs' sometimes not including 'glibc-for-fhs'.
Fixes <https://issues.guix.gnu.org/58861>.

Previously the order of the options giving to 'guix shell' could mean that the
'glibc-for-fhs' package included with the '--emulate-fhs' option would not
appear in the container.  For example, using the development option with a
package using the 'gnu-build-system', e.g. 'guix shell -CFD hello', would
include the regular 'glibc' package.  The option ordered mattered: 'guix shell
-CD hello -F' would include the expected 'glibc-for-fhs'.  We fix this by
having 'glibc-for-fhs' added to the package list just before calling
'options-with-caching' so the option order given by the user does not matter.

* guix/scripts/shell.scm (%options): Move the '--emulate-fhs' (expression
. ...) component from here...
(parse-args): ... to here.
* tests/guix-environment-container.sh: Add a test to check that
'glibc-for-fhs' is in the container even when 'glibc' is included in the 'guix
shell' package list.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-11-06 12:38:02 +01:00
Liliana Marie Prikler
2f4071b0b2
guix: ui: Add default synopsis for “doc” output.
* guix/ui.scm (package->recutils)[%default-output-synopses]: Add “doc”.
2022-11-05 10:23:24 +01:00
Liliana Marie Prikler
2c8b1be0d5
guix: ui: Improve missing output descriptions.
The current reference to Intel's Appendix H appears too obscure and confusing.

* guix/ui.scm (package->recutils)[output->recutils]: Replace “see Appendix H”
with “[description missing]”.
2022-11-05 10:23:23 +01:00
Liliana Marie Prikler
9eb80094ae
guix: ui: Handle single outputs.
The current code says "out" contains "everything else", even if there's no
other output to contain anything.

* guix/ui.scm (package->recutils)[default-output-synopses]: New variable.
[output->recutils]: Take default synopses as argument.
["outputs"]: Distinguish single and multiple outputs.
2022-11-05 10:23:23 +01:00
Timotej Lazar
fd83edf8a1
build-system/scons: Allow using a G-exp for scons-flags.
* guix/build-system/scons.scm (scons-build): Only call sexp->gexp on
scons-flags when scons-flags is a pair.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-11-03 18:08:55 +01:00
Maxim Cournoyer
b42b0e6d62
profiles: info-dir-file: Remove install-info '--silent' option.
Relates to <https://issues.guix.gnu.org/58821>.

Revert 4fef1e850e, which silenced useful
information such as the following warning:

   install-info: warning: no info dir entry in
   `/gnu/store/...-rottlog-0.72.2/share/info/rottlog.info.gz'

Rationale: profile hooks output is now hidden by default, and can be made
visible via the --verbosity option.
2022-10-27 23:34:45 -04:00
Marius Bakke
e944734ef9
build-system/pyproject: Always run tests verbosely for supported backends.
* guix/build-system/pyproject.scm (pyproject-build): Default to '() instead of
 #false for TEST-FLAGS.
* guix/build/pyproject-build-system.scm (check): Unconditionally enable
verbose test flags.
* doc/guix.texi (Build Systems): Document this change.
* gnu/packages/fontutils.scm (python-glyphslib)[arguments]: Remove verbosity
from #:test-flags.
* gnu/packages/pdf.scm (python-pydyf, weasyprint)[arguments]: Likewise.
* gnu/packages/python-web.scm (python-openapi-spec-validator)[arguments]: Likewise.
* gnu/packages/python-xyz.scm (python-path, python-tempora)[arguments]: Likewise.
2022-10-27 21:30:03 +02:00
Marius Bakke
6ef998d54e
build-system/pyproject: Adjust indentation.
* guix/build/pyproject-build-system.scm: Adjust indentation.
2022-10-27 21:30:03 +02:00
Lars-Dominik Braun
400a7a4c80
build-system: Add pyproject-build-system.
This is an experimental build system based on python-build-system
that implements PEP 517-compliant builds.

* doc/guix.texi (Build Systems): Add pyproject-build-system section.
* doc/contributing.texi (Python Modules): Mention pyproject.toml and the
PYTHON-TOOLCHAIN package, as well as differences to python-build-system.
* guix/build-system/pyproject.scm,
guix/build/pyproject-build-system.scm,
gnu/packages/aux-files/python/sanity-check-next.py,
gnu/packages/python-commencement.scm: New files.
* Makefile.am (MODULES): Register the new build systems.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add python-commencement.scm.
* gnu/packages/python.scm (python-sans-pip, python-sans-pip-wrapper): New
variables.

Co-authored-by: Marius Bakke <marius@gnu.org>
2022-10-27 19:43:06 +02:00