On 23.10.2023 20:06, Vyacheslav Yurkov wrote:
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).

Currently only https is handled.


- 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.

This error could happen if your dependencies don't have a version. I've never seen this in my experiments. Maybe check your go.mod file for the missing version info.


Thanks,
Slava

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#189637): 
https://lists.openembedded.org/g/openembedded-core/message/189637
Mute This Topic: https://lists.openembedded.org/mt/102017388/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to