Commit Graph

7418 Commits

Author SHA1 Message Date
Nicolas Goaziou
3f22dabc2a
guix: texlive-build-system: Improvements on non-trivial packages.
* guix/build/texlive-build-system.scm (build): Ignore temporary build files
when moving runfiles around.  Remove ".drv" source files prior to compiling
files.  Remove need for #:TEX-DIRECTORY keyword.  Handle ".ins" and ".dtx"
files in different directories.
(install): Install docfiles in "doc" output when available.
* guix/build-system/texlive.scm (texlive-build): Remove #:TEX-DIRECTORY.
* doc/guix.texi (Build Systems): Remove reference to #:TEX-DIRECTORY in
TEXLIVE-BUILD-SYSTEM documentation.  Also mention it now tries to compile
".dtx" files when there is no ".ins" file.
2023-07-18 18:10:24 +02:00
Ricardo Wurmus
eda2c23874
scripts/refresh: Remove column from spec line before sorting.
We want to sort by file and line number, but the column number messes
everything up.

This is a follow-up to commit b43841c124.

* guix/scripts/refresh.scm (guix-refresh): Trim the digits on the right of the
location string before comparing them.
2023-07-17 13:51:54 +02:00
Tobias Geerinckx-Rice
4920d11ec1
download: Remove stale Yandex GNOME mirror.
* guix/download.scm (%mirrors): Remove mirror.yandex.ru from gnome.
2023-07-09 02:00:01 +02:00
Tobias Geerinckx-Rice
c2c13e3225
download: Remove broken X.org mirrors.
These are still at <https://www.x.org/wiki/Releases/Download>, but
then that page hasn't been updated since 2018.

* guix/download.scm (%mirrors): Remove mirror.us.leaseweb.net and
x.cs.pu.edu.tw.
2023-07-09 02:00:01 +02:00
Tobias Geerinckx-Rice
158a218dea
download: Remove obsolete kernel.org mirrors.
* guix/download.scm (%mirrors): Remove kernel.osuosl.org and
mirror.linux.org.au.
2023-07-09 02:00:11 +02:00
Tobias Geerinckx-Rice
75c7f790b0
download: Remove obsolete Savannah subdirectory.
* guix/download.scm (%mirrors): Remove ‘releases-noredirect’ URL.
2023-07-09 02:00:02 +02:00
Josselin Poiret
d17879cd0d
guix: platform: Use srfi-34's raise instead of raise-exception.
* guix/platform.scm (lookup-platform-by-system)
(lookup-platform-by-target)
(lookup-platform-by-target-or-system): Use srfi-34's raise instead of
raise-exception.
2023-07-13 19:00:14 +02:00
Josselin Poiret
0dd293b4d9
gnu: Add libc-for-target and glibc/hurd.
* gnu/packages/patches/glibc-2.37-hurd-clock_t_centiseconds.patch
* gnu/packages/patches/glibc-2.37-hurd-local-clock_gettime_MONOTONIC.patch
* gnu/packages/patches/glibc-2.37-versioned-locpath.patch: New patches.
* gnu/local.mk (dist_patch_DATA): Register them.

* gnu/packages/base.scm (glibc/hurd, libc-for-target): New variables.
(glibc/hurd-headers): Use glibc/hurd.
* gnu/packages/commencement.scm (glibc-final-with-bootstrap-bash)[outputs,
source, arguments]
(glibc-final)[source]: Use libc-for-target instead of glibc.
* gnu/packages/cross-base.scm (cross-libc/deprecated, cross-libc*): Use
libc-for-target.

This part fixes

    https://issues.guix.gnu.org/63641#25

* gnu/packages/commencement.scm (%final-inputs): Change to memoized lambda
taking "system".
* gnu/packages/commencement.scm (canonical-package): Likewise, and update
user, passing (%current-system).
(make-gcc-toolchain): Update user, passing (%current-system).
* gnu/packages/base.scm (%final-inputs): Likewise.
* guix/scripts/refresh.scm (options->update-specs): Likewise.
* guix/build-system/gnu.scm (standard-packages): Add optional "system"
parameter.
(lower): Update caller.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Co-authored-by: Janneke Nieuwenhuizen <janneke@gnu.org>
2023-07-13 18:20:05 +02:00
Ludovic Courtès
9c51330315
shell: Really take system into account in the cache key.
Fixes <https://issues.guix.gnu.org/63230>.

Previously, when running "guix shell -s X ...", OPTS would contain
something like '((system . "X") ... (system . "DEFAULT")).  Thus, since
'profile-cached-gc-root' would iterate over it in this order, "DEFAULT"
would be passed to 'profile-file-cache-key' and 'profile-spec-cache-key'
instead of "X".

* guix/scripts/shell.scm (profile-cached-gc-root): Reverse OPTS before
entering 'loop'.
2023-07-13 17:20:02 +02:00
Efraim Flashner
691b97aed9
transformations: Allow tuning go packages.
* guix/transformations.scm (build-system-with-tuning-compiler): When
checking if a microarchitecture is supported by the compiler, also check
if it is a go compiler which supports that psabi.  Add a phase after
'setup-go-environment to set the go microarchitecture.
2023-07-12 16:48:28 +03:00
Efraim Flashner
1701b1244d
guix: cpu: Add gcc-architecture->micro-architecture-level mapping.
* guix/cpu.scm (gcc-architecture->micro-architecture-level): New
variable.
2023-07-12 16:48:28 +03:00
Efraim Flashner
4dd5fa9e76
guix: cpu: Refactor cpu->gcc-architecture.
* guix/cpu.scm (cpu->gcc-architecture): Refactor to wrap all the x86_64
options inside a common letrec-syntax.
2023-07-12 16:48:28 +03:00
Efraim Flashner
b93057256f
guix: cpu: Rewrite fallback for x86_64 cpu->gcc-architecture.
* guix/cpu.scm (cpu->gcc-architecture): Adjust the fallback case to use
cpu->micro-architecture-level.
2023-07-12 16:48:28 +03:00
Efraim Flashner
cb0cab2db0
guix: cpu: Add generalized CPU matching.
* guix/cpu.scm (cpu->micro-architecture-level): New variable.
2023-07-12 16:48:27 +03:00
Ricardo Wurmus
febe08ee8a
import/cran: Add one more package name transformation.
* guix/import/cran.scm (transform-sysname): Add entry for "zlib-devel".
2023-07-12 14:29:02 +02:00
Ricardo Wurmus
b43841c124
refresh: Sort update specs by package location.
Fixes <https://issues.guix.gnu.org/64358>.

* guix/scripts/refresh.scm (guix-refresh): Sort update specs by location from
bottom to top before updating packages.
2023-07-12 14:29:01 +02:00
nathan
9cf2f08852
avahi: Fix exception when #:timeout is #f.
* guix/avahi.scm (avahi-publish-service-thread): Fixes crash when timeout is
  #f, which is the default for "guix publish --advertise"

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-07-11 15:47:56 +02:00
Ludovic Courtès
fe3321f91a
cache: 'file-expiration-time' uses 'lstat', not 'stat'.
Fixes a bug whereby 'cached-channel-instance' would potentially consider
cache entries obsolete too early because they refer to items in the
store, which is mounted as 'noatime' on Guix System.

* guix/cache.scm (file-expiration-time): Use 'lstat' and
'false-if-exception' rather than 'stat'.  This matches what (guix
scripts shell) does.
2023-07-11 15:47:56 +02:00
Ludovic Courtès
e1c2c2f042
locate: Ignore unreadable manifests.
Fixes <https://issues.guix.gnu.org/64187>.

* guix/scripts/locate.scm (profiles->manifest-entries): Wrap
'profile-manifest' in 'false-if-exception'.

Reported-by: Ricardo Wurmus <rekado@elephly.net>
2023-07-11 15:47:55 +02:00
Ludovic Courtès
0ae419877c
avahi: Poll less.
* guix/avahi.scm (avahi-publish-service-thread): Have #:timeout default
to #f when 'stop-loop?' is NEVER, or 500ms.
(avahi-browse-service-thread): #:timeout defaults to 500ms when
'stop-loop?' is provided.
2023-07-07 15:30:21 +02:00
Efraim Flashner
c7eed71681
guix: git: Set initial branch name for git-fetch.
This removes the 'hint' about choosing a branch name when creating a new
git repository.

* guix/build/git.scm (git-fetch): When running 'git init' add an initial
branch name.
2023-07-05 18:57:29 +03:00
Lars-Dominik Braun
37c2e94cec
guix: node-build-system: Delete from peerDependencies too.
The current version of npm in Guix installs peerDependencies by default,
whereas previously it would just warn about missing/wrong packages.

Fixes <https://issues.guix.gnu.org/issue/64203>.

* guix/build/node-build-system.scm (delete-dependencies): Remove supplied
dependencies from peerDependencies field too.
2023-06-22 12:54:19 +02:00
Ludovic Courtès
1b7aabbc79
Add 'guix locate'.
* guix/scripts/locate.scm, tests/guix-locate.sh: New files.
* Makefile.am (MODULES): Add 'guix/scripts/locate.scm'.
(SH_TESTS): Add 'tests/guix-locate.sh'.
* po/guix/POTFILES.in: Add it.
* doc/guix.texi (Invoking guix locate): New node.

Co-authored-by: Antoine R. Dumont <antoine.romain.dumont@gmail.com>
2023-06-18 23:44:29 +02:00
Ludovic Courtès
1261ce1523
store: Tolerate non-existent GC root directories.
* guix/store/roots.scm (gc-roots): Wrap 'scandir*' call in 'catch'.
* tests/store-roots.scm ("gc-roots, initial"): New test.  Move
'open-connection' call below.
2023-06-18 23:36:25 +02:00
Janneke Nieuwenhuizen
ff690faf66
gnu: Use target-hurd?, system-hurd? instead of hurd-target?, hurd-system?.
* gnu/packages/hurd.scm (hurd-target?): Remove.
(hurd-system?): Move to...
* guix/utils.scm (system-hurd?): ...here.
* gnu/packages/*: Update all users, removing (gnu packages hurd) include where
now unused.
2023-06-17 14:38:32 +02:00
Ludovic Courtès
248cf06149
avahi: Resolve hosts for which name resolution fails.
This avoids attempts to connect to hosts that went off-line.  This is
particularly important for 'guix-daemon --discover', which would so far
keep attempting to talk to LAN hosts after they vanished just because
their mDNS record hasn't expired, leading to significant delays when
fetching narinfos and substitutes.

* guix/avahi.scm (avahi-browse-service-thread)[service-resolver-callback]:
Add handler to RESOLVER-EVENT/FAILURE.
2023-06-16 00:14:52 +02:00
Ludovic Courtès
99a27d361e
guix home: Add missing SRFI-34 import for 'raise'.
Reported at <https://issues.guix.gnu.org/64031>.

* guix/scripts/home.scm: Use (srfi srfi-34), expected by
'list-generations'.

Reported-by: Steven Roose <steven@roose.io>
2023-06-16 00:14:52 +02:00
Ludovic Courtès
a3beb8d741
pull: Preserve channel ordering when using '--commit', '--url', etc.
Previously using '--url', '--commit', or '--branch' would move the
'guix' channel to the front.  This is okay in itself but it gratuitously
leads to a different cache key in 'cached-channel-instance'--IOW, 'guix
time-machine --commit=X' where X is already in cache would gratuitously
recompute the channel derivations.

* guix/scripts/pull.scm (channel-list): Use 'map' instead of 'find' +
'remove' + 'cons'.
2023-06-16 00:14:52 +02:00
Ludovic Courtès
e4259d4e9e
packages: 'package-transitive-supported-systems' detects cycles.
With this change, commands such as 'guix build' or 'guix package' report
obvious package-level cycles upfront.  Derivation-level cycles are not
detected.

* guix/packages.scm (&package-cyclic-dependency-error): New condition
type.
(package-transitive-supported-systems): Define 'visited', check it, and
parameterize it.
* guix/ui.scm (call-with-error-handling): Handle
'&package-cyclic-dependency-error'.
* tests/packages.scm ("package-transitive-supported-systems detects
cycles"): Add test.
2023-06-14 22:54:30 +02:00
Ricardo Wurmus
4699de59ff
import/cran: Add another clause for ASL 2.0.
* guix/import/cran.scm (string->license): Add clause for >= 2.0.
2023-06-14 14:09:35 +02:00
Timothy Sample
e6da6e3152
svn-download: Do not expand keywords.
Subversion keyword expansion is potentially non-reproducible as some of
them expand time strings relative to the local time zone:

  https://issues.guix.gnu.org/43442#18

In practice this is not a problem in Guix since Subversion checkouts
happen in an isolated environment using the "default timezone" (UTC).

However, Software Heritage disables keyword expansion for this very
reason.  By following suit, we make sure content can be retrieved from
there.

* guix/build/svn.scm (svn-fecth): Pass "--ignore-keywords" to
Subversion.
* guix/build-system/texlive.scm (%texlive-date): New variable.
* gnu/packages/java.scm (java-geronimo-xbean-reflect)
(java-geronimo-genesis-2.1): Update the source hash.
* gnu/packages/machine-learning.scm (ghmm): Likewise.
* gnu/packages/video.scm (libsmpeg, libsmpeg-with-sdl1): Likewise.
* gnu/packages/tex.scm (texlive-bin): Update the hash of the
"texlive-scripts" input, and a add a new phase that imitates
Subversion keyword expansion for scripts that need it.
(texlive-latex-base): Update the hash of the "texlive-luatexconfig"
native input.
(texlive-hyphen-base, texlive-dvipdfmx, texlive-dvips, texlive-cm)
(texlive-tex-plain, texlive-kpathsea, texlive-latexconfig)
(texlive-tetex, texlive-pdftex, texlive-xetex): Update the source
hash.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-06-11 18:13:44 +02:00
Ludovic Courtès
1c9e992e8c
records: Remove "guix" from error message.
* guix/records.scm (map-fields): Tweak error message.
2023-06-09 14:19:14 +02:00
Ludovic Courtès
53bf9fba0c
tests: Ensure 'elpa' test does not access the network.
Previously it would try to access the real elpa.gnu.org.  This would
succeed when network is available because "taxy-magit-section" is an
existing package.

* guix/import/elpa.scm (elpa-repository)
(package-from-elpa-repository?): Recognize 'gnu/http.
* tests/elpa.scm ("package-latest-release"): Use 'http' instead of
'https'.  Change "taxy-magit-section" to "fake-taxy-magit-section".
2023-06-09 14:19:14 +02:00
Ludovic Courtès
df8b3821a8
import: stackage: Updater resolves inputs lazily.
Fixes the "haskell-stackage" test in 'tests/lint.scm', which started
failing with e6223017d9 because the extra
HTTP GETs induced by the 'haskell-fetch' calls would fail.

* guix/import/stackage.scm (latest-lts-release): Call 'hackage-fetch'
and its continuation from within 'inputs', which is delayed.  Pass it
NAME-VERSION instead of HACKAGE-NAME-VERSION.
2023-06-09 14:19:14 +02:00
Ludovic Courtès
885d524f79
substitute: Gracefully retry after failed partial downloads.
Fixes <https://issues.guix.gnu.org/63443>.
Reported by Attila Lendvai <attila@lendvai.name>.

* guix/scripts/substitute.scm (catch-system-error): New macro.
(download-nar): Add call to 'delete-file-recursively'.
* tests/substitute.scm ("substitute, previous partial download around"):
New test.
2023-06-08 22:54:58 +02:00
Ludovic Courtès
3f5e141829
substitute: Delete cached narinfos more than two-month old.
This allows 'guix substitute' to shrink the cache a bit more, which
saves space and improves performance of cache-cleanup phases since fewer
entries need to be traversed.

* guix/scripts/substitute.scm (cached-narinfo-expiration-time): Define
'max-ttl' and use it as an upper bound.
2023-06-08 22:27:20 +02:00
Ludovic Courtès
92ee0fd5eb
import: Gracefully handle EPIPE.
Previously, "guix import pypi f3 | head -3" would print a backtrace.

* guix/scripts/import.scm (guix-import): Wrap
'pretty-print-with-comments' call in 'leave-on-EPIPE'.
2023-06-08 22:06:00 +02:00
Ludovic Courtès
dc0c5d56ee
records: Use SRFI-11 instead of SRFI-71, for Guile 2.0 compatibility.
This fixes a failure of 'tests/packages.scm' introduced in
b88e38d4b5: some of the tests import (guix
records) on the build side, which uses '%bootstrap-guile' (Guile 2.0)
where SRFI-71 is unavailable.

* guix/records.scm (match-record-inner): Use SRFI-11 instead of SRFI-71.
2023-06-06 11:54:39 +02:00
Ricardo Wurmus
a025d8fee6
import/cran: Ensure current package is not among inputs.
* guix/import/cran.scm (cran-package-inputs): Remove the current package from
the result.
2023-06-05 18:55:11 +02:00
Josselin Poiret
cacc0cb6ab
channels: Raise an error if dependency's introduction is malformed
* guix/channels.scm (sexp->channel-introduction): Do it.
2023-06-04 11:30:18 +02:00
Josselin Poiret
80d1228321
build-system: New agda-build-system.
* guix/build-system/agda.scm: New file.
* guix/build/agda-build-system.scm: New file.
* Makefile.am (MODULES): Register them.
* doc/guix.texi (Build Systems): Add documentation for agda-build-system.
2023-06-04 10:59:34 +02:00
Josselin Poiret
0769a9b3c5
build-system/haskell: Export default-haskell.
* guix/build-system/haskell.scm: Export default-haskell.
2023-06-04 10:59:33 +02:00
Josselin Poiret
f045c7ac80
records: match-record: Do not show internal form.
* guix/records.scm (lookup-field+wrapper): Attach source properties to the
field syntax object instead.
2023-06-04 10:59:28 +02:00
(unmatched-parenthesis ew syntax
4cd5293621
records: Add MATCH-RECORD-LAMBDA.
* guix/records.scm (match-record-lambda): New syntax.
* tests/records.scm ("match-record-lambda"): New test.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-06-04 10:59:25 +02:00
(unmatched-parenthesis d
b88e38d4b5
records: match-record: Support thunked and delayed fields.
* guix/records.scm (match-record): Unwrap matched thunked and delayed fields.
* tests/records.scm ("match-record, thunked field",
"match-record, delayed field"): New tests.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-06-04 10:34:35 +02:00
(unmatched-parenthesis
1a4aace3af
records: match-record: Raise a syntax error if TYPE is nonexistent.
* guix/records.scm (match-record): Raise a human-compherensible syntax error
  if the given record type identifier is unbound.

Co-authored-by: Josselin Poiret <dev@jpoiret.xyz>
Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-06-04 10:34:33 +02:00
Ludovic Courtès
69dfdb7bd1
environment: Fix unbound-variable bug with '--symlink'.
Fixes <https://issues.guix.gnu.org/63845>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

* guix/scripts/environment.scm (launch-environment/container): Reference
'evaluate-populate-directive' before calling 'call-with-container'.
2023-06-02 16:57:17 +02:00
Ludovic Courtès
0a8f53d61b
read-print: Add 'package/inherit' special form.
* guix/read-print.scm (%special-forms): Add 'package/inherit'.
2023-06-02 15:47:27 +02:00
Ludovic Courtès
acef4cecf9
ci: Reify the timestamps of evaluations.
* guix/ci.scm (<evaluation>)[start-time, checkout-time,
completion-time]: New fields.
2023-06-02 15:47:27 +02:00
Ricardo Wurmus
c2f0ce73a7
import/cran: string->license: Add another case for GPLv3+.
* guix/import/cran.scm (string->license): Translate "GPL (>=3)" to gpl3+.
2023-06-02 12:52:22 +02:00
Ricardo Wurmus
cbbb619ddb
import/cran: Libraries should not use CRAN-GUIX-NAME.
* guix/import/cran.scm (source-dir->dependencies): Do not use CRAN-GUIX-NAME
when processing result of NEEDED-LIBRARIES-IN-DIRECTORY.
2023-06-02 12:49:25 +02:00
Ricardo Wurmus
67183e25ad
import/cran: Also search Makevars file for libraries.
* guix/import/cran.scm (needed-libraries-in-directory): Look at Makevars in
addition to Makevars.in for libraries.
2023-06-02 12:48:42 +02:00
Ludovic Courtès
57ceb64e34
upstream: Honor package properties for ignored and extra inputs.
* guix/upstream.scm (update-package-inputs)[filtered-inputs]
[regular-inputs, native-inputs, propagated-inputs]: New procedures.
Use them in 'update-field' calls.
* tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add "libreoffice"
to the dependencies of "the-test-package".  Add 'updater-ignored-inputs'
property to "the-test-package".
* doc/guix.texi (Invoking guix refresh): Document it.
2023-05-31 23:25:26 +02:00
Ludovic Courtès
9e237fe0bd
import: gem: Updater provides input list.
* guix/import/gem.scm (import-release): Add 'inputs' field.
* tests/gem.scm ("package-latest-release"): New test.
2023-05-31 23:25:26 +02:00
Ludovic Courtès
e6f82fcd5f
import: gem: Factorize "bundler" special case for name mapping.
* guix/import/gem.scm (ruby-package-name): Add "bundler" special case.
(gem->guix-package): Adjust accordingly.
* tests/gem.scm ("gem-recursive-import")
("gem-recursive-import with a specific version"): Remove "ruby-bundler"
from the expected packages.
2023-05-31 23:25:26 +02:00
Ludovic Courtès
d46d1bee1e
import: elpa: Updater provides input list.
* guix/import/elpa.scm (elpa-dependency->upstream-input): New
procedure.
(latest-release): Add 'inputs' field.
* tests/elpa.scm ("package-latest-release"): New test.
2023-05-31 23:25:26 +02:00
Ludovic Courtès
a738c1a0c7
import: cpan: Updater provides input list.
* guix/import/cpan.scm (latest-release): Add 'inputs' field.
* tests/cpan.scm ("package-latest-release"): New test.
2023-05-31 23:25:25 +02:00
Ludovic Courtès
c4fe4e7eb8
import: cpan: Represent dependencies as <upstream-input> records.
* guix/import/cpan.scm (cpan-name->downstream-name)
(cran-dependency->upstream-input, cran-module-inputs): New procedures.
(cpan-module->sexp)[guix-name, convert-inputs]: Remove.
[maybe-inputs]: Adjust to deal with <upstream-input>.
Use 'cpan-name->downstream-name' instead of 'guix-name'.  Add call to
'cpan-module-inputs' and adjust calls to 'maybe-inputs'.  No longer emit
input labels.
* tests/cpan.scm ("cpan->guix-package"): Adjust test accordingly.
2023-05-31 23:25:25 +02:00
Ludovic Courtès
f13e73df10
import: cpan: Remove unary 'string-append' call.
* guix/import/cpan.scm (package->upstream-name): Remove useless
'string-append'.
2023-05-31 23:25:25 +02:00
Ludovic Courtès
cd262c403f
upstream: Remove <upstream-input-change> and related code.
* guix/upstream.scm (<upstream-input-change>): Remove.
(changed-inputs): Remove.
* tests/upstream.scm (test-package, test-new-package)
("changed-inputs returns no changes")
("changed-inputs returns changes to plain input list")
("changed-inputs returns changes to all plain input lists"): Remove.
2023-05-31 23:25:25 +02:00
Ludovic Courtès
ec0a2fc87b
upstream: 'update-package-source' edits input fields.
Previously, 'guix refresh r-ggplot2 -u' and similar commands would print
of list of input changes that would have to be made manually.  With this
change, 'guix refresh -u' takes care of updating input fields
automatically.

* guix/upstream.scm (update-package-inputs): New procedure.
(update-package-source): Call it when 'upstream-source-inputs' returns
true.
* guix/scripts/refresh.scm (update-package): Remove iteration over the
result of 'changed-inputs'.
* guix/import/test.scm (available-updates): Add support for input
lists.
* tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add input list for
"the-test-package".
Make sure 'guix refresh -u' updates 'inputs' accordingly.
* doc/guix.texi (Invoking guix refresh): Mention it.
2023-05-31 23:25:25 +02:00
Ludovic Courtès
9f3ea03516
diagnostics: Factorize 'absolute-location'.
* guix/scripts/style.scm (absolute-location): Move to...
* guix/diagnostics.scm (absolute-location): ... here.
* guix/upstream.scm (update-package-source): Use it.
2023-05-31 23:25:25 +02:00
Ludovic Courtès
e6223017d9
upstream: Replace 'input-changes' field by 'inputs'.
Returning the expected list of inputs rather than changes relative to
the current package definition is less ambiguous and offers more
possibilities for further processing.

* guix/upstream.scm (<upstream-source>)[input-changes]: Remove.
[inputs]: New field.
(<upstream-input>): New record type.
* guix/upstream.scm (upstream-input-type-predicate)
(input-type-filter, upstream-source-regular-inputs)
(upstream-source-native-inputs, upstream-source-propagated-inputs): New
procedures.
(changed-inputs): Expect an <upstream-source> as its second argument.
Adjust accordingly.
* guix/import/pypi.scm (distribution-sha256): New procedure.
(maybe-inputs): Expect a list of <upstream-input>.
(compute-inputs): Rewrite to return a list of <upstream-input>.
(pypi-package-inputs, pypi-package->upstream-source): New procedures.
(make-pypi-sexp): Use it.
* guix/import/stackage.scm (latest-lts-release): Define 'cabal'.
Replace 'input-changes' field by 'inputs'.
* guix/scripts/refresh.scm (update-package): Use 'changed-inputs'
instead of 'upstream-source-input-changes'.
* tests/cran.scm ("description->package"): Adjust order of inputs.
* tests/pypi.scm (default-sha256, default-sha256/base32): New variables.
(foo-json): Add 'digests' entry.
("pypi->guix-package, no wheel"): Check HASH against DEFAULT-SHA256/BASE32.
("pypi->guix-package, wheels"): Likewise.
("pypi->guix-package, no usable requirement file."): Likewise.
("pypi->guix-package, package name contains \"-\" followed by digits"):
Likewise.
("package-latest-release"): New test.
* tests/upstream.scm (test-package-sexp): Remove.
("changed-inputs returns no changes"): Rewrite to use <upstream-source>.
(test-new-package-sexp): Remove.
("changed-inputs returns changes to plain input list"): Rewrite.
("changed-inputs returns changes to all plain input lists"): Likewise.
("changed-inputs returns changes to labelled input list")
("changed-inputs returns changes to all labelled input lists"): Remove.
* guix/import/cran.scm (maybe-inputs): Expect PACKAGE-INPUTS to be a
list of <upstream-input>.
(source-dir->dependencies): Return a list of <upstream-input>.
(vignette-builders): Likewise.
(uri-helper, cran-package-source-url)
(cran-package-propagated-inputs, cran-package-inputs): New procedures.
(description->package): Use them instead of local definitions.
(latest-cran-release): Replace 'input-changes' field by 'inputs'.
(latest-bioconductor-release): Likewise.
(format-inputs): Remove.
* guix/import/hackage.scm (cabal-package-inputs): New procedure.
(hackage-module->sexp): Use it.
[maybe-inputs]: Expect a list of <upstream-input>.
2023-05-31 23:25:24 +02:00
Ludovic Courtès
e7910f4882
import: json: Add #:timeout to 'json-fetch'.
* guix/import/json.scm (json-fetch): Add #:timeout and pass it to
'http-fetch'.
2023-05-31 23:25:24 +02:00
Ludovic Courtès
4663cfd381
import: utils: 'call-with-networking-exception-handler' doesn't unwind.
That way backtraces show where the error actually originates from.

* guix/import/utils.scm (call-with-networking-exception-handler):
Rewrite using 'with-exception-handler'.
2023-05-31 23:25:24 +02:00
Ludovic Courtès
d2f36abd02
tests: pypi: Rewrite tests using a local HTTP server.
* guix/import/pypi.scm (%pypi-base-url): New variable.
(pypi-fetch): Use it.
* tests/pypi.scm (foo-json): Compute URLs relative to '%local-url'.
(test-json-1, test-json-2, test-source-hash): Remove.
(file-dump): New procedure.
(with-pypi): New macro.
("pypi->guix-package, no wheel")
("pypi->guix-package, wheels")
("pypi->guix-package, no usable requirement file.")
("pypi->guix-package, package name contains \"-\" followed by digits"):
Rewrite using 'with-pypi'.
2023-05-31 23:25:24 +02:00
Ludovic Courtès
09526da78f
tests: http: Allow responses to specify a path.
* guix/tests/http.scm (%local-url): Add #:path parameter and honor it.
(call-with-http-server)[responses]: Add extra clause with 'path'.
[bad-request]: New variable.
[server-body]: Handle three-element clauses.
Wrap 'run-server' call in 'parameterize'.
2023-05-31 23:25:24 +02:00
Ludovic Courtès
d0be53d03e
transformations: Add "--tune" to "--help-transform".
* guix/transformations.scm (show-transformation-options-help/detailed):
Add '--tune'.
2023-05-31 23:24:33 +02:00
Remco van 't Veer
782d806c3a
guix gc: Round MiBs in user feedback.
* guix/scripts/gc.scm (guix-gc): Round MiBs in user feedback.

Signed-off-by: Florian Pelz <pelzflorian@pelzflorian.de>
2023-05-31 22:45:35 +02:00
Ludovic Courtès
8af9a2aa5f
substitute: If a server's nar URL is 404, try the next one(s).
If a substitute server advertises in its narinfo, for example, both a
/zstd and a /lzip URL but the /zstd URL is unreachable, try the /lzip
URL.

Fixes <https://issues.guix.gnu.org/63634>.

* guix/narinfo.scm (narinfo-preferred-uris): New procedure.
(narinfo-best-uri): Rebase on top of it.
* guix/scripts/substitute.scm (download-nar)[try-fetch]: New procedure.
Use 'narinfo-preferred-uris' and 'try-fetch' to attempt all the URLs of
NARINFO.
* tests/substitute.scm (request-substitution): Remove 'parameterize'.
Delete DESTINATION.
("substitute, preferred nar URL is 404, other is 200"): New test.
2023-05-30 00:15:29 +02:00
Ludovic Courtès
ca1ea6373a
self: Install 'guix-daemon.cil'.
* guix/self.scm (selinux-policy): New procedure.
(miscellaneous-files): Add 'daemon' parameter.  Add 'guix-daemon.cil'.
(compiled-guix): Adjust call to 'miscellaneous-files'.
2023-05-25 12:51:16 +02:00
Ludovic Courtès
9fa92acbf0
self: Build against "graphviz-minimal".
Fixes <https://issues.guix.gnu.org/63050>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/self.scm (%packages): Change "graphviz" to refer to
"graphviz-minimal".  Add "font-ghostscript".
(info-manual): Define 'font-ghostscript'.
[build]: Set XDG_DATA_DIRS.
2023-05-24 15:04:00 +02:00
Ludovic Courtès
3f59fd6d11
substitute: Rethrow with 'raise-exception', not 'throw'.
Rethrowing with 'throw' doesn't work as intended when the exception
being rethrown is a SRFI-34 exception.

Fixes <https://issues.guix.gnu.org/55820>.

* guix/scripts/substitute.scm (kind-and-args-exception?): New variable.
(call-with-cached-connection): Rewrite using 'guard' instead of 'catch'
and 'raise' instead of 'throw'.
(system-error?): Use 'kind-and-args-exception?' instead of local
definition.
2023-05-22 17:05:22 +02:00
Ludovic Courtès
ba5da5125a
style: Add 'arguments' styling rule.
* guix/scripts/style.scm (unquote->ungexp, gexpify-argument-value)
(quote-argument-value, gexpify-argument-tail)
(gexpify-package-arguments): New procedures.
(%gexp-keywords): New variable.
(%options): Add "arguments" case for 'styling-procedure.
(show-stylings): Update.
* tests/style.scm ("gexpify arguments, already gexpified")
("gexpify arguments, non-gexp arguments, margin comment")
("gexpify arguments, phases and flags")
("gexpify arguments, append arguments")
("gexpify arguments, substitute-keyword-arguments")
("gexpify arguments, append substitute-keyword-arguments"): New tests.
* doc/guix.texi (package Reference): For 'arguments', add compatibility
note and link to 'guix style'.
(Invoking guix style): Document the 'arguments' styling rule.
2023-05-18 20:01:32 +02:00
Ludovic Courtès
cd08d64b3a
refresh: Honor '--key-server'.
Previously, the '--key-server' option would be ignored in an invocation
like:

  ./pre-inst-env guix refresh python-scipy=1.8.1 -t pypi -u \
     --key-server=pgp.mit.edu

* guix/upstream.scm (download-tarball): Add #:key-server parameter and
pass it to 'gnupg-verify*'.
(package-update/url-fetch, package-update/git-fetch)
(package-update): Likewise.
* guix/scripts/refresh.scm (update-package): Add #:key-server and pass
it down to 'package-update'.
(guix-refresh): Pass #:key-server to 'update-package'.
2023-05-18 19:20:58 +02:00
Simon Tournier
d81701a85a
scripts: import: elpa: Return consistent error code.
Fixes <https://bug.gnu.org/58308>.
Reported by Ricardo Wurmus.

* guix/scripts/import/elpa.scm (guix-import-elpa): Return consistent error
code independently of the 'recursive' option.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-05-17 22:22:22 +02:00
Simon Tournier
b89ab866bc
scripts: import: elpa: Warn when version is specified.
* guix/scripts/import/elpa.scm (guix-import-elpa): Warn when version is
specified.

Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
2023-05-17 22:22:21 +02:00
Ludovic Courtès
3186a52e11
download: Refer to the 'guile-gnutls' package and not 'gnutls'.
This reinstates c625e5b64d, which was
reverted due to a circular dependency:

  https://issues.guix.gnu.org/63331

This is a followup to 305794762c, which
removed Guile bindings from 'gnutls'.

* guix/android-repo-download.scm (android-repo-fetch): Refer to
'guile-gnutls instead of 'gnutls.
* guix/cvs-download.scm (cvs-fetch): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/hg-download.scm (hg-fetch): Likewise.
2023-05-11 13:23:08 +02:00
Efraim Flashner
649ce7b433
Merge branch 'rust-team' 2023-05-09 09:56:33 +03:00
Efraim Flashner
1bb29cd49c
gnu: gcc: Update cpu tuning architectures.
* gnu/packages/gcc.scm (%gcc-7.5-armhf-micro-architectures): Add missing
micro-architecture.
(%gcc-10-armhf-micro-architectures): Adjust accordingly.
(%gcc-11-aarch64-micro-architectures): Add missing micro-architecture.
(%gcc-12-aarch64-micro-architectures, %gcc-12-armhf-micro-architectures,
%gcc-12-x86_64-micro-architectures, %gcc-13-aarch64-micro-architectures,
%gcc-13-armhf-micro-architectures, %gcc-13-x86_64-micro-architectures):
New variables.
(gcc-12)[properties]: Use new compiler-cpu-architectures.
* guix/cpu.scm (cpu->gcc-architecture): Update entries for Intel, AMD,
x86_64 fallback and aarch64.
2023-05-09 09:52:24 +03:00
Efraim Flashner
f4c3f2be94
gnu: rust: Update to 1.67.
* gnu/packages/rust.scm (rust): Update to 1.67.
[arguments]: Add a phase to skip tests requiring mercurial. Extend the
custom 'patch-process-tests phase.
(rust-1.64)[arguments]: Adjust 'patch-cargo-checksums phase to patch
another file.
* guix/build/cargo-build-system.scm (package): Adjust to remove
Cargo.toml.orig file if it exists.
2023-05-07 19:28:57 +03:00
Efraim Flashner
1963daf94c
build: cargo-build-system: Don't try to package when skipping build.
* guix/build/cargo-build-system.scm (package): If the package isn't
going to be built then use the source instead.
2023-05-07 19:28:57 +03:00
Ludovic Courtès
c3d7c09b9f
Revert "download: Refer to the 'guile-gnutls' package and not 'gnutls'."
This reverts commit c625e5b64d, which
introduced a circular dependency: the origin of guile-gnutls relies on
'git-download', which would now depend on guile-gnutls.
2023-05-06 19:12:16 +02:00
Ludovic Courtès
c625e5b64d
download: Refer to the 'guile-gnutls' package and not 'gnutls'.
This is a followup to 305794762c, which
removed Guile bindings from 'gnutls'.

* guix/android-repo-download.scm (android-repo-fetch): Refer to
'guile-gnutls instead of 'gnutls.
* guix/cvs-download.scm (cvs-fetch): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/hg-download.scm (hg-fetch): Likewise.
2023-05-06 18:19:13 +02:00
Ludovic Courtès
71fd35c1d5
lint: archival: Warn against non-origin package sources.
Suggested by Maxim Cournoyer <maxim.cournoyer@gmail.com>
and Simon Tournier <zimon.toutoune@gmail.com>.

* guix/lint.scm (check-archival): Add 'local-file?' clause.  Clarify
message in case (package-source package) is not an origin.
* tests/lint.scm ("archival: not an origin"): New test.
2023-05-06 17:12:45 +02:00
Jelle Licht
d8ce5e3297
build-system: node: Use --install-links' with npm install'.
Later versions of npm need to explicitly install a copy of local dependencies,
instead of only a symlink.

* guix/build/node-build-system.scm (configure): Add `--install-links' to npm
install invocation.
(install): Ditto.
2023-05-06 13:53:21 +02:00
Ludovic Courtès
75a25d9c2a
read-print: Recognize 'wrap-program' and 'wrap-script' as special forms.
* guix/read-print.scm (%special-forms): Add 'wrap-program' and
'wrap-script'.
2023-05-05 23:47:48 +02:00
Ludovic Courtès
8749f31485
read-print: Correctly read "(. x)".
* guix/read-print.scm (read-with-comments): Check whether REST is a pair
before calling 'set-cdr!'.
* tests/read-print.scm ("read-with-comments: half dot notation"): New test.
2023-05-05 23:47:48 +02:00
Sarthak Shah
ae11fcb84a
transformations: Add '--with-configure-flag'.
* guix/transformations.scm (transform-package-configure-flag): New
procedure.
(%transformation-options, %transformation-options)
(show-transformation-options-help/detailed): Add it.
* tests/transformations.scm ("options->transformation,
with-configure-flag"): New test.
* doc/guix.texi (Package Transformation Options): Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-05-04 17:06:44 +02:00
Ludovic Courtès
68fa28b3c3
style: Make 'safe' policy less conservative.
Previously, a mere (arguments '(#:tests? #f)) would lead

  guix style -S inputs --input-simplification=safe

to bail out.  It now recognizes such trivial argument lists and
proceeds.

* guix/scripts/style.scm (trivial-package-arguments?): New procedure.
(simplify-package-inputs): Use it in the 'safe case instead of 'null?'.
* tests/style.scm ("input labels, 'safe' policy, trivial arguments"):
New test.
2023-05-04 17:06:43 +02:00
Ludovic Courtès
916c6e5716
profiles: 'texlive-font-maps' gracefully handles lack of texlive inputs.
Fixes <https://issues.guix.gnu.org/63043>.

* guix/profiles.scm (texlive-font-maps): Define 'texlive-inputs'.
[build]: Use it.
Return #f when TEXLIVE-INPUTS is empty.
2023-05-04 13:09:00 +02:00
Ludovic Courtès
25f04945d9
import: elpa: Standardize warning message.
* guix/import/elpa.scm (melpa-recipe->origin): Standardize warning
message.
2023-05-04 13:09:00 +02:00
Ludovic Courtès
124b921a5e
import: Cosmetic tweaks to 'recursive-import'.
* guix/import/utils.scm (recursive-import): Tweak docstring.  Simplify
'apply' call.
2023-05-04 13:09:00 +02:00
Ludovic Courtès
39eb9b5a5c
import: elpa: Use the expected repo in recursive imports.
* guix/import/elpa.scm (elpa-recursive-import): Pass REPO in calls to
'elpa->guix-package'.
2023-05-04 13:09:00 +02:00
Ludovic Courtès
8e065692c2
import: elpa: 'elpa->guix-package' accepts other keyword arguments.
This is a followup to 3c24da4260.

* guix/import/elpa.scm (elpa->guix-package): Add #:allow-other-keys.
2023-05-04 13:09:00 +02:00
Ludovic Courtès
fc6c96c88a
ftp-client: 'connect*' retries until the timeout has expired.
Partly fixes <https://issues.guix.gnu.org/63024>.
Reported by Greg Hogan <code@greghogan.com>
and Timo Wilken <guix@twilken.net>.

* guix/ftp-client.scm (connect*): When 'select' returns an empty set,
try again until TIMEOUT has expired.
2023-05-04 13:08:59 +02:00
Simon Tournier
03856dce4e
scripts: import: crate: Handle non-existent package.
Fixes <https://bugs/gnu.org/63020>.

* guix/scripts/import/crate.scm (guix-import-crate): Handle non-existent
package input.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-04-30 23:08:06 +02:00
Simon Tournier
7304694f51
guix: import: crate: Fix incorrect returned values.
* guix/import/crate.scm (crate->guix-package): Return compatible values with
'recursive-import'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-04-30 23:07:58 +02:00
Leo Famulari
3b5b668303
build-system/cmake: Add support for the #:disallowed-references key.
* guix/build-system/cmake.scm (cmake-build, cmake-cross-build):
Add #:disallowed-references.
2023-04-30 04:47:18 -04:00
Ricardo Wurmus
90f67705f5
import/cran: Translate from xml2 to libxml2.
* guix/import/cran.scm (transform-sysname): Add translation from xml2 to
libxml2.
2023-04-29 20:09:30 +02:00
Ricardo Wurmus
2f53d9cce9
import/cran: Add "unix" to list of invalid packages.
* guix/import/cran.scm (invalid-packages): Add "unix".
2023-04-29 20:09:30 +02:00
Ricardo Wurmus
ec52655ce6
guix: Upgrade to Bioconductor 3.16.
* guix/build-system/r.scm (bioconductor-uri): Bump Bioconductor version to
3.17.
* guix/import/cran.scm (%bioconductor-version): Same.
2023-04-29 20:09:30 +02:00
Ricardo Wurmus
cb8d080349
import/pypi: Generate packages using pyproject-build-system.
* guix/import/pypi.scm (make-pypi-sexp): Generate PACKAGE expression where the
value for the BUILD-SYSTEM field is PYPROJECT-BUILD-SYSTEM instead of
PYTHON-BUILD-SYSTEM.
2023-04-29 20:09:30 +02:00
Andreas Enge
92dd588b81
Merge remote-tracking branch 'origin/master' into core-updates 2023-04-24 20:43:01 +02:00
Ludovic Courtès
7931ac810b
read-print: 'pretty-print-with-comments' keeps newlines on long strings.
* guix/read-print.scm (printed-string)[preserve-newlines?]: New
procedure.
Use it to preserve newlines on long strings.
* tests/read-print.scm: Add test.
2023-04-24 10:27:13 +02:00
Andreas Enge
d7ec2805fb
Merge remote-tracking branch 'origin/master' into core-updates 2023-04-23 22:21:00 +02:00
宋文武
4502de61f2
refresh: Support select packages SUBSET by module name.
* guix/scripts/refresh.scm (%options): Support '--select module:NAME'.
(show-help): Adjust accordingly.
(options->update-specs): Honor the module passed by '--select'.
* doc/guix.texi (Invoking guix refresh): Document it.
2023-04-23 15:28:46 +08:00
Andreas Enge
d1252b597d
Merge remote-tracking branch 'origin/master' into core-updates 2023-04-22 09:21:22 +02:00
Ludovic Courtès
1df54ceab3
packages: 'package-direct-sources' correctly handles non-origin sources.
Previously 'package-direct-sources' would trigger a wrong-type-arg error
when passed a package whose 'source' is not an origin, such as
'ruby-sorbet-runtime'.

* guix/packages.scm (package-direct-sources): Call 'expand' if and only
if (package-source package) is an origin.
2023-04-21 17:09:50 +02:00
Ludovic Courtès
6d6add5f8f
ssh: Silence remote daemon messages when sending store items.
Fixes <https://issues.guix.gnu.org/61839>.

Previously, when running 'guix-daemon --debug' on the remote machine,
lots of debugging outputs would be printed to stderr; since the client
wouldn't read it, we could eventually reach a deadlock where the 'guix
repl' process would be stuck writing to stderr while the client is
stuck waiting on its stdout.

* guix/ssh.scm (store-import-channel)[import]: Parameterize
'current-build-output-port'.
2023-04-19 20:12:20 -04:00
Ludovic Courtès
e95e65541a
substitute: Download nar from another server upon ETIMEDOUT.
Previously, 'guix substitute' would fail abruptly with something like:

  guix substitute: warning: while fetching https://ci.guix.gnu.org/nar/lzip/…-example: server is somewhat slow
  guix substitute: warning: try `--no-substitutes' if the problem persists
  guix substitute: error: connect*: Connection timed out
  substitution of /gnu/store/…-example failed

* guix/scripts/substitute.scm (network-error?): Add ETIMEDOUT.
2023-04-19 20:12:20 -04:00
Ludovic Courtès
abdf812acc
environment: Really auto-load (guix scripts pack).
Fixes a performance regression on cache hits introduced in
b31ea797ed, whereby (guix scripts pack)
would be loaded eagerly during startup, leading hundreds of (gnu
packages *) modules to be loaded.

Fixes <https://issues.guix.gnu.org/62899>.

* guix/scripts/environment.scm: Autoload (gnu build install).
(%options): Add indirection when calling 'symlink-spec-option-parser' so
that (guix scripts pack) is auto-loaded only when needed.
2023-04-19 20:12:19 -04:00
Ludovic Courtès
166a3e3fde
ssh: Silence remote daemon messages when sending store items.
Fixes <https://issues.guix.gnu.org/61839>.

Previously, when running 'guix-daemon --debug' on the remote machine,
lots of debugging outputs would be printed to stderr; since the client
wouldn't read it, we could eventually reach a deadlock where the 'guix
repl' process would be stuck writing to stderr while the client is
stuck waiting on its stdout.

* guix/ssh.scm (store-import-channel)[import]: Parameterize
'current-build-output-port'.
2023-04-17 23:50:42 +02:00
Ludovic Courtès
8136c1578e
substitute: Download nar from another server upon ETIMEDOUT.
Previously, 'guix substitute' would fail abruptly with something like:

  guix substitute: warning: while fetching https://ci.guix.gnu.org/nar/lzip/…-example: server is somewhat slow
  guix substitute: warning: try `--no-substitutes' if the problem persists
  guix substitute: error: connect*: Connection timed out
  substitution of /gnu/store/…-example failed

* guix/scripts/substitute.scm (network-error?): Add ETIMEDOUT.
2023-04-17 23:50:42 +02:00
Ludovic Courtès
9fad6067d9
environment: Really auto-load (guix scripts pack).
Fixes a performance regression on cache hits introduced in
b31ea797ed, whereby (guix scripts pack)
would be loaded eagerly during startup, leading hundreds of (gnu
packages *) modules to be loaded.

Fixes <https://issues.guix.gnu.org/62899>.

* guix/scripts/environment.scm: Autoload (gnu build install).
(%options): Add indirection when calling 'symlink-spec-option-parser' so
that (guix scripts pack) is auto-loaded only when needed.
2023-04-17 23:50:41 +02:00
Andreas Enge
216d7bdb73
Merge remote-tracking branch 'origin/master' into core-updates 2023-04-17 19:17:39 +02:00
Christopher Baines
e5c33837cb
self: Restructure accessing packages.
Both for consistency (always use specification->package as defined in this
module) and so that all the packages that are used can be accessed (which
comes in useful when applying grafts).

* guix/self.scm (%packages): New variable.
(specification->package): Use %packages.
(locale-data, translate-texi-manuals, info-manual, guix-command,
compiled-guix): Use specification->package.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2023-04-17 15:39:42 +01:00
Christopher Baines
095754ea88
packages: Export guile-for-grafts.
So this can be used in (guix self).

* guix/packages.scm (guile-for-grafts): Export.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2023-04-17 15:39:40 +01:00
Maxim Cournoyer
3c8a4d64ff
maint: Merge sanity-check-next.py into sanity-check.py.
* gnu/packages/aux-files/python/sanity-check-next.py: Rename to...
* gnu/packages/aux-files/python/sanity-check.py: ... this.
* guix/build-system/pyproject.scm (sanity-check.py): Adjust file name.
* Makefile.am (AUX_FILES): De-register sanity-check-next.py.
2023-04-14 21:01:34 -04:00
Maxim Cournoyer
3bacd3c76a
Merge branch 'master' into core-updates.
Conflicts:
	gnu/local.mk
	gnu/packages/build-tools.scm
	gnu/packages/certs.scm
	gnu/packages/check.scm
	gnu/packages/compression.scm
	gnu/packages/cups.scm
	gnu/packages/fontutils.scm
	gnu/packages/gnuzilla.scm
	gnu/packages/guile.scm
	gnu/packages/ibus.scm
	gnu/packages/image-processing.scm
	gnu/packages/linux.scm
	gnu/packages/music.scm
	gnu/packages/nss.scm
	gnu/packages/pdf.scm
	gnu/packages/python-xyz.scm
	gnu/packages/qt.scm
	gnu/packages/ruby.scm
	gnu/packages/shells.scm
	gnu/packages/tex.scm
	gnu/packages/video.scm
	gnu/packages/vulkan.scm
	gnu/packages/web.scm
	gnu/packages/webkit.scm
	gnu/packages/wm.scm
2023-04-14 17:15:08 -04:00
Maxim Cournoyer
6de7e0e54c
build/glib-or-gtk: Avoid duplicate entries in gdk-pixbuf loaders cache.
* guix/build/glib-or-gtk-build-system.scm (generate-gdk-pixbuf-loaders-cache):
Delete duplicate directories passed as input.
2023-04-14 15:35:36 -04:00
Maxim Cournoyer
cc3dc58f2b
build: qt-utils: Revert setting QT_PLUGIN_PATH exactly.
Fixes <https://issues.guix.gnu.org/57742>.

The documentation of Qt states that it is a supported use case to mix Qt 5 and
Qt 6 plugins in QT_PLUGIN_PATH [0].  This reverts the change to QT_PLUGIN_PATH
introduced in 1f466ed6be ("build: qt: Add qtbase argument and wrap Qt
environment variables exactly.").

[0]  https://doc.qt.io/qt-6.2/deployment-plugins.html#loading-and-verifying-plugins-dynamically

* guix/build/qt-utils.scm (variables-for-wrapping): Wrap QT_PLUGIN_PATH using
the prefix method.
2023-04-14 15:11:39 -04:00
Maxim Cournoyer
7747da6aed
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-12 08:29:37 -04:00
Ludovic Courtès
671cd78c7a
import: opam: Tweak doc for '--repo' option.
* guix/scripts/import/opam.scm (show-help): Tweak doc for. '--repo'.
2023-04-12 08:29:27 -04:00
Csepp
571907c362
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-12 08:29:27 -04:00
Ludovic Courtès
29e2e7135d
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-12 08:29:26 -04:00
Ludovic Courtès
ea4a66b2af
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-12 08:29:26 -04:00
Bruno Victal
0141e00b14
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-12 08:29:21 -04:00
Florian Pelz
83ee4dcf87
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-12 08:29:18 -04:00
Ludovic Courtès
4cc93a8d18
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-12 08:29:16 -04:00
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
Maxim Cournoyer
3bc9082523
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:18:29 -04:00
Maxim Cournoyer
22491ed9c5
build: meson: Explicitly invoke "meson setup" instead of just "meson".
* guix/build/meson-build-system.scm (configure): Invoke the setup command to
avoid a deprecation warning.
2023-04-09 12:55:46 -04:00
Maxim Cournoyer
9bf0a6e4a8
build: meson: Honor bindir, libdir and includedir.
This brings our meson-build-system closer to our gnu-build-system in terms of
using different installation prefixes based on the presence of outputs such as
"bin", "lib" or "include".

* guix/build/meson-build-system.scm (configure): Add --bindir, --libdir and
--includedir according to the presence of the "bin", "lib" and "include"
outputs, as done in gnu-build-system.
2023-04-09 12:55:45 -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
Ludovic Courtès
01d9859821
build-system/gnu: Add missing module import.
This import was removed in ae587c2ef0 on
'master'; it was inappropriate on 'core-updates'.

Reported by Christopher Baines.

* guix/build-system/dune.scm: Import (guix build-system gnu).
2023-04-06 11:45:30 +02:00
Maxim Cournoyer
99b25b1313
Merge branch 'master' into staging 2023-03-31 10:48:54 -04: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
438a0de332
Merge remote-tracking branch 'origin/master' into staging 2023-03-28 22:40:32 -04: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
Maxim Cournoyer
e4ef2db8fd
build: qt-utils: Revert setting QT_PLUGIN_PATH exactly.
Fixes <https://issues.guix.gnu.org/57742>.

The documentation of Qt states that it is a supported use case to mix Qt 5 and
Qt 6 plugins in QT_PLUGIN_PATH [0].  This reverts the change to QT_PLUGIN_PATH
introduced in 1f466ed6be ("build: qt: Add qtbase argument and wrap Qt
environment variables exactly.").

[0]  https://doc.qt.io/qt-6.2/deployment-plugins.html#loading-and-verifying-plugins-dynamically

* guix/build/qt-utils.scm (variables-for-wrapping): Wrap QT_PLUGIN_PATH using
the prefix method.
2023-03-28 20:17:08 -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
Andreas Enge
ccb62d8feb
Merge remote-tracking branch 'origin/master' into core-updates 2023-03-20 18:49:06 +01: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
Christopher Baines
7df09ee0ab
Merge remote-tracking branch 'savannah/master' into core-updates
Conflicts:
	gnu/local.mk
	gnu/packages/autotools.scm
	gnu/packages/cmake.scm
	gnu/packages/gnuzilla.scm
	gnu/packages/haskell.scm
	gnu/packages/pdf.scm
	gnu/packages/python-xyz.scm
	gnu/packages/samba.scm
	gnu/packages/tex.scm
	gnu/packages/tls.scm
	gnu/packages/wxwidgets.scm
2023-03-02 10:55:08 +00:00
Ludovic Courtès
476741c5bb
build-system/gnu: 'static-package' uses gexps.
* guix/build-system/gnu.scm (static-package): Use gexps.
2023-02-28 17:10:40 +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
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
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
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
Efraim Flashner
4cf1acc7f3
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts:
	doc/guix.texi
	gnu/local.mk
	gnu/packages/admin.scm
	gnu/packages/base.scm
	gnu/packages/chromium.scm
	gnu/packages/compression.scm
	gnu/packages/databases.scm
	gnu/packages/diffoscope.scm
	gnu/packages/freedesktop.scm
	gnu/packages/gnome.scm
	gnu/packages/gnupg.scm
	gnu/packages/guile.scm
	gnu/packages/inkscape.scm
	gnu/packages/llvm.scm
	gnu/packages/openldap.scm
	gnu/packages/pciutils.scm
	gnu/packages/ruby.scm
	gnu/packages/samba.scm
	gnu/packages/sqlite.scm
	gnu/packages/statistics.scm
	gnu/packages/syndication.scm
	gnu/packages/tex.scm
	gnu/packages/tls.scm
	gnu/packages/version-control.scm
	gnu/packages/xml.scm
	guix/build-system/copy.scm
	guix/scripts/home.scm
2023-01-30 12:39:40 +02: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
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
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
Ludovic Courtès
a4a35e123b
guix graph: 'guix graph --path' correctly handles multiple outputs.
Previously, "guix graph -t references --path guix guile" would fail
with:

  error: '--path' option requires exactly two nodes (given 2)

This is because '_' in the 'match' clause wouldn't match the
placeholder and would instead be interested as a variable name, thereby
meaning NODES is expected to have two lists with the same tail.

* guix/scripts/graph.scm (guix-graph): Rename '_' in 'mlet' to '_g' so
that the literal '_' used in 'match' below matches.
2023-01-16 00:06:55 +01:00
John Kehayias
3bfbfa2946
environment: Fix '--emulate-fhs' option overriding $PATH.
Fixes <https://issues.guix.gnu.org/60566> where even if "--preserve='^PATH$'"
was passed to 'guix shell' it would be replaced by just the FHS directories
when '--emulate-fhs' was also set.

* gnu/scripts/environment.scm (launch-environment): Add the FHS directories to
$PATH rather than overriding $PATH completely.
* tests/guix-environment-container.sh: Test that FHS directories are in $PATH
in the container and that $PATH can be preserved.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-01-15 17:54:14 -05:00
pukkamustard
79bf3b54a6
guix: dune-build-system: Do not use `test-target' argument.
This lets dune run all tests for a given package.

* guix/build/dune-build-system.scm (check): Do not use `test-target' argument.
* gnu/package/ocaml.scm (ocaml-cohttp)[native-inputs]: Add
  ocaml-crowbar.
(ocaml-cudf, opam, ocaml-frontc, ocaml-qcheck, ocaml-qtest)
(ocaml-stringext, ocaml4.07-ppx-tools-versioned, ocaml-result)
(ocaml4.09-result, ocaml5.0-result, ocaml-csv, ocaml-alcotest)
(ocaml4.07-alcotest, ocaml-ssl, ocaml-optint, ocaml-eio)
(ocaml-eio-luv, ocaml-uring, ocaml-eio-linux, ocaml-eio-main)
(ocaml-gen, ocaml-ocp-indent, ocaml-benchmark, ocaml-re)
(ocaml4.07-re, ocaml-ocplib-endian, ocaml-cstruct, ocaml-hex)
(ocaml-ezjsonm, ocaml-uri, ocaml4.07-uri, ocaml-camomile, ocaml-zed)
(ocaml-lambda-term, ocaml-utop, ocaml-ansiterminal, dedukti, ocaml-bindlib)
(ocaml-earley, ocaml-timed, ocaml-yojson, ocaml-gsl, ocaml-ppx-deriving)
(ocaml-ppx-cold, ocaml-ppx-typerep-conv, ocaml-ppx-stable)
(ocaml-ppx-base, ocaml-ppx-disable-unused-warnings, ocaml-ppx-jane)
(ocaml4.07-jane-street-headers, ocaml4.07-bisect-ppx, ocaml-fftw3)
(ocaml-cairo2, lablgtk3, ocaml-lablgtk3-sourceview3, ocaml-bigstringaf)
(ocaml-angstrom, ocaml-uri-sexp, ocaml-cohttp, js-of-ocaml)
(ocaml-monolith, ocaml-crowbar): Remove test-target argument.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2023-01-15 15:57:49 +01:00
Ricardo Wurmus
6e75790fc0
import/cran: Fix Bioconductor updater.
* guix/import/cran.scm (latest-bioconductor-release): Use LATEST-VERSION
instead of VERSION, which is always #F.
2023-01-09 22:32:58 +01:00
Ludovic Courtès
6c343d0d0f
read-print: Do not use extended notation when printing '1+', '1-', etc.
* guix/read-print.scm (%special-non-extended-symbols): New variable.
(symbol->display-string): New procedure.
(pretty-print-with-comments): Use it in lieu of 'string->symbol'.
* tests/read-print.scm: Add test.
2023-01-09 17:40:54 +01:00
Ludovic Courtès
5d24e57a61
derivations: 'read-derivation' correctly handles case with empty hash.
Reported by Stephen Paul Weber <singpolyma@singpolyma.net> at
<https://lists.gnu.org/archive/html/guix-devel/2023-01/msg00035.html>.

* guix/derivations.scm (read-derivation)[outputs->alist]: Treat the
empty hash case as non-fixed-output whether or not the hash algorithm is
the empty string, and preserve the hash algorithm in <derivation-output>.
* tests/derivations.scm ("'download' built-in builder, no fixed-output hash")
("fixed-output-derivation?, no hash", "read-derivation with hash = #f"): New tests.
2023-01-09 17:40:53 +01:00
Ludovic Courtès
007e697560
substitute: Parse '_NIX_OPTIONS' once.
* guix/scripts/substitute.scm (find-daemon-option): Arrange to call
'daemon-options' only once.
2023-01-09 17:40:53 +01:00
Ludovic Courtès
04f247be81
refresh: Add CLI tests.
* guix/import/test.scm, tests/guix-refresh.sh: New files.
* Makefile.am (MODULES, SH_TESTS): Add them.
2023-01-08 16:11:45 +01:00
Ludovic Courtès
2e9c0e1ff6
import: stackage: Catch networking errors in predicate.
* guix/import/stackage.scm (stackage-lts-package?): Wrap body in
'false-if-networking-error'.
2023-01-08 16:11:45 +01:00
Ludovic Courtès
472dd29f37
gnu-maintenance: 'gnu' and 'gnu-ftp' predicates catch networking errors.
Previously, in a networking-less environment such as 'guix shell -C -D
guix', 'guix refresh --list-updaters' would crash due to a
'gettaddrinfo-error' exception in these predicates.

* guix/gnu-maintenance.scm (%gnu-updater)[pred]: Wrap in
'false-if-networking-error'.
(%gnu-ftp-updater)[pred]: Likewise.
2023-01-08 16:11:45 +01:00
Ludovic Courtès
f3edf29c67
gnu-maintenance: Factorize 'false-if-networking-failure'.
* guix/import/utils.scm (call-with-networking-exception-handler): New
procedure.
(false-if-networking-error): New macro.
* guix/gnu-maintenance.scm (import-html-updatable-release): Use it
instead of inline code.
2023-01-08 16:11:45 +01:00
Mathieu Othacehe
8b665a4ff3
substitutes: Log the failing queries.
* guix/substitutes.scm (%debug?): New variable.
(handle-narinfo-response): Log the failing queries if the %debug? parameter is
set.
2023-01-07 14:27:17 +01:00
Mathieu Othacehe
62f9f34525
scripts: publish: Add a custom baking header.
Log the not-found responses and their reason (baking or not) to stdout. Also
send the X-Baking custom header so that the client can be informed of the
cause of the failure.

* guix/scripts/publish.scm (not-found): Add a baking? argument to add the
X-Baking HTTP header to the response if baking is in progress.  Also, log the
404 responses to stdout, indicating if it is due to baking or not.
(render-narinfo/cached): Pass the baking? argument.
2023-01-07 14:11:45 +01:00
Ludovic Courtès
b5e3701f1a
environment: Avoid false positive on 'PS1' check.
* guix/scripts/environment.scm (validate-child-shell-environment): Do
not warn when 'PS1' refers to 'GUIX_ENVIRONMENT'.
2023-01-05 15:01:29 +01:00