#Wrong URL in go third-party packages

1 messages · Page 1 of 1 (latest)

near ember
#

Hello, I'm trying to use my private packages inside the module, but my URL is big because I have a lot of subgroups, and the code generator try get the first subgroup as a group and the rest as revision. Example: my mod gitlab.com/myorg/myteam/repository.git and the code generator try access gitlab.com/myorg/myteam.git

Locally my go mod tidy works very well and don't have error at vscode, but when I try run dagger develop or dagger call myfunc I have this issue.

rapid plume
rapid plume
#

cc @clear zephyr

clear zephyr
#

--

Oh it's not a module, but a go private package hosted on a private gitlab repo and you're doing a dagger develop and it breaks ?

clear zephyr
#

So, if I'm correct it's actually Go's dependency logic that fails here. It's just that Dagger doesn't support all the auth patterns that Go relies on, leading to a surprising behavior when trying to download a private Go dependency without the auth, on GitLab (and only gitlab):

GitLab, when trying to resolve a private repository, does not hint the correct root of repo when failing, it fallbacks to a generic gitlab.com/org/repo (security by design / obfuscation)

You can test that by removing all your auth locally and trying, you should have the exact same error

So, it's very likely that it's currently failing because your local auth setup is still not supported inside Dagger's codegen runtime: we currently only support ssh auth for private Go dependencies on the Go SDK

So, 2 things to do to unlock yourself:

  1. making sure that the ssh-agent is present and accessible [env var SSH_AUTH_SOCK is set]
  2. update your .gitconfig with some insteadOf to transform those private go refs into an ssh format

During that codegen phase, Dagger will load the socket and the .gitconfig