Commit Graph

5196 Commits

Author SHA1 Message Date
Lars-Dominik Braun 7caa3506ea
guix: lint: Ignore unsupported source URL’s.
* guix/lint.scm (check-source): Add match case for #f.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2020-08-01 08:30:57 +02:00
Ludovic Courtès c9c8c6331e
deploy: Gracefully handle errors.
* guix/scripts/deploy.scm (guix-deploy): Wrap body in 'with-error-handling'.
2020-07-30 19:17:20 +02:00
Ludovic Courtès c6c0d5a22c
pack: "fakechroot" execution engine can load its audit module.
Fixes <https://bugs.gnu.org/42558>.

Until now, loading 'pack-audit.so' in a truly non-Guix environment would
usually fail because 'pack-audit.so' depends on 'libgcc_s.so' and
'libc.so', none of which could be found.

Furthermore, the test was not working as expected: the trick

  unshare -mrf sh -c 'mount -t tmpfs none /gnu ; ...'

would allow the fakechroot engine to make its store available as
/gnu/store as a result of another bug.

* gnu/packages/aux-files/run-in-namespace.c (relocated_search_path): New
function.
(exec_with_loader): Pass "--library-path" to the loader.
* guix/scripts/pack.scm (wrapped-package)[build](runpath): New procedure.
(elf-loader-compile-flags): Pass "-DLOADER_AUDIT_RUNPATH".
* tests/guix-pack-relocatable.sh: Remove 'STORE_PARENT'.
(run_without_store): New function.  Erase $NIX_STORE_DIR instead of
$STORE_PARENT.
Use 'run_without_store' throughout.
2020-07-28 14:41:04 +02:00
Mathieu Othacehe 8b221b64a5
store: deduplication: Handle fs without d_type support.
scandir* uses readdir, which means that the file type property can be 'unknown
if the underlying file-system does not support d_type. Make sure to fallback
to lstat in that case.

Fixes: https://issues.guix.gnu.org/issue/42579.

* guix/store/deduplication.scm (deduplicate): Handle the case where properties
is 'unknown because the underlying file-system does not support d_type.
2020-07-28 14:10:28 +02:00
Danny Milosavljevic bc76f8b1f9
upstream: Handle the case where the file name has no extension.
Fixes <https://bugs.gnu.org/42504>.
Reported by Alexandru-Sergiu Marton <brown121407@posteo.ro>.

* guix/upstream.scm (package-update/url-fetch): Handle the case where the
file name has no extension.
2020-07-27 13:35:49 +02:00
Ludovic Courtès a396dd01bc
machine: ssh: Check for potential system downgrades.
This is a followup to 8e31736b0a.

* guix/scripts/system/reconfigure.scm (check-forward-update): Add
 #:current-channels.  Use it instead of OLD.
* gnu/services.scm (sexp->system-provenance): New procedure.
(system-provenance): Use it.
* gnu/machine/ssh.scm (<machine-ssh-configuration>)[allow-downgrades?]:
New field.
(machine-check-forward-update): New procedure.
(check-deployment-sanity)[assertions]: Call it.
* doc/guix.texi (Invoking guix deploy): Document 'allow-downgrades?'
field.
2020-07-27 12:06:35 +02:00
Ludovic Courtès 9296a2e511
processes: Allow 'less' to properly estimate line length.
Until now, the first few lines in the output of 'guix processes' could
disappear in 'less'.

* guix/ui.scm (call-with-paginated-output-port): Add #:less-options
parameter and honor it.
(with-paginated-output-port): Allow callers to pass #:less-options.
* guix/scripts/processes.scm (guix-processes): Pass #:less-options to
'with-paginated-output-port'.
2020-07-27 12:06:35 +02:00
Ludovic Courtès 9a6322774d
guix system: Report file system errors using 'report-error'.
* guix/scripts/system.scm (check-file-system-availability)[file-system-location*]:
Return a <location> record instead of a string.
[error]: Use 'report-error' instead of 'format'.
Change callers accordingly.
2020-07-25 19:11:37 +02:00
Ludovic Courtès d51bfe242f
Use 'formatted-message' instead of '&message' where appropriate.
* gnu.scm (%try-use-modules): Use 'formatted-message' instead of
'&message'.
* gnu/machine/digital-ocean.scm (maybe-raise-unsupported-configuration-error):
Likewise.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Likewise.
(machine-check-building-for-appropriate-system): Likewise.
(deploy-managed-host): Likewise.
(maybe-raise-unsupported-configuration-error): Likewise.
* gnu/packages.scm (search-patch): Likewise.
* gnu/services.scm (%service-with-default-value): Likewise.
(files->etc-directory): Likewise.
(fold-services): Likewise.
* gnu/system.scm (locale-name->definition*): Likewise.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Likewise.
(check-luks-device): Likewise.
* guix/channels.scm (latest-channel-instance): Likewise.
* guix/cve.scm (json->cve-items): Likewise.
* guix/git-authenticate.scm (commit-signing-key): Likewise.
(commit-authorized-keys): Likewise.
(authenticate-commit): Likewise.
(verify-introductory-commit): Likewise.
* guix/remote.scm (remote-pipe-for-gexp): Likewise.
* guix/scripts/graph.scm (assert-package): Likewise.
* guix/scripts/offload.scm (private-key-from-file*): Likewise.
* guix/ssh.scm (authenticate-server*): Likewise.
(open-ssh-session): Likewise.
(remote-inferior): Likewise.
* guix/ui.scm (matching-generations): Likewise.
* guix/upstream.scm (package-update): Likewise.
* tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"):
Catch 'formatted-message?'.
("authenticate-channel, wrong first commit signer"): Likewise.
* tests/lint.scm ("patches: not found"): Adjust message string.
* tests/packages.scm ("patch not found yields a run-time error"): Catch
'formatted-message?'.
* guix/lint.scm (check-patch-file-names): Handle 'formatted-message?'.
(check-derivation): Ditto.
2020-07-25 19:11:37 +02:00
Ludovic Courtès 252a1926bc
diagnostics: Add '&formatted-message'.
This allows 'gettext' to be called on the format string at the site
where the exception is caught (rather than the site where it's thrown).
It also allows for argument highlighting.

* guix/diagnostics.scm (&formatted-message): New condition type.
(check-format-string): New procedure.
(formatted-message): New macro.
* guix/ui.scm (report-load-error): Add clause for 'formatted-message?'.
(warn-about-load-error): Likewise.
(call-with-error-handling): Likewise.
(read/eval): Likewise.
2020-07-25 19:11:36 +02:00
Ludovic Courtès 860f3d7749
diagnostics: Add a procedural variant of diagnostic procedures.
Callers can pass 'report-error', 'warning', etc. to 'apply'.

* guix/diagnostics.scm (trivial-format-string?): New procedure, moved
from...
(highlight-argument): ... here.
(define-diagnostic): Add 'identifier?' clause.
(emit-diagnostic): New procedure.
2020-07-25 19:11:36 +02:00
Ludovic Courtès efe037fc5c
ui: Factorize '&message' handling.
* guix/ui.scm (call-with-error-handling): Factorize the three
'message-condition?' clauses into one.
2020-07-25 19:11:36 +02:00
Ludovic Courtès f9a8dd053c
utils: Move '&fix-hint' to (guix diagnostics).
* guix/utils.scm (&fix-hint): Move to...
* guix/diagnostics.scm (&fix-hint): ... here.
* gnu.scm: Adjust imports accordingly.
* gnu/system/mapped-devices.scm: Likewise.
* guix/channels.scm: Likewise.
* guix/profiles.scm: Likewise.
* guix/scripts/system/reconfigure.scm: Likewise.
* guix/ssh.scm: Likewise.
2020-07-25 19:11:36 +02:00
Ludovic Courtès 6a79eed920
utils: Remove compatibility re-export of 'memoize'.
The 'memoize' binding was re-exported in 2016, commit
19e1d5f7f9, as a backwards-compatibility
measure that makes little sense now.

* guix/utils.scm: Don't re-export 'memoize'.
* guix/import/pypi.scm: Adjust imports.
* tests/pypi.scm: Remove duplicate (guix memoization) import.
2020-07-25 19:11:36 +02:00
Ludovic Courtès a5e2fc7376
utils: Move <location> and '&error-location' to (guix diagnostics).
* guix/utils.scm (<location>, source-properties->location)
(location->source-properties, &error-location): Move to...
* guix/diagnostics.scm: ... here.
* gnu.scm: Adjust imports accordingly.
* gnu/machine.scm: Likewise.
* gnu/system.scm: Likewise.
* gnu/tests.scm: Likewise.
* guix/inferior.scm: Likewise.
* tests/channels.scm: Likewise.
* tests/packages.scm: Likewise.
2020-07-25 19:11:36 +02:00
Ludovic Courtès e85d7ed609
quirks: Adjust patch to allow traveling back to Dec. 2018.
Fixes <https://bugs.gnu.org/42519>.

This fixes:

  guix time-machine --commit=897f303d2fa61497a931cf5fcb43349eb5f44c14

a commit dated Dec. 2018.

* guix/quirks.scm (%bug-41214-patch)[accesses-guile-2.2-optimization-options?]:
Add second 'match' clause.
2020-07-24 18:56:25 +02:00
Ludovic Courtès ac928d3e9e
import: github: Gracefully handle projects that have disappeared.
Fixes <https://bugs.gnu.org/42509>.
Reported by Alexandru-Sergiu Marton <brown121407@posteo.ro>.

* guix/import/github.scm (fetch-releases-or-tags): Use 'http-fetch'
instead of 'json-fetch', and guard against 404 errors.  Upon 404, emit a
warning and return the empty vector.
2020-07-24 14:21:30 +02:00
Ludovic Courtès a553892215
pack: '-R' applies to propagated inputs too.
Fixes <https://bugs.gnu.org/42510>.

* guix/scripts/pack.scm (wrapped-manifest-entry): Recurse on
'dependencies' field.
* tests/guix-pack-relocatable.sh: Add test.
2020-07-24 14:21:30 +02:00
Ludovic Courtès 8e31736b0a
guix system: 'reconfigure' disallows downgrades by default.
This is similar to what 9744cc7b46 did for
'guix pull'.

* guix/scripts/system/reconfigure.scm (ensure-forward-reconfigure)
(warn-about-backward-reconfigure, channel-relations)
(check-forward-update): New procedures.
* guix/scripts/system.scm (perform-action): Add #:validate-reconfigure.
Call 'check-forward-update' when ACTION is 'reconfigure.
(%options, show-help): Add "--allow-downgrades".
(%default-options): Add 'validate-reconfigure' key.
(process-action): Pass #:validate-reconfigure to 'perform-action'.
* doc/guix.texi (Invoking guix system): Document 'guix system describe'
more prominently, and document '--allow-downgrades'.
2020-07-23 00:22:25 +02:00
Ludovic Courtès a620c9d51d
git: 'update-cached-checkout' has a new #:check-out? parameter.
* guix/git.scm (update-cached-checkout): Add #:check-out? parameter and
honor it.
2020-07-23 00:22:25 +02:00
Ludovic Courtès 1c058c382a
git: Factorize 'resolve-reference'.
* guix/git.scm (resolve-reference): New procedure.
(switch-to-ref): Use it.
2020-07-23 00:22:25 +02:00
Ludovic Courtès b3679394ec
git-authenticate: Show fingerprint in missing-key error message.
* guix/git-authenticate.scm (commit-signing-key): In the 'missing-key'
case, add call to 'openpgp-format-fingerprint'.
2020-07-21 18:22:49 +02:00
Ludovic Courtès e5c0005956
lint: source: Always return a list.
Fixes a regression introduced in
c10526672e.

Previously we would return *unspecified* for a package whose source is
not an origin.

* guix/lint.scm (check-source): Add alternate 'if' branch.
2020-07-21 17:50:44 +02:00
Ludovic Courtès fa3d9c4db4
upstream: 'download-tarball' gracefully handles missing signatures.
This avoids a backtrace with "guix refresh -u rdiff-backup", which has
".asc" signatures instead of ".sig".

* guix/upstream.scm (download-tarball): Gracefully handle the case where
SIG is false.
* guix/gnu-maintenance.scm (latest-savannah-release): Add comment about
'file->signature'.
2020-07-21 17:50:44 +02:00
Ludovic Courtès 07a0be8079
gnu-maintenance: Recognize "RC" as denoting a pre-release tarball.
* guix/gnu-maintenance.scm (%alpha-tarball-rx): Add "RC".
2020-07-20 23:41:22 +02:00
Ludovic Courtès b579b1c1d1
gnu-maintenance: Handle lists returned by 'origin-uri'.
This fixes "guix refresh man-pages", for instance.

* guix/gnu-maintenance.scm (latest-savannah-release)
(latest-kernel.org-release): Handle the case where 'origin-uri' returns
a list.
2020-07-20 23:36:33 +02:00
Ludovic Courtès a022f5a4c1
gnu-maintenance: Call 'adjusted-upstream-source' only when there's a source.
This is a followup to 59a47fb678.

* guix/gnu-maintenance.scm (latest-savannah-release): Call
'adjusted-upstream-source' only when 'latest-html-release' returns
true.
(latest-kernel.org-release): Likewise.
2020-07-20 23:31:48 +02:00
Ludovic Courtès 4071879c86
json: Re-export 'define-json-mapping' from (json) when available.
This prepares for the migration to Guile-JSON 4.3.0.

* guix/json.scm (define-as-needed): New macro.
(define-json-mapping): Use 'define-as-needed' instead of
'define-syntax-rule'.
2020-07-20 23:25:10 +02:00
Ludovic Courtès 59a47fb678
gnu-maintenance: 'kernel.org' and 'savannah' updaters rewrite URLs.
This makes sure they return 'mirror://' URLs rather that URLs pointing
to the specific mirror they talk to.

* guix/gnu-maintenance.scm (url-prefix-rewrite)
(adjusted-upstream-source): New procedures.
(latest-savannah-release, latest-kernel.org-release): Use it.
2020-07-20 23:25:10 +02:00
Ludovic Courtès 1c26219f94
upstream: Use 'warning' instead of 'format'.
* guix/upstream.scm (update-package-source): Use 'warning' instead of 'format'.
2020-07-20 23:25:10 +02:00
Ludovic Courtès 36a5efd967
download: Add Savannah mirror.
* guix/download.scm (%mirrors): Add nongnu.freemirror.org.
2020-07-20 23:25:10 +02:00
Ludovic Courtès 7a6bb2fe5b
gnu-maintenance: Add 'savannah' updater.
* guix/gnu-maintenance.scm (savannah-package?, %savannah-base)
(%savannah-updater): New variables.
(latest-savannah-release): New procedure.
(latest-xorg-release): Fix docstring.
2020-07-20 23:25:09 +02:00
Ludovic Courtès cffaf285c1
gnu-maintenance: 'latest-html-release' honors #:file->signature.
* guix/gnu-maintenance.scm (latest-html-release): Call FILE->SIGNATURE
instead of the in-line ".tar.sign" policy.
2020-07-20 23:25:09 +02:00
Ludovic Courtès b3802495f6
pack: Build the store database under a UTF-8 locale.
Fixes <https://bugs.gnu.org/42389>.
Reported by branjam4@gmail.com.

* guix/scripts/pack.scm (store-database)[build]: Add calls to 'setenv'
and 'setlocale'.
* tests/pack.scm ("self-contained-tarball + localstatedir, UTF-8 file
names"): New test.
2020-07-20 23:25:09 +02:00
Ludovic Courtès 181e0dddd6
pack: 'self-contained-tarball' runs derivation in a UTF-8local.
* guix/scripts/pack.scm (self-contained-tarball)
[set-utf8-locale]: New variable.
[build]: Use it.
* tests/pack.scm ("self-contained-tarball"): Use a <profile> record
instead of 'profile-derivation'.
2020-07-20 23:25:09 +02:00
Lars-Dominik Braun e8088f0b06
ssh: Speed up RPCs by using #:nodelay.
Partly fixes <https://bugs.gnu.org/41702>.

* guix/ssh.scm (open-ssh-session): Enable #:nodelay.
* m4/guix.m4 (GUIX_CHECK_GUILE_SSH): Add feature check for this new parameter.
* doc/guix.texi (Requirements): Adjust.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2020-07-20 23:25:09 +02:00
Christopher Baines 22b3a95f6e
build-system/maven: Make default-maven-plugins a procedure.
This allows compiling the module without the (gnu packages maven) module being
available.

* guix/build-system/maven.scm (%default-maven-plugins): Rename to
default-maven-plugins, and convert to a procedure.
* doc/guix.texi (maven-build-system): Update.
2020-07-17 09:45:19 +01:00
Julien Lepiller 55b90c9053
guix: Add maven-build-system.
* guix/build-system/maven.scm: New file.
* guix/build/maven-build-system.scm: New file.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document the maven build system.
2020-07-17 04:21:22 +02:00
Julien Lepiller 3d3bc413b4
guix: java-utils: Add Maven-related phases.
* guix/build/maven/java.scm: New file.
* guix/build/maven/plugin.scm: New file.
* guix/build/maven/pom.scm: New file.
* Makefile.am (MODULES): Add them.
* guix/build-system/ant.scm (%ant-build-system-modules): Add them to the
build side.
* guix/build/java-utils.scm (generate-plugin.xml, install-pom-file)
(install-from-pom): New procedures.
2020-07-17 04:10:28 +02:00
Ludovic Courtès a168c3e4f8
ui: 'with-error-handling' does not unwind the stack.
Since a07d5e558b, we've been getting
useless backtraces upon unhandled errors, like this:

  Backtrace:
	     1 (primitive-load "/home/…/bin/guix")
  In guix/ui.scm:
    1953:12  0 (run-guix-command _ . _)

  guix/ui.scm:1953:12: In procedure run-guix-command:
  In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f

This change finally gives us real backtraces back.

* guix/ui.scm (guard*): New macro.
(call-with-error-handling): Use it instead of 'guard'.
2020-07-15 01:36:24 +02:00
Ludovic Courtès b91a73a6a4
services: Add 'system-provenance' procedure.
* gnu/services.scm (sexp->channel, system-provenance): New procedures.
* guix/scripts/system.scm (sexp->channel): Remove.
(display-system-generation): Use 'system-provenance' instead of parsing
the "provenance" file right here.
2020-07-15 01:36:24 +02:00
Ludovic Courtès efb10f175f
packages: Ensure bags are insensitive to '%current-system'.
Fixes <https://bugs.gnu.org/42327>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

This is a followup to f52fbf7094.

* guix/packages.scm (bag-transitive-inputs, bag-transitive-build-inputs)
(bag-transitive-host-inputs, bag-transitive-target-inputs): Parameterize
%CURRENT-SYSTEM in addition to %CURRENT-TARGET-SYSTEM.
* tests/packages.scm ("package->bag, sensitivity to %current-system"):
New test.
2020-07-13 16:49:12 +02:00
Ludovic Courtès c10526672e
lint: source: Validate URLs of Git references.
Until now the 'source' checker would look at URL for 'url-fetch' origins
but not for 'git-fetch' origins.

* guix/lint.scm (check-source): Add case for 'git-reference?'.
* tests/lint.scm ("source, git-reference: 301 -> 200"): New test.
2020-07-12 22:41:51 +02:00
Jan (janneke) Nieuwenhuizen fdef0d85ce
scripts: Typo in args-fold*.
* guix/scripts.scm (args-fold*): Add missing 'args' parameter so that
the all parameter names match their value.
2020-07-12 10:07:59 +02:00
Jan (janneke) Nieuwenhuizen 4b9eecd322
image: Do not set journal_model=WAL for the Hurd.
This fixes <https://bugs.gnu.org/42151>.

* gnu/system/images/hurd.scm (hurd-initialize-root-partition): Use #:wal-mode #f
in call to ...
* gnu/build/image.scm (initialize-root-partition): ... this, add #:wal-mode?
parameter, pass it to ...
(register-closure): ... this, add #:wal-mode? parameter, pass it to ...
* guix/store/database.scm (with-database): ... this, add #:wal-mode?
parameter, pass it to ...
(call-with-database): ... this, add #:wal-mode? parameter; when
set to #f, do not set journal_model=WAL.
2020-07-11 16:34:01 +02:00
Ludovic Courtès a98712785e
Add 'guix git authenticate'.
* guix/scripts/git.scm, guix/scripts/git/authenticate.scm,
tests/guix-git-authenticate.sh: New files.
* Makefile.am (MODULES): Add the *.scm files.
(SH_TESTS): Add 'tests/guix-git-authenticate.sh'.
* doc/guix.texi (Channels)[Specifying Channel Authorizations]: Mention
'guix git authenticate'.
(Invoking guix git authenticate): New node.
* po/guix/POTFILES.in: Add 'guix/scripts/git.scm' and
'guix/scripts/git/authenticate.scm'.
2020-07-11 12:33:01 +02:00
Ludovic Courtès 69db2993b5
git: Add 'with-git-error-handling'.
* guix/scripts/pull.scm (report-git-error, with-git-error-handling):
Move to...
* guix/git.scm: ... here.
* guix/scripts/time-machine.scm: Adjust accordingly.
2020-07-11 11:51:56 +02:00
Ludovic Courtès 838f2bdfa8
git-authenticate: Factorize 'authenticate-repository'.
* guix/git-authenticate.scm (repository-cache-key)
(verify-introductory-commit, authenticate-repository): New procedures.
* guix/channels.scm (verify-introductory-commit): Remove.
(authenticate-channel): Rewrite in terms of 'authenticate-repository'.
2020-07-11 11:51:52 +02:00
Ludovic Courtès 8d49c80b69
download-nar: Hide colliding 'dump-port*' binding.
* guix/build/download-nar.scm: Hide 'dump-port*' from (guix
serialization).
2020-07-10 00:20:09 +02:00
Ludovic Courtès a055604e6f
cve: Fix typos in <cve> accessor.
* guix/cve.scm (<cve>)[references]: Rename accessor to 'cve-references'
and fix adjust exported name accordingly.
2020-07-10 00:11:00 +02:00