Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Vyacheslav Yurkov <uvv.mail@gmail.com>
To: Lukas Funke <lukas.funke-oss@weidmueller.com>,
	openembedded-core@lists.openembedded.org
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>,
	Martin Jansa <martin.jansa@gmail.com>,
	Lukas Funke <lukas.funke@weidmueller.com>
Subject: Re: [OE-Core][PATCH v2 0/4] recipetool: Add handler to create go recipes
Date: Mon, 23 Oct 2023 20:06:11 +0200	[thread overview]
Message-ID: <1762baab-06d2-4fc4-9cd0-307b76f0d79e@gmail.com> (raw)
In-Reply-To: <3ab8f8ee-ce9d-48c1-b802-177f4bec9e3c@weidmueller.com>

On 23.10.2023 14:18, Lukas Funke wrote:
> Hi Slava,
>
> On 22.10.2023 20:34, Vyacheslav Yurkov wrote:
>> Hey Lukas,
>> Thanks a lot for the patch. A few questions/comments from my initial 
>> test below.
>>
>> - I tried it with a go-based backend I have by providing ssh URL to 
>> github. It seems like the GO_IMPORT is set to a module name from 
>> go.mod of my project, which of course fails to fetch it like that, 
>> because it's not a valid URL. How is it supposed to be used?
>
> Your assumption is correct: the GO_IMPORT is taken from the go.mod file.
>
> I've not considered the case where the repo URL is unequal to the 
> module path. This may require manual rework of the recipe. Another 
> solution would be to take the source URL from the recipetool. I think 
> there is no correct solution to this problem, because probably most 
> people might want to have the original solution, since they are 
> creating recipes from oss components (i.e. from github).

Some more results from my tests.

- I refactored module name to contain a valid URL... It seems though 
that current version of go_src_uri does not handle ssh URLs, and all 
required info from URL was lost (git@ component, ssh protocol, .git suffix).

- I placed the correct URL into SRC_URI, but do_go_vendor still failed 
with following stacktrace:

File: 
'/home/uvv/projects/yocto-lorch-mapro/openembedded-core/meta/classes/go-vendor.bbclass', 
lineno: 86, function: do_go_vendor
      0082:        # path = github.com/foo/bar
      0083:        # version = v1.2.3
      0084:
      0085:        p = destsuffix[len(default_destsuffix)+1:]
  *** 0086:        path, version = p.split('@')
      0087:
      0088:        subdir = fetcher.ud[url].parm.get('go_subdir')
      0089:        subdir = "" if not subdir else subdir
      0090:
Exception: ValueError: not enough values to unpack (expected 2, got 1)

The reason is that my go.mod name does not have a version component. If 
I understood the convention https://go.dev/ref/mod#introduction, it's 
not a required component, so this should be taken into account.

Thanks,
Slava


  parent reply	other threads:[~2023-10-23 18:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 13:26 [OE-Core][PATCH v2 0/4] recipetool: Add handler to create go recipes lukas.funke-oss
2023-10-17 13:26 ` [OE-Core][PATCH v2 1/4] classes: go-vendor: Add go-vendor class lukas.funke-oss
2023-10-18  6:36   ` Ulrich Ölmann
2023-10-17 13:26 ` [OE-Core][PATCH v2 2/4] selftest: recipetool: Add test for go recipe handler lukas.funke-oss
2023-10-17 13:26 ` [OE-Core][PATCH v2 3/4] recipetool: Ignore *.go files while scanning for licenses lukas.funke-oss
2023-10-17 13:26 ` [OE-Core][PATCH v2 4/4] recipetool: Add handler to create go recipes lukas.funke-oss
2023-10-17 13:53   ` Richard Purdie
2023-10-17 14:00     ` Lukas Funke
2023-10-17 22:23       ` Richard Purdie
2023-10-22 18:34 ` [OE-Core][PATCH v2 0/4] " Vyacheslav Yurkov
2023-10-23 12:18   ` Lukas Funke
2023-10-23 17:05     ` Vyacheslav Yurkov
2023-10-24  6:19       ` Lukas Funke
2023-10-24  7:32         ` Vyacheslav Yurkov
2023-10-23 18:06     ` Vyacheslav Yurkov [this message]
2023-10-24  6:33       ` Lukas Funke
2023-10-24  7:12         ` Vyacheslav Yurkov
2023-10-24  8:27           ` Lukas Funke
2023-10-27 21:32 ` Peter Kjellerstedt

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=1762baab-06d2-4fc4-9cd0-307b76f0d79e@gmail.com \
    --to=uvv.mail@gmail.com \
    --cc=bruce.ashfield@gmail.com \
    --cc=lukas.funke-oss@weidmueller.com \
    --cc=lukas.funke@weidmueller.com \
    --cc=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox