Commit Graph

6990 Commits

Author SHA1 Message Date
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
Lars-Dominik Braun
84549dcf38
import: hackage: Add upstream-name property.
* guix/import/hackage.scm (hackage-module->sexp): Add property
upstream-name to imported package.
* tests/hackage.scm (match-ghc-foo): Add upstream-name property.
(match-ghc-foo-6): Ditto.
(match-ghc-elif): Ditto.
(match-ghc-foo-revision): Ditto.
(match-ghc-foo-import): Ditto.
2023-02-26 10:19:36 +01:00
Lars-Dominik Braun
eb42d18180
import: stackage: Update to release 20.5.
* guix/import/stackage.scm (%default-lts-version): Update to 20.5.
2023-02-26 10:19:36 +01:00
Philip Munksgaard
3455a004ec
build: haskell-build-system: Support multiple libraries.
Fixes <https://bugs.gnu.org/53655>.

The patch handles correctly the multiple registration of some package using
their own internal sub-libraries.  It allows to call 'install-transitive-deps'
multiple times and deals with packages requiring a multiple registration.

* guix/build/haskell-build-system.scm (register)[install-transitive-deps]:
Guard also the destination direction.
[install-config-file]: New procedure.

Co-Authored-by: zimoun <zimon.toutoune@gmail.com>.
Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-02-26 10:19:35 +01:00
zimoun
29d5fb7619
build: haskell-build-system: Remove trailing #t.
* guix/build/haskell-build-system.scm (configure, install, setup-compiler,
make-ghc-package-database, install-transitive-deps, check, haddock,
patch-cabal-file, generate-setuphs): Delete trailing #t.

Signed-off-by: Lars-Dominik Braun <lars@6xq.net>
2023-02-26 10:19:35 +01:00
Lars-Dominik Braun
3e3f888dd3
import: hackage: Allow version at the beginning of cabal file.
Fix a corner case, uncovered by the hedgehog package, which has the
version field at the beginning of its cabal file. This causes a pattern
match failure.

* guix/import/hackage.scm (latest-release): Match version at beginning
of expression too.
2023-02-26 10:19:35 +01:00
Maxim Cournoyer
61f691fdfb
cpio: Properly handle Unicode characters in file names.
Fixes <https://issues.guix.gnu.org/61722>.

* guix/cpio.scm (file->cpio-header): Compute the file name length in bytes rather than in
characters.
(file->cpio-header*, special-file->cpio-header*): Likewise.
(write-cpio-archive): Likewise, and write the file name as UTF-8 bytes, not
textually, to avoid encoding it as ISO-8859-1.
2023-02-25 14:50:33 -05:00
Maxim Cournoyer
53d718f61b
offload: Increase initial SSH connection timeout.
Fixes <https://issues.guix.gnu.org/61646>.

* guix/scripts/offload.scm (open-ssh-session): Increase connection timeout
from 10 s to 30 s.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-02-24 22:03:44 -05:00
Andrew Tropin
e615aaca28
scripts: home: Move ensure-profile-directory to a better place.
The profile directory is usually created by daemon, when user opens a
connection.  Ideally, we would like to remove ensure-profile-directory call at
all, but daemon doesn't handle case with custom $GUIX_STATE_DIRECTORY yet.
More information in: <https://issues.guix.gnu.org/61717>

* guix/scripts/home.scm (process-action): Move ensure-profile-directory call
to the place, where connection to the daemon is already open.

Reported-by: wolf <wolf@wolfsden.cz>
2023-02-24 16:50:23 +04:00
Tobias Geerinckx-Rice
5d10644371
git: Make better use of the better progress bar.
Commit 189525412e introduced
‘high-resolution’ Unicode progress bars, but these require more granular
calls to reach their full potential.

* guix/git.scm (show-progress): Derive the number of PROGRESS-BAR
updates from its maximum resolution, rather than hard-coding 100.
2023-02-19 01:00:06 +01:00
Tobias Geerinckx-Rice
98e2a15b1e
git: Factor out INDEXER-PROGRESS-TOTAL-OBJECTS access.
* guix/git.scm (show-progress): Reuse the result of the first call.
2023-02-19 01:00:06 +01:00
Tobias Geerinckx-Rice
9aa750776a
ssh: Factor out progress % calculation.
* guix/ssh.scm (notify-transfer-progress): Trust its % argument.
2023-02-19 01:00:06 +01:00
Maxim Cournoyer
5e7b0a7735
pack: Add UTF-8 locales to RPM pack builder.
It's necessary as 'generate-header' call ends up calling 'find-files', which
could fail to read file names containing non-ascii characters, as spotted in
the wild:

   building /gnu/store/...-jami-rpm-pack.rpm.drv...
   find-files: ./gnu/store/...-nss-certs-3.81/etc/ssl/certs/NetLock_Arany_=Class_Gold=_F??tan??s??tv??ny.pem:
   No such file or directory

* guix/scripts/pack.scm (rpm-archive): Expand set-utf8-locale helper in the
builder gexp.
2023-02-23 06:29:09 -05:00
Maxim Cournoyer
1fee391a25
pack: Register extra /usr/share sub-directories as FHS.
* guix/rpm.scm (%fhs-directories): Add extra FHS directories.  They were found
to conflict while testing a 'guix pack' built Jami RPM.
2023-02-22 10:41:35 -05:00
Maxim Cournoyer
598f4c509b
pack: Add RPM format.
* guix/rpm.scm: New file.
* guix/scripts/pack.scm (rpm-archive): New procedure.
(%formats): Register it.
(show-formats): Add it.
(guix-pack): Register supported extra-options for the rpm format.
* tests/pack.scm (rpm-for-tests): New variable.
("rpm archive can be installed/uninstalled"): New test.
* tests/rpm.scm: New test.
* doc/guix.texi (Invoking guix pack): Document it.
2023-02-19 21:13:23 -05:00
Maxim Cournoyer
68380db4c4
pack: Extract populate-profile-root from self-contained-tarball/builder.
This allows more code to be reused between the various archive writers.

* guix/scripts/pack.scm (set-utf8-locale): New top-level procedure, extracted
from...
(populate-profile-root): New procedure, extracted from...
(self-contained-tarball/builder): ... here.  Add #:target argument.  Call
populate-profile-root.
[LOCALSTATEDIR?]: Set db.sqlite file permissions.
(self-contained-tarball): Call self-contained-tarball/builder with the TARGET
argument, and set #:local-build? to #f for the gexp-derivation call.  Remove
now extraneous #:target and #:references-graphs arguments from the
gexp->derivation call.
(debian-archive): Call self-contained-tarball/builder with the #:target
argument.  Fix indentation.  Remove now extraneous #:target and
 #:references-graphs arguments from the gexp->derivation call.
2023-02-19 21:13:23 -05:00
Maxim Cournoyer
68775338a5
gexp: computed-file: Honor %guile-for-build.
* guix/gexp.scm (computed-file-compiler): Honor %guile-for-build.
2023-02-19 21:13:22 -05:00
Maxim Cournoyer
5c099f496f
pack: Use let-keywords instead of keyword-ref.
* guix/scripts/pack.scm: (debian-archive): Bind extra-options keyword
arguments via let-keywords.
2023-02-19 21:13:22 -05:00
Julien Lepiller
189525412e
guix: Show better progress bars.
Style provides information on the characters to use before and after the
progress bar content (`[` and `]` for the ascii style), as well as the
character for filled step (`#` for ascii style).  When supported, it
provides intermediate steps.  This is used for unicode style, to show
better precision.

* guix/progress.scm (<progress-bar-style>): New record type.
(ascii-bar-style, unicode-bar-style): New variables.
(progress-bar): Draw progress depending on style.  When supported, use
unicode style.  Fall back to ascii style.
2023-02-19 10:09:15 +01:00
Ricardo Wurmus
8525c26499
import/cran: Remove directory-needs-zlib? in favor of needed-libraries-in-directory.
* guix/import/cran.scm (directory-needs-zlib?): Remove procedure.
(source-dir->dependencies): Use needed-libraries-in-directory instead of
directory-needs-zlib?.
2023-02-18 19:56:30 +01:00
Ricardo Wurmus
049cff91ac
import/cran: Add generic way to detect needed libraries.
* guix/import/cran.scm (needed-libraries-in-directory): New procedure.
(libraries-pattern, packages-for-matches): New variables.
2023-02-18 19:56:30 +01:00
Ricardo Wurmus
271c0bfcf2
import/cran: Process all vignette builders.
* guix/import/cran.scm (needs-knitr?): Remove procedure.
(vignette-builders): New procedure.
(description->package): Use vignette-builders instead of needs-knitr?.
2023-02-18 19:56:30 +01:00
Ricardo Wurmus
c0507e9f1e
import/cran: Add name mapping for libjpeg.
* guix/import/cran.scm (transform-sysname): Add mapping from libjpeg to
libjpeg-turbo.
2023-02-18 19:56:29 +01:00
Ricardo Wurmus
6ce68a7a83
import/cran: Add directory-needs-esbuild?.
* guix/import/cran.scm (directory-needs-esbuild?): New procedure.
(source-dir->dependencies): Use it.
2023-02-18 19:56:29 +01:00
Tobias Geerinckx-Rice
df5a358f67
licenses: Update NPSL (nmap licence).
The previous URL does not resolve.  The new URL contains an updated
licence text (version 0.95 at time of this commit) that is strictly less
worse than previous versions, and applies retroactively to older nmaps:

  “Versions of Nmap released under previous versions of the NPSL may
   also be used under the NPSL 0.95 terms.”
     -- <https://nmap.org/changelog>

* guix/licenses.scm (nmap): Update.
2023-02-12 01:00:00 +01:00
Pierre Langlois
dbd4d2d070
build-system: Add tree-sitter-build-system.
* guix/build-system/tree-sitter.scm: New module.
* guix/build/tree-sitter-build-system.scm: Likewise.
* Makefile.am (MODULES): Add them.
* doc/guix.texi: Document it.

Signed-off-by: Andrew Tropin <andrew@trop.in>
2023-02-12 11:32:20 +04:00
Ludovic Courtès
a68229b9a0
syscalls: 'with-file-lock' removes lock file upon exit.
Fixes <https://issues.guix.gnu.org/57501>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* guix/build/syscalls.scm (call-with-file-lock)
(call-with-file-lock/no-wait): Add call to 'delete-file' in unwind
handler.
2023-02-12 01:48:53 +01:00
Christopher Baines
7d0ebe040d
download: Add bordeaux.guix.gnu.org as a content addressed mirror.
bordeaux.guix.gnu.org now provides access to some files by hash. This is done
through the nar-herder finding a nar produced by a fixed output derivation for
the requested content, and then providing the content stored inside that nar.

I've put this new entry at the start of the list, as I think it's more likely
to have content than the others. Because bordeaux.guix.gnu.org stores nars
indefinitely, my suspicion is that it's going to be able to fulfil more
requests than ci.guix.gnu.org, which relies on the file requested being in the
store (so the now frequent garbage collection is going to limit the files
available).

* guix/download.scm (%content-addressed-mirrors): Add bordeaux.guix.gnu.org.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2023-02-11 20:34:22 +00:00
Ludovic Courtès
3ab8559436
status: Print a hint when a 'package-cache' hook fails to build.
* guix/channels.scm (package-cache-file): Add 'channels' to the #:properties
list.
* guix/status.scm (print-build-event): Upon failure, display a hint when
the derivation is a 'package-cache' hook.
2023-02-11 00:09:40 +01:00
Philip McGrath
a89aa4523b
utils: Add target-little-endian?.
* guix/utils.scm (target-little-endian?): New function.
* guix/build-system/meson.scm (make-machine-alist): Use it.
* gnu/packages/chez.scm (nix-system->pbarch-machine-type): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-02-11 00:09:40 +01:00
Ludovic Courtès
25947bbc32
build-system: Always pass #:graft? #f to 'gexp->derivation'.
Fixes <https://issues.guix.gnu.org/60947>.

Fixes a bug whereby packages referred via 'ungexp' in package arguments
would be "double-grafted": 'gexp->derivation' would first replace those
references by references to the grafted package, only to repeat the
grafting process on the result.

Build systems such as 'gnu', 'cmake', and 'pyproject' were already doing
this.  Only the rest of them is affected.

* guix/build-system/cargo.scm (cargo-build): Pass #:graft? #f to
'gexp->derivation'.
* guix/build-system/copy.scm (copy-build): Likewise.
* guix/build-system/dune.scm (dune-build): Likewise.
* guix/build-system/font.scm (font-build): Likewise.
* guix/build-system/guile.scm (guile-build): Likewise.
(guile-cross-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/ruby.scm (ruby-build): Likewise.
* guix/build-system/scons.scm (scons-build): Likewise.
* guix/build-system/texlive.scm (texlive-build): Likewise.
* guix/build-system/waf.scm (waf-build): Likewise.
2023-02-03 16:26:20 +01:00
Ludovic Courtès
52eb3db19c
container: Correctly report exit status.
* gnu/build/linux-container.scm (container-excursion): Return the raw
status value.
* tests/containers.scm ("container-excursion, same namespaces"): Add
'status:exit-val' call.
* guix/scripts/container/exec.scm (guix-container-exec): Correctly
handle the different cases.
2023-01-30 22:24:27 +01:00
Jonathan Brielmaier
3e8dd0df8c
build-system: copy: Add substitutable keyword.
* guix/build-system/copy.scm (copy-build): Add substitutable keyword.
2023-01-29 20:31:29 +01:00
Tobias Geerinckx-Rice
be97c7ed11
download: Remove dead SourceForge mirrors.
* guix/download.scm (%mirrors): Remove dl.sourceforge.net subdomains
that no longer resolve.
2023-01-22 01:01:01 +01:00
Ludovic Courtès
fed3953d70
inferior: Use 'spawn' on Guile 3.0.9+.
* guix/inferior.scm (open-bidirectional-pipe): When 'spawn' is defined,
use it instead of 'primitive-fork'.
2023-01-26 11:11:18 +01:00
Ludovic Courtès
852908d24d
ui: Add "error-reporting wrapper" for 'mkdir'.
* guix/ui.scm <top level>: Change 'mkdir' to use an error-reporting
wrapper.
2023-01-25 22:53:20 +01:00
Ludovic Courtès
e6c01420db
channels: 'channel->code' emits 'channel' field only when necessary.
* guix/channels.scm (channel->code): Emit 'commit' field only when it is
true.
2023-01-23 23:23:07 +01:00
Ludovic Courtès
a8792bc796
import: opam: Do not crash when description is missing.
Previous 'guix import opam coccinelle' would crash due to the lack of a
description.

* guix/import/opam.scm (opam->guix-package): Call 'beautify-description'
only when "description" metadata is available.
2023-01-23 23:23:07 +01:00
Maxim Cournoyer
10e51d6dde
platforms: Raise an exception when no suitable platform is found.
This was motivated by #60786, which produced a cryptic, hard to understand
backtrace.

Given the following reproducer:
    (use-modules (guix packages)
                 (gnu packages cross-base))

    (define linux-libre-headers-cross-mips64el-linux-gnuabi64
      (cross-kernel-headers "mips64el-linux-gnuabi64"))

    (package-arguments linux-libre-headers-cross-mips64el-linux-gnuabi64)

Before this change:
    ice-9/boot-9.scm:1685:16: In procedure raise-exception:
    In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f

After this change:
    ice-9/boot-9.scm:1685:16: In procedure raise-exception:
    ERROR:
      1. &platform-not-found-error: "mips64el-linux-gnuabi64"

* guix/platform.scm (&platform-not-found-error): New condition.
(platform-not-found-error?): New predicate.
(false-if-platform-not-found): New syntax.
(lookup-platform-by-system): Raise an exception when no platform is found.
Update documentation.
(lookup-platform-by-target): Likewise.
(lookup-platform-by-target-or-system): Likewise, and guard lookup calls with
false-if-platform-not-found.
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Handle
lookup-platform-by-system call to preserve existing behavior.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-01-18 20:53:15 -05:00
Ludovic Courtès
c4a8762e52
debug-link: Protect against dangling symlinks.
Fixes <https://issues.guix.gnu.org/60584>.
Reported by Greg Hogan <code@greghogan.com>
and Sébastien Rey-Coyrehourcq <sebastien.rey-coyrehourcq@univ-rouen.fr>.

* guix/build/debug-link.scm (find-elf-files): Wrap 'elf-file?' call in 'catch'.
2023-01-17 16:05:20 +01:00
Mathieu Othacehe
34c7dd7e09
build-system/meson: Add mips64el cross compilation support.
* guix/build-system/meson.scm (make-machine-alist): Add it.
2023-01-17 10:50:58 +01:00
Antero Mejr
93e683a952
scripts: repl: Add -i, --interactive flag.
* guix/scripts/repl.scm (%options): Add -i, --interactive flag.
(guix-repl): Honor -i, --interactive flag.
* doc/guix.texi (Invoking guix repl): Add documentation for -i, --interactive.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-01-16 09:00:03 -05:00
Antero Mejr
abd9569571
scripts: repl: Add --list-types flag.
* guix/scripts/repl.scm (%options): Add --list-types.
* doc/guix.texi (Invoking guix repl): Add documentation for --list-types.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-01-16 08:50:05 -05:00
Ludovic Courtès
20c923c40d
transformations: Let users know when '--with-latest' has no effect.
* guix/transformations.scm (package-with-upstream-version): Print a
message when VERSION is false and SOURCE has the same version as P.
2023-01-16 13:41:27 +01:00
Ludovic Courtès
137b91f03b
transformations: Add '--with-version'.
This is a followup to 8aeccc6240.

* guix/transformations.scm (package-with-upstream-version): New procedure.
(transform-package-latest)[package-with-latest-upstream]: Remove.
Use 'package-with-upstream-version' instead.
(transform-package-version): New procedure.
(%transformations, %transformation-options)
(show-transformation-options-help/detailed): Add '-with-version'.
* tests/transformations.scm ("options->transformation, with-version"):
New test.
* doc/guix.texi (Package Transformation Options): Document '--with-version'.
(Defining Package Variants): Mention it.
2023-01-16 13:41:27 +01:00
Ludovic Courtès
99e255d04b
guix graph: '--path' defaults to "out" in the case of multiple outputs.
Previously, "guix graph -t references --graph guix guile" would fail
with:

  no path from '/gnu/store/…-guix-1.4.0-1.9fe5b49' to '/gnu/store/…-guile-3.0.8-debug'

simply because the "debug" happened to be the first one, getting bound
to NODE2.  With this change it will instead pick the "out" output of
each.

* guix/scripts/graph.scm (guix-graph)[shorter?, length-sorted]: New
procedures.
In the 'path?' case, use the latter to store node lists.
2023-01-16 00:06:56 +01:00