Commit Graph

6935 Commits

Author SHA1 Message Date
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
Ludovic Courtès 632e2f7ce1
environment: Simplify 'PS1' suggestion on '--check'.
* guix/scripts/environment.scm (validate-child-shell-environment): In
'PS1' suggestion, remove 'export' and avoid 'if'.
2023-01-05 15:01:29 +01:00
Ludovic Courtès 2c757e8fb4
home: '--version' really says "guix home".
* guix/scripts/home.scm (%options): Fix argument to 'show-version-and-exit'.
2023-01-05 13:12:24 +01:00
Ludovic Courtès 473692b812
refresh: Always return an <update-spec> for each command-line option.
This fixes a regression introduced in
8aeccc6240 whereby packages specified via
-e, -r, or -m, as well as packages *not* specified on the command line,
would all lead to a wrong-type error.

Reported by Ricardo Wurmus <rekado@elephly.net> at
<https://lists.gnu.org/archive/html/guix-devel/2022-12/msg00311.html>.

* guix/scripts/refresh.scm (<update-spec>): Move above.  Rename
constructor to '%update-spec' and add separate 'update-spec' procedure
with optional #:version parameter.
(options->update-specs): Always return a list of <update-spec> and
update docstring accordingly.  Rename 'args-packages' to 'update-specs'
and ensure it's a list of <update-spec>; handle 'manifest' arguments
here.
2023-01-03 12:25:48 +01:00
Ludovic Courtès 11235dd85a
refresh: Honor user-provided target version and report downgrades.
Previously, 'guix refresh guile=3.0.0' would print:

  3.0.8 is already the latest version of guile

With this change, it prints:

  guile would be downgraded from 3.0.8 to 3.0.0

This is a followup to 8aeccc6240.

* guix/scripts/refresh.scm (check-for-package-update): Take an
<update-spec> instead of a <package>.  Report downgrades as such when
UPDATE-SPEC specifies a target version.
(guix-refresh): Adjust caller.
2023-01-03 12:25:48 +01:00
Ludovic Courtès a330bfdf5b
upstream: Allow downgrades.
Previously, 'guix refresh -u guile=3.0.0' would do nothing.  With this
change, it actually downgrades 'guile'.

This is a followup to 8aeccc6240.

* guix/upstream.scm (package-update): Ignore 'version>?' check
when #:version is passed.  Warn about downgrades.
2023-01-03 12:25:48 +01:00
Ludovic Courtès c6ac47afdf
ui: It's 2023 now!
* guix/ui.scm (show-version-and-exit): Change year to 2023.
2023-01-03 12:25:48 +01:00
Lars-Dominik Braun c329eeb3a8
import/cran: Depend on gfortran if .f files are detected too.
There was an inconsistency between tarball-needs-fortran? and
directory-needs-fortran?.

* guix/import/cran.scm (directory-needs-fortran?): Match .f files too.
2022-12-31 19:41:53 +01:00
Ricardo Wurmus d4ed8dc3c5
import/cran: Use multiple values instead of a list of lists.
* guix/import/cran.scm (source-dir->dependencies): Return multiple values.
(description->package): Bind two values.
2022-12-31 14:48:46 +01:00
Ricardo Wurmus 4d13926064
import/utils: recursive-import: Pass on lookup-node's version argument.
* guix/import/utils.scm (recursive-import)<lookup-node>: Replace the #:VERSION
keyword from RECURSIVE-IMPORT's arguments with the value of VERSION passed to
LOOKUP-NODE.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun 973496100d
import/cran: Always operate on source directory.
Extracting the source tarball multiple times is very slow and a
speedup of >2x (without network I/O) can be achieved by coalescing all
NEEDS-X? functions into a single one, which extracts a tarball only once.

* guix/import/cran.scm (tarball-needs-fortran?): Remove unused function.
(needs-fortran?): Ditto.
(tarball-files-match-pattern?): Ditto.
(tarball-needs-zlib?): Ditto.
(needs-zlib?): Ditto.
(tarball-needs-pkg-config?): Ditto.
(needs-pkg-config?): Ditto.
(source-dir->dependencies): New function.
(source->dependencies): New function.
(description->package): Use it.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun 952953be39
import/cran: Translate more package dependencies.
Assumes we use package variable names, not package specification names.

* guix/import/cran.scm (invalid-packages): Add more invalid names.
(transform-sysname): Transform more package names.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun 1176fccb83
import/cran: Allow overriding tarball download.
* guix/import/cran.scm (description->package): Accept new keyword argument
DOWNLOAD-SOURCE.
(cran->guix-package): Ditto.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun 08028c443e
import/cran: Allow overriding description fetch function.
* guix/import/cran.scm (cran->guix-package): New keyword argument
FETCH-DESCRIPTION.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun d57dd25d38
import/cran: Allow custom license prefix.
* guix/import/cran.scm (string-licenses): Add license-prefix argument.
(string->license): Ditto.
(description->package): Ditto.
(cran->guix-package): Ditto.
(cran-recursive-import): Ditto.
* guix/scripts/import/cran.scm (%options): Add new option -p/--license-prefix.
(show-help): Document it.
(parse-options): Pass it to importer.
* doc/guix.texi (Invoking guix import): Document it.
2022-12-31 14:48:46 +01:00
Lars-Dominik Braun 3c24da4260
import/utils: Pass all arguments through to package builder.
Individual importer may have additional arguments.

* guix/import/utils.scm (recursive-import): Patch all keyword arguments
through to repo->guix-package.
* guix/import/cran.scm (cran->guix-package): Add #:allow-other-keys.
* guix/import/crate.scm (crate->guix-package): Ditto.
* guix/import/egg.scm (egg->guix-package): Ditto.
* guix/import/elm.scm (elm->guix-package): Ditto.
* guix/import/gem.scm (gem->guix-package): Ditto.
* guix/import/gnu.scm (gnu->guix-package): Ditto.
* guix/import/go.scm (go-module->guix-package): Ditto.
(go-module-recursive-import): Ditto.
* guix/import/hackage.scm (hackage->guix-package): Ditto.
(hackage-recursive-import): Ditto.
* guix/import/hexpm.scm (hexpm->guix-package): Ditto.
* guix/import/minetest.scm (minetest->guix-package): Ditto.
(minetest-recursive-import): Ditto.
* guix/import/opam.scm (opam->guix-package): Ditto.
* guix/import/pypi.scm (pypi->guix-package): Ditto.
* guix/import/stackage.scm (stackage->guix-package): Ditto.
(stackage-recursive-import): Ditto.
* guix/import/texlive.scm (texlive->guix-package): Ditto.
2022-12-31 14:48:46 +01:00
Attila Lendvai 363b20b685
records: match-record supports specifying a different variable name.
An example:

(match-record obj <my-type>
  (field1 (field2 custom-var-name) field3)
  ...)

* guix/records.scm (match-record-inner): Add support for the new syntax.
* tests/records.scm ("match-record, simple"): Add a simple test case for the
new syntax.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-12-27 23:53:42 +01:00
Hartmut Goebel f7eaed6858
upstream: Allow updating to a specific version.
* guix/upstream.scm(package-latest-release): Add keyword-argument 'version'
  and pass it on to the updater's 'import' function.
  (package-update): add keyword-argument 'version' and pass it on to
  package-latest-release.  Differentiate the error message issued when
  no package was found, depending on whether version was given or not.
2022-12-26 17:38:07 +01:00
Hartmut Goebel 8aeccc6240
refresh: Allow updating to a specific version.
* guix/scripts/refresh.scm (options->packages)[args-packages]: Handle version
  specification in package name arguments.
  (update-package): Add #:version argument and pass it on to called functions.
  (guix-refresh): When updating, pass the specified version (if any) to
  update-package.
  [package-list-without-versions, package-list-with-versions]: New functions.
2022-12-26 17:38:07 +01:00
Hartmut Goebel b82eb8d67a
import: pypi: Allow updating to a specific version.
* guix/import/pypi.scm (latest-release): Rename to 'import-release',
  add #:version argument and pass it on to called functions.
2022-12-26 17:38:06 +01:00
Hartmut Goebel 3986caacae
import: launchpad: Allow updating to a specific version.
* guix/import/launchpad.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:06 +01:00
Hartmut Goebel 424a871f1f
import: kde: Allow updating to a specific version.
* guix/import/kde.scm (latest-kde-release): Rename to 'import-kde-release',
  add #:version argument.  Rework the code to not sort the relevant files,
  but just find the requested or latest version.
  [find-latest-archive-version]: New function.
2022-12-26 17:38:06 +01:00
Hartmut Goebel e689f97033
import: hexpm: Allow updating to a specific version.
* guix/import/hexpm.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:05 +01:00
Hartmut Goebel c7faeae2b1
import: gnome: Allow updating to a specific version.
* guix/import/gnome.scm (latest-gnome-release): Rename
  to 'import-gnome-release', add #:version argument. If version is
  given, try to find the respective version
  [find-latest-release]: New function, based on former code.
  [find-version-release]: New function.
2022-12-26 17:38:05 +01:00
Hartmut Goebel be3f48bff0
import: github: Allow updating to a specific version.
* guix/import/github.scm (latest-released-version): Add #:version argument.
  If version is given, try to find the respective release.
  (latest-releease) Rename to 'import-release', add #:version argument
  and pass it on to 'latest-released-version'.
2022-12-26 17:38:05 +01:00
Hartmut Goebel 6da60453e2
import: git: Allow updating to a specific version.
* guix/import/git.scm
  (latest-tag): Add #:version argument. If version is given, try to
  find the respective version tag.
  (latest-git-tag-version): Add #:version argument and pass it on to
  called functions.
  (latest-releease) Rename to 'import-release', add #:version argument
  and pass it on to called functions.
2022-12-26 17:38:05 +01:00
Hartmut Goebel 1e39f475a2
import: gem: Allow updating to a specific version.
* guix/import/gem.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:03 +01:00
Hartmut Goebel af44a8550c
import: egg: Allow updating to a specific version.
* guix/import/egg.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:03 +01:00
Hartmut Goebel 7c4aab1f7d
import: crate: Allow updating to a specific version.
* guix/import/crate.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
2022-12-26 17:38:03 +01:00
Hartmut Goebel 53af560543
gnu-maintenance: Allow updating to a specific version.
* guix/gnu-maintenance.scm
  (latest-ftp-release): Rename to … (import-ftp-release) … this,
  add #:version argument.
  If version is given, try to find the respective version.
  (latest-html-release): Rename to … (import-html-release) … this,
  add #:version argument.
  If version is given, try to find the respective version.
  (latest-gnu-release): Rename to … (import-gnu-release) … this,
  add #:version argument. Refactor to first select archives for
  respective package, the find the requested or latest version, then create
  the upstream-source.
  (latest-release): Rename to … (import-release) … this,
  add #:version argument, pass on to … (import-ftp-release) … this.
  (import-release*): Rename to … (import-release*) … this,
  add #:version argument, pass on to … (latest-release) … this.
  (latest-savannah-release): Rename to … (import-savannah-release) … this,
  add keword-argument version, pass on to … (import-html-release) … this.
  (latest-xorg-release): Rename to … (import-xorg-release) … this,
  add keword-argument version, pass on to … (import-ftp-release) … this.
  (latest-kernel.org-release): Rename to … (import-kernel.org-release) … this,
  add #:version argument, pass on to … (import-html-release) … this.
  (latest-html-updatable-release): Rename to … (import-html-updatable-release)
  … this, add #:version argument, pass on to … (import-html-release) … this.
* guix/import/gnu.scm(gnu->guix-package): Adjust function call.
2022-12-26 17:38:03 +01:00
Hartmut Goebel abc72eeac0
import: sourceforge: Issue error-message if version is given.
Due to the complicated directory structure at sourceforce,
enabling the  sourceforge importer to update to a specific version
is very complicated to implement. Since only 2.0% of the
packages in guix are covered by this updater I dedided to not
implement this.

* guix/gnu-maintenance.scm (latest-sourceforge-release): Add #:version
  argument.  Issue error-message if version is given.
2022-12-26 17:15:07 +01:00
Hartmut Goebel 21703b5120
import: Issue error-message if version is given.
These importer don't support importing a specific version, thus the updater
does neither.  Issue an error message in case version is given.

* guix/import/cpan.scm (latest-release),
  guix/import/elpa.scm (latest-release),
  guix/import/hackage.scm (latest-release),
  guix/import/minetest.scm (latest-minetest-release),
  guix/import/opam.scm (latest-release): Add #:version argument,
  issue error if version is given.
* guix/import/cran.scm (latest-cran-release): Same.
  (latest-bioconductor-release) Same. <version>: rename to <latest-version>.
* guix/import/stackage.scm (latest-lts-release): For each generated updater,
  add #:version argument and issue error if version is given.
2022-12-26 17:15:07 +01:00
Hartmut Goebel 9500c11c8b
import: cpan: Remove unused exports.
* guix/import/cpan.scm (#:export): Remove unused exports.
2022-12-26 17:15:06 +01:00
Hartmut Goebel a274a6a1ac
upstream-updater: Rename record field.
The next commits will make the functions, which are currently importing the
latest version of a package, change into importing the latest or a given
version of the package (for those updaters supporting specifying a version).
Thus the name ‘latest‘ is no longer appropriate.

* guix/upstream.scm (upstream-updater) Rename field [latest] to
  [import]. (lookup-updater, package-latest-release) Adjust fieldname
  accordingly.
* guix/gnu-maintenance.scm (%gnu-updater, %gnu-ftp-updater,
  %savannah-updater, %sourceforge-updater, %xorg-updater,
  %kernel.org-updater, %generic-html-updater),
  guix/import/cpan.scm (%cpan-updater),
  guix/import/cran.scm (%cran-updater, %bioconductor-updater),
  guix/import/crate.scm (%crate-updater),
  guix/import/egg.scm (%egg-updater),
  guix/import/elpa.scm (%elpa-updater),
  guix/import/gem.scm (%gem-updater),
  guix/import/git.scm (%generic-git-updater),
  guix/import/github.scm (%github-updater),
  guix/import/gnome.scm (%gnome-updater),
  guix/import/hackage.scm (%hackage-updater),
  guix/import/hexpm.scm (%hexpm-updater),
  guix/import/kde.scm (%kde-updater),
  guix/import/launchpad.scm (%launchpad-updater),
  guix/import/minetest.scm (%minetest-updater),
  guix/import/opam.scm (%opam-updater),
  guix/import/pypi.scm (%pypi-updater),
  guix/import/stackage.scm (%stackage-updater),
  tests/import-github.scm (found-sexp)
  tests/transformations.scm ("options->transformation, with-latest"):
  Adjust fieldname accordingly.
2022-12-26 17:15:06 +01:00
Yarl Baudig 800b3234fb
shell: Make --help show --system and --list-systems.
These options are callable and documented in the manual but not
shown by --help.

* guix/scripts/shell.scm: Make --help show --system and
--list-systems.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-12-26 00:30:50 +01:00
pukkamustard 052ec8bcc7
guix: ocaml: Add package-with-ocaml5.0.
* guix/build-system/ocaml.scm (package-with-ocaml5.0)
(strip-ocaml5.0-variant): New variables.
* gnu/packages/ocaml.scm (ocaml5.0-dune-bootstrap)
(ocaml5.0-dune, ocaml5.0-dune-configurator)
(ocaml5.0-csexp, ocaml5.0-result): New variables.

Signed-off-by: Julien Lepiller <julien@lepiller.eu>
2022-12-21 21:58:56 +01:00
Maxim Cournoyer 30465558bd
guix system: Skip initrd modules check when using --target.
* guix/scripts/system.scm (perform-action): Do not call CHECK-INITRD-MODULES
when the %current-target-system parameter is set.
2022-12-21 14:22:13 -05:00
Maxim Cournoyer 68330e7797
kconfig: Streamline comment in 'modify-defconfig'.
* guix/build/kconfig.scm (modify-defconfig): Streamline comment.
2022-12-20 21:19:33 -05:00
Maxim Cournoyer 1d44866280
kconfig: Mostly preserve keys ordering of original defconfig.
* guix/build/kconfig.scm (defconfig->alist): Reverse the results of lists
constructed with cons.
2022-12-20 21:19:30 -05:00
Maxim Cournoyer d368210af5
kconfig: Move pair->config-string up.
* guix/build/kconfig.scm (pair->config-string): Move earlier, to match the
natural dependency of declarations (useful when experimenting at the REPL).
2022-12-20 21:19:26 -05:00
Ludovic Courtès fcc4e51e61
read-print: Add special forms.
* guix/read-print.scm (%special-forms): Add 'define-configuration' and
'match-record'.
2022-12-20 16:56:04 +01:00
Ricardo Wurmus 5a1a5677cd
import/cran: Add more mappings from sysnames to Guix package names.
* guix/import/cran.scm (transform-sysname): Add more mappings.
2022-12-19 18:29:45 +01:00