Commit graph

7035 commits

Author SHA1 Message Date
Maxim Cournoyer
756e1483c8
status: Guard against a numerical overflow condition.
Fixes <https://issues.guix.gnu.org/62766>.

* guix/status.scm (update-build): Use 0 as progress when an exception occurs
while computing it.
2023-04-10 22:20:21 -04:00
Ludovic Courtès
0f567d55de
import: opam: Tweak doc for '--repo' option.
* guix/scripts/import/opam.scm (show-help): Tweak doc for. '--repo'.
2023-04-08 23:48:00 +02:00
Csepp
ba88f0414b
import: opam: opam->guix-package: Fix default repo argument.
* guix/import/opam.scm (opam->guix-package): Make default repo a list of
strings.  Update docstring.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-04-08 23:47:21 +02:00
Ludovic Courtès
d036e1c544
svn-download: Default to non-recursive checkouts.
As it turns out, all packages that fetch code from Subversion expect it
to be non-recursive by default.  Clarify that.

Reported by Timothy Sample <samplet@ngyro.com>.

* guix/svn-download.scm (<svn-reference>)[recursive?]: Default to #f.
(<svn-multi-reference>)[recursive?]: Likewise.
2023-04-08 23:19:13 +02:00
Ludovic Courtès
adf95a810d
import: Properly report "no specific version" errors.
* guix/import/cpan.scm (latest-release): Use 'raise' instead of
'error'.
* guix/import/elpa.scm (latest-release): Likewise.
* guix/import/hackage.scm (latest-release): Likewise.
* guix/import/minetest.scm (latest-minetest-release): Likewise.
* guix/import/opam.scm (latest-release): Likewise.
* guix/import/stackage.scm (latest-lts-release): Likewise.
2023-04-08 22:54:53 +02:00
Bruno Victal
5481aaacb5
packages: Remove 'origin-sha256' procedure.
* guix/packages.scm (origin-sha256): Remove procedure.
* tests/import-utils.scm (test-import-utils)
[alist->package with explicit source]: Use content-hash-value.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-04-07 18:00:08 +02:00
Florian Pelz
89c536775d
po: Do not auto-translate cross-references to other manuals.
Reported by Gottfried at
<https://lists.gnu.org/archive/html/help-guix/2023-04/msg00000.html>.

* guix/build/po.scm (xref-regexp): Dispatch on the number of
arguments.  Ensure there is no info-manual argument or it is empty.
(translate-cross-references): Adapt to changed regexp.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-04-07 17:38:42 +02:00
Ludovic Courtès
57db09aae7
environment: Add '--nesting'.
* guix/scripts/environment.scm (show-environment-options-help)
(%options): Add '--nesting'.
(options/resolve-packages): Handle it.
(launch-environment/container): Add #:nesting? and honor it.
[nesting-mappings]: New procedure.
(guix-environment*): Add support for '--nesting'.
* guix/scripts/shell.scm (profile-cached-gc-root): Special-case
'nesting?'.
* tests/guix-environment-container.sh: Test it.
* doc/guix.texi (Invoking guix shell): Document it.
2023-04-06 18:34:15 +02:00
Nicolas Goaziou
1dcaa0fc30
guix: Shorten home page URL in texlive importer.
* guix/import/texlive.scm (tlpdb->package): Use short URL for home page.
2023-03-30 18:16:31 +02:00
Ricardo Wurmus
739c257378
import/texlive: tlpdb->package: Ignore files outside of texmf-dist.
* guix/import/texlive.scm (tlpdb->package): Ignore files outside of texmf-dist
because the code assumes that this is the prefix for all files.
2023-03-29 21:07:39 +02:00
Ricardo Wurmus
b849a47bdb
import/texlive: Process license field only when it exists.
* guix/import/texlive.scm (tlpdb->package): Check "catalogue-license" field
before using string->license.
2023-03-29 21:07:39 +02:00
Ricardo Wurmus
03a83c2906
import/texlive: Only process description if it exists.
* guix/import/texlive.scm (tlpdb->package): Run beautify-description only when
the "longdesc" field exists.
2023-03-29 21:07:39 +02:00
Ricardo Wurmus
36f78676e5
import/texlive: Ignore architecture-dependent packages.
* guix/import/texlive.scm (tlpdb->package): Filter "depend" field to exclude
package names ending on ".ARCH".
2023-03-29 21:07:39 +02:00
Maxim Cournoyer
cc7a79a8ad
Revert "lint: Append "/info/refs" to git-reference-url."
This reverts commit c9af27d4ca.

The change causes 'guix lint' to print URI not reachable (403) errors for
GitHub every URLs.
2023-03-28 22:22:50 -04:00
Felix Lechner
c9af27d4ca
lint: Append "/info/refs" to git-reference-url.
For the atftp package added in the preceeding commit, lint produced this
warning:

  gnu/packages/networking.scm:2924:5: atftp@0.8.0:
    URI https://git.code.sf.net/p/atftp/code not reachable:
      404 ("Not Found")

Thanks to Sergey Trofimov for suggesting a fix! [1]

  [1]  https://issues.guix.gnu.org/62156#3

It was implemented here, and the warning disappeared.

* guix/lint.scm (check-source): Append "/info/refs" to git-reference-url.

Co-authored-by: Sergey Trofimov <sarg@sarg.org.ru>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-03-27 18:48:53 +02:00
Ludovic Courtès
ee0ef0b58f
lint: Prevent inlining of 'package-vulnerabilities'.
* guix/lint.scm (package-vulnerabilities): Prevent inlining.
2023-03-27 18:48:52 +02:00
Ludovic Courtès
836297eae5
syscalls: 'getxattr' throws upon error.
* guix/build/syscalls.scm (getxattr): Throw in the negative SIZE case.
2023-03-27 18:48:52 +02:00
Ludovic Courtès
af91c2d540
substitute: Gracefully handle TLS termination while fetching narinfos.
Fixes <https://issues.guix.gnu.org/62476>.

* guix/substitutes.scm (call-with-connection-error-handling): Add
'gnutls-error case.
2023-03-27 18:48:51 +02:00
jgart
4e9f914680
scripts: refresh: Add -T option.
* doc/guix.texi (Invoking guix refresh): Document the -T option.
* guix/scripts/refresh.scm (%options): Add the -T flag.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-03-21 14:56:52 -04:00
Sergey Trofimov
4f63b4b86d
guix: Run check-synopsis-style with other local checks.
* guix/lint.scm (%network-dependent-checkers): Move check-synopsis-style to...
(%local-checkers): ... here.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-03-21 14:06:47 -04:00
Antero Mejr
2135f69dc0
ui: format 'display-hint' output when no arguments are passed.
When display-hint is given format specifiers such as "~%" but no arguments,
it does not format the output, causing the specifiers to be visible in the
displayed text.

* guix/ui.scm (display-hint): Format output when no arguments are passed.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-03-17 23:20:35 +01:00
Ludovic Courtès
d15dbdb79c
pack: "fakechroot" engine passes the recursive RUNPATH to ld.so.
This is a followup to 58abd58739, which
did not fully address <https://issues.guix.gnu.org/43491>.

* guix/scripts/pack.scm (wrapped-package)[build](runpath): Rewrite in
terms of 'file-needed/recursive'.
2023-03-17 23:20:35 +01:00
Ludovic Courtès
83128f00e9
read-print: 'read-with-comments' reads comments within gexps.
Fixes <https://issues.guix.gnu.org/62059>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* guix/read-print.scm (read-with-comments): Special-case #~, #$, and #+.
* tests/read-print.scm: Add two tests.
2023-03-16 23:03:18 +01:00
Christopher Baines
b59f89cf18
guix: Improve download-nar.
Previously download-nar worked with gzipped nars and queried
berlin.guix.gnu.org (also known as ci.guix.gnu.org). ci.guix.gnu.org no longer
serves gzipped nars so this is of limited use.

This commit changes download-nar to query both the default substitute servers,
and queries for lzipped rather than gzipped nars, since those are available
from both.

* guix/build/download-nar.scm (urls-for-item): Return urls for lzip rather
than gzip compression, and from both default substitute servers. The comment
about CDN's is no longer relevant.
(restore-gzipped-nar): Rename to restore-lzipped-nar and reimplement
accordingly.
(download-nar): Add progress reporting and switch to use lzip rather than
gzip.
* guix/cvs-download.scm (cvs-fetch): Replace guile-zlib with guile-lzlib.
* guix/git-download.scm (git-fetch): Replace guile-zlib with guile-lzlib.
* guix/hg-download.scm (hg-fetch): Replace guile-zlib with guile-lzlib.
* guix/android-repo-download.scm (android-repo-fetch): Add guile-lzlib for
download-nar.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2023-03-16 18:37:01 +00:00
Ludovic Courtès
0bb0eeddf6
guix: Leave some of guix/build/* unchanged.
This partially reverts ae587c2ef0 to
reduce the number of rebuilds.
2023-03-13 15:17:24 +01:00
Winter
3a7757f1fd
environment: Clear 'TERM' when checking environment.
* guix/scripts/environment.scm (child-shell-environment): Set 'TERM' to
the empty string.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-03-13 15:08:33 +01:00
Ludovic Courtès
ae587c2ef0
guix: Strip #:use-module lists.
This was obtained by setting up this environment:

  guix shell -D guix --with-input=guile@3.0.9=guile-next \
    --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2
    -- make -j5

then adding 'unused-module' to (@@ (guix build compiler) %warnings),
building, and checking all the "unused module" warnings and removing
those that were definitely unused.
2023-03-13 15:08:33 +01:00
Ludovic Courtès
eee95b5a87
packages: 'package-input-rewriting/spec' ignores hidden packages.
The primary motivation is to support things like:

  guix build guix --with-input=guile=guile-next

without triggering a rebuild of (@@ (gnu packages commencement)
guile-final) and similar things.

It is also consistent with package name resolution on the command line:
a package that cannot be named cannot be replaced.

* guix/packages.scm (package-input-rewriting/spec)[rewrite]: When P is
hidden, return it as-is.
* tests/packages.scm ("package-input-rewriting/spec, hidden package"):
New test.
* doc/guix.texi (Defining Package Variants): Update.
(Package Transformation Options): Update '--with-input' example.
2023-03-13 15:08:33 +01:00
Ludovic Courtès
5dd0d7f99f
packages: Use SRFI-71 instead of SRFI-11.
* guix/packages.scm (package-input-rewriting/spec): Use SRFI-71 'let'.
2023-03-13 15:08:33 +01:00
Simon Tournier
9fb8a480d5
packages: Consider 'patches' by 'package-direct-sources'.
* guix/packages.scm (package-direct-sources): Return 'origin' from 'patches'.
* tests/packages.scm: Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-03-13 15:08:32 +01:00
Antero Mejr
a70b9fb319
lint: Check that python-pre-commit is not an input.
pre-commit should never be a native-input of python packages, it's a
package manager for commit linting that is irrelevant to builds.

* guix/lint.scm (check-inputs-should-not-be-an-input-at-all): Add entry
for python-pre-commit.

Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-03-12 11:04:07 +01:00
Antero Mejr
6529534587
import: Add EUPL 1.1 to the SPDX license name converter.
* guix/import/utils.scm (spdx-string->license): Add EUPL-1.1 identifier.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-03-10 14:49:58 +01:00
Antero Mejr
ea2ff18238
licenses: Add LPL 1.02 (Lucent Public Licence).
* guix/licenses.scm (lpl1.02): New variable.
* guix/import/utils.scm (spdx-string->license): Add LPL-1.02 identifier.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-03-10 14:49:58 +01:00
Ludovic Courtès
79ae719ad1
build-system/gnu: Remove 'install-license-files' from '%dist-phases'.
* guix/build/gnu-dist.scm (%dist-phases): Delete 'install-license-files'.
2023-03-10 14:49:56 +01:00
Ludovic Courtès
0a37921d85
read-print: Correctly handle comments that follow a list head.
Fixes <https://issues.guix.gnu.org/61013>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* guix/read-print.scm (pretty-print-with-comments)[starts-with-line-comment?]:
New procedure.
Use it when printing a list.
* tests/read-print.scm: Add two tests.
2023-03-07 11:39:50 +01:00
Ludovic Courtès
11f6bdc547
read-print: Special-case channel-related forms.
* guix/read-print.scm (%special-forms, %newline-forms): Add
channel-related forms.
2023-03-07 11:39:50 +01:00
Maxim Cournoyer
ff5f34ae75
gnu: perl-extutils-pkgconfig: Support cross-compilation.
* guix/search-paths.scm ($PKG_CONFIG_PATH): New variable.
* gnu/packages/pkg-config.scm (%pkg-config): Use it.
* gnu/packages/perl.scm (perl-extutils-pkgconfig-for-target): New procedure.
(perl-extutils-pkgconfig): Turn into a syntax that
conditionally expands to...
(cross-perl-extutils-pkgconfig): ... this when %current-target-system is set,
or...
(%perl-extutils-pkgconfig): ... this in a native compilation context.
[arguments]: New field.
[propagated-inputs]: Turn into...
[native-inputs]: ... this.
[native-search-paths]: New field.
2023-03-06 21:27:06 -05:00
Josselin Poiret
aca64d5604
scripts: environment: Fix ordering issue with CWD and --expose.
Fixes <https://issues.guix.gnu.org/46782>.

* guix/scripts/environment.scm (launch-environment/container): Move the CWD
mapping to the front of the file system mappings.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-03-06 21:18:57 -05:00
Jelle Licht
7bbeaa87e3
build-system/guile: Expose #:scheme-file-regexp when cross-compiling
* guix/build-system/guile.scm (guile-cross-build): Accept #:scheme-file-regexp
and pass it on to builder.
2023-03-06 14:58:58 +01:00
Ludovic Courtès
58f20fa818
git-download: Apply Git attributes on checkouts coming from SWH.
Fixes a bug whereby CR/LF conversion, for instance, would not be applied
on Git repositories retrieved from SWH:

  https://sympa.inria.fr/sympa/arc/swh-devel/2023-03/msg00000.html

Reported by Simon Tournier <simon.tournier@inserm.fr>.
Suggested by Valentin Lorentz <valentin.lorentz@inria.fr>.
Co-authored by Simon Tournier <simon.tournier@inserm.fr>.

* guix/git-download.scm (git-fetch)[build]: Add Git operations conditioned by
'.gitattributes' on the result from SWH.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-03-03 12:28:22 +01:00
Ludovic Courtès
43c36c5c9f
ui: 'display-hint' quotes extra arguments for Texinfo.
Fixes <https://issues.guix.gnu.org/61201>.

Previously, common practice was to splice arbitrary strings (user names,
file names, etc.) into Texinfo snippets passed to 'display-hint'.  This
is unsafe in the general case because at signs and braces need to be
escaped to produced valid Texinfo.  This commit addresses that.

* guix/ui.scm (texinfo-quote): New procedure.
(display-hint): When ARGUMENTS is non-empty, pass it to 'texinfo-quote'
and call 'format'.
(report-unbound-variable-error, check-module-matches-file)
(display-collision-resolution-hint, run-guix-command): Remove explicit
'format' call; pass 'format' arguments as extra arguments to 'display-hint'.
* gnu/services/monitoring.scm (zabbix-front-end-config): Likewise.
* guix/scripts.scm (warn-about-disk-space): Likewise.
* guix/scripts/build.scm (%standard-cross-build-options)
(%standard-native-build-options): Likewise.
* guix/scripts/describe.scm (display-checkout-info): Likewise.
* guix/scripts/environment.scm (suggest-command-name): Likewise.
* guix/scripts/home.scm (process-command): Likewise.
* guix/scripts/home/edit.scm (service-type-not-found): Likewise.
* guix/scripts/import.scm (guix-import): Likewise.
* guix/scripts/package.scm (display-search-path-hint): Likewise.
* guix/scripts/pull.scm (build-and-install): Likewise.
* guix/scripts/shell.scm (auto-detect-manifest): Likewise.
* guix/scripts/system.scm (check-file-system-availability): Likewise.
(guix-system): Likewise.
* guix/scripts/system/edit.scm (service-type-not-found): Likewise.
* guix/status.scm (print-build-event): Likewise.
2023-02-27 23:40:43 +01:00
Simon Tournier
96739561b8
scripts: repl: Extend REPL %load-path with all channels.
Fixes <https://bugs.gnu.org/61343>.
Reported by 宋文武 <iyzsong@envs.net>.

* guix/scripts/repl.scm (define-command): Before starting the REPL,
call 'current-profile' to populate (%package-module-path).

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-02-27 15:54:09 +01:00
Ludovic Courtès
a516a0ba93
gexp: computed-file: Do not honor %guile-for-build.
This reverts commit 68775338a5.
Fixes <https://issues.guix.gnu.org/61841>.

(%guile-for-build) is a derivation for a specific system,
whereas (default-guile) is a system-independent package.  It's crucial
to preserve this distinction.

See discussion at <https://issues.guix.gnu.org/61255#29>.

* guix/gexp.scm (computed-file-compiler): Honor (default-guile),
not (%guile-for-build).
2023-02-27 15:54:09 +01:00
Ludovic Courtès
fee1d08f0d
pack: Make sure tests can run without a world rebuild.
Commit 68380db4c4 moved from
'gexp->derivation', which as a side effect, would lead tests to require
a "world rebuild"--specifically, they'd have to build (default-guile).

This was mitigated by 68775338a5, but that
change introduced another regression.

* guix/scripts/pack.scm (populate-profile-root): Define 'bootstrap?'.
Pass #:guile to 'computed-file', with a value depending on 'bootstrap?'.
* tests/pack.scm ("self-contained-tarball + localstatedir")
("docker-image + localstatedir", "squashfs-image + localstatedir")
("deb archive with symlinks and control files")
("rpm archive can be installed/uninstalled"): Use a <profile> record
instead of a derivation.
2023-02-27 15:54:09 +01:00
Lars-Dominik Braun
dc3e22f4d5
build: haskell-build-system: Build static executables by default.
This is the only way to get reasonably small binaries that don’t pull
in a ton of ghc-* packages.

* guix/build/haskell-build-system.scm (configure): Explicitly
add --enable-static and --disable-executable-dynamic, as well as
-split-sections to configure flags.
2023-02-26 10:26:16 +01:00
Lars-Dominik Braun
4bb40b098d
build-system: haskell: Drop default "static" output.
* guix/build-system/haskell.scm (lower): Pass outputs to lowered bag.
* guix/build/haskell-build-system.scm (install): Remove static library
moving code.
* gnu/packages/haskell-check.scm (ghc-hunit): Remove "static" output.
* gnu/packages/haskell-crypto.scm (ghc-crypto-api-tests): Likewise.
* gnu/packages/haskell-xyz.scm (ghc-case-insensitive): Likewise.
(ghc-cmdargs): Likewise.
(ghc-conduit): Likewise.
(ghc-fgl): Likewise.
(ghc-haskell-src-exts): Likewise.
(ghc-lib-parser): Likewise.
(ghc-mono-traversable): Likewise.
(ghc-parallel): Likewise.
(ghc-paths): Likewise.
(ghc-profunctors): Likewise.
(ghc-tf-random): Likewise.
(ghc-vector): Likewise.
2023-02-26 10:26:15 +01:00
Lars-Dominik Braun
9262c14d73
build: haskell-build-system: Remove unused linker flags.
They were inserted as-is, without expandind variables into binaries.

* guix/build/haskell-build-system.scm (configure): Remove --ghc-option.
2023-02-26 10:20:14 +01:00
Lars-Dominik Braun
39c97cf3d0
build: haskell-build-system: Process all transitive dependencies.
A bug caused install-transitive-deps to stop looping if a dependency
file already existed in the target directory. For Haskell packages
with multiple libraries (like attoparsec) this resulted in missing
dependencies and error messages like this:

    The following packages are broken because other packages they depend
    on are missing. These broken packages must be rebuilt before they
    can be used.
    installed package attoparsec-0.14.4 is broken due to missing package
    scientific-0.3.7.0-9XG3zUjXOw970JFcruv0cZ

See <https://issues.guix.gnu.org/54729#11>.

* guix/build/haskell-build-system.scm (register): Unconditionally loop
over all tails.
2023-02-26 10:20:14 +01:00
Lars-Dominik Braun
b0fc911b5b
import: haskell: Add new internal library for GHC 9.2.
* guix/import/hackage.scm (ghc-standard-libraries): Add ghc-bignum.
2023-02-26 10:20:14 +01:00
Lars-Dominik Braun
d06ae53013
import: hackage: Use upstream-name property.
* guix/import/hackage.scm (guix-package->hackage-name): Removed.
(latest-release): Use package-upstream-name* instead.
* guix/import/stackage.scm (latest-lts-release): Ditto.
(stackage-lts-package?): Ditto.
2023-02-26 10:20:14 +01:00