unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Sarah Morgensen via Bug reports for GNU Guix <bug-guix@gnu.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: 49202@debbugs.gnu.org, raingloom <raingloom@riseup.net>
Subject: bug#49202: guix import go type error (failed regex match?)
Date: Thu, 24 Jun 2021 14:20:00 -0700	[thread overview]
Message-ID: <86o8bv6jun.fsf@mgsn.dev> (raw)
In-Reply-To: <86r1gr70n7.fsf@mgsn.dev> (Sarah Morgensen's message of "Thu, 24 Jun 2021 08:17:16 -0700")

Sarah Morgensen <iskarian@mgsn.dev> writes:

>
> // When updating replace rules, make sure to also update the rules in integration/client/go.mod
> replace (
> 	// prevent transitional dependencies due to containerd having a circular
> 	// dependency on itself through plugins. see .empty-mod/go.mod for details
> 	github.com/containerd/containerd => ./.empty-mod/
> 	github.com/gogo/googleapis => github.com/gogo/googleapis v1.3.2
> 	// urfave/cli must be <= v1.22.1 due to a regression: https://github.com/urfave/cli/issues/1092
> 	github.com/urfave/cli => github.com/urfave/cli v1.22.1
> 	google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63
> )
>
> Based on the trace it seems like it's treating the k8s.io/utils require
> as a replace directive, but I have no idea why.
>

Looking at this again, I realize I misread the code: the "k8s.io/utils"
etc. is actually the head of the already-parsed requirements list.

Instead, when the error is thrown, we are in replace-directive, which is
called by in-replace...

--8<---------------cut here---------------start------------->8---
  (define (in-replace requirements replaced)
    (let ((line (read-line)))
      (cond
       ((eof-object? line)
        ;; this should never happen here but we ignore silently
        (values requirements replaced))
       ((string=? line ")")
        ;; end of block, coming back to toplevel
        (toplevel requirements replaced))
       (#t
        (call-with-values (lambda ()
                            (replace-directive requirements replaced line))
          in-replace)))))
--8<---------------cut here---------------end--------------->8---

...which does not handle comments. (Even the top-level parser doesn't
explicitly handle comments, it just discards any line that does not
start with "require" or "replace.")

Looks like the parser could use a little more robustness! :)

Hope that helps,
Sarah





  reply	other threads:[~2021-06-24 21:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 23:32 bug#49202: guix import go type error (failed regex match?) raingloom
2021-06-24 14:02 ` zimoun
2021-06-24 15:17   ` Sarah Morgensen via Bug reports for GNU Guix
2021-06-24 21:20     ` Sarah Morgensen via Bug reports for GNU Guix [this message]
2021-08-19  3:20     ` Maxim Cournoyer
2021-06-25 16:40 ` zimoun
2021-06-28 16:18   ` zimoun
2021-06-30 21:12     ` raingloom
2021-08-19  5:25 ` Sarah Morgensen

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86o8bv6jun.fsf@mgsn.dev \
    --to=bug-guix@gnu.org \
    --cc=49202@debbugs.gnu.org \
    --cc=iskarian@mgsn.dev \
    --cc=raingloom@riseup.net \
    --cc=zimon.toutoune@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).