From: zimoun <zimon.toutoune@gmail.com>
To: 51888@debbugs.gnu.org
Cc: zimoun <zimon.toutoune@gmail.com>, julien@lepiller.eu
Subject: [bug#51888] [PATCH 0/1] import: opam: Warn instead of leave when fetching fails.
Date: Tue, 16 Nov 2021 11:10:43 +0100 [thread overview]
Message-ID: <20211116101043.58471-1-zimon.toutoune@gmail.com> (raw)
Hi,
It is possible to use another OPAM repository when importing, for instance
"guix import opam --repo=https://coq.inria.fr/opam/released" -- although Coq
packages are generally not built using OCaml or Dune build-system, another
story. :-) Or even, a package using OCaml or Dune build system but not
included in Opam repositories supported by Guix.
However, if this package uses OCaml or Dune build system, then 'refresh'
leaves which is annoying. For instance, consider:
--8<---------------cut here---------------start------------->8---
$ guix lint -L /tmp/pkgs example
/tmp/pkgs/mine.scm:8:2: example@0 : champ de licence invalide
/tmp/pkgs/mine.scm:23:14: example@0 : le synopsis ne devrait pas commencer par un nom de paquet
/tmp/pkgs/mine.scm:22:15: example@0 : Erreur de certificat TLS : X.509 server certificate for 'exmaple.org' does not match: C=US,ST=California,L=test,O=testexample,OU=testexample,CN=testexp
guix lint: erreur : le paquet « example » est introuvable
--8<---------------cut here---------------end--------------->8---
The trivial patch instead turns this error to a warning which allows to run
all the checkers:
--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix lint -L /tmp/pkgs example
/tmp/pkgs/mine.scm:8:2: example@0: invalid license field
/tmp/pkgs/mine.scm:23:14: example@0: synopsis should not start with the package name
/tmp/pkgs/mine.scm:22:15: example@0: TLS certificate error: X.509 server certificate for 'exmaple.org' does not match: C=US,ST=California,L=test,O=testexample,OU=testexample,CN=testexp
guix lint: warning: opam: package 'example' not found
/tmp/pkgs/mine.scm:12:6: warning: failed to fetch Git repository for example
/tmp/pkgs/mine.scm:12:6: example@0: updater 'opam' failed to find upstream releases
/tmp/pkgs/mine.scm:12:6: example@0: scheduled Software Heritage archival
--8<---------------cut here---------------end--------------->8---
here 'archival'. Note that the failure is correctly handled by 'lint' when
the early leave skips.
Note that it could be better that 'opam-fetch' raises an error in order to be
catched by caller and thus make all the UI consistent. However, this requires
a revamp of all inporters...
Cheers,
simon
Example of file /tmp/pkgs/mine.scm:
--8<---------------cut here---------------start------------->8---
(define-module (mine)
#:use-module (guix packages)
#:use-module (guix build-system ocaml)
#:use-module (guix git-download))
(define-public example
(package
(name "example")
(version "0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://example.org")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"0m5si9dsv96z92gy4xaqz8mzyz8zp7j1sp542l0wzsp5xgyfpc7i"))))
(build-system ocaml-build-system)
(home-page "https://exmaple.org")
(synopsis "Example")
(description "This is an exmaple.")
(license #f)))
--8<---------------cut here---------------end--------------->8---
zimoun (1):
import: opam: Warn instead of leave when fetching fails.
guix/import/opam.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
base-commit: 122396075f12b013b6bde56dafb895587b95bc9d
--
2.32.0
next reply other threads:[~2021-11-16 10:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 10:10 zimoun [this message]
2021-11-16 10:12 ` [bug#51888] [PATCH 1/1] import: opam: Warn instead of leave when fetching fails zimoun
2021-11-16 13:02 ` [bug#51888] [PATCH 0/1] " Julien Lepiller
2021-11-16 15:33 ` zimoun
2021-11-19 11:59 ` Julien Lepiller
2021-11-19 12:00 ` bug#51888: " Julien Lepiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211116101043.58471-1-zimon.toutoune@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=51888@debbugs.gnu.org \
--cc=julien@lepiller.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.