#.netrc loading
1 messages ยท Page 1 of 1 (latest)
can you share what you're doing to get the repos?
if it's inside a module, you need to provide the creds - the automatic netrc provisioning only works at the top most level (like in the shell)
this is for security - allowing any module to just use your creds implicitly is a pretty big break in sandboxing
I'm in a code repo (locally checked out) and trying to do
dagger call -m <git_repo>/<path>/<module> build
I've tried with and without https:// before git_repo
It's talking to gitlab
hm it should be able to read netrc ๐ค
are you using dagger cloud? if you have a link to a trace, that might help me debug a bit further
obviously, don't share your netrc exactly, but would be curious if there's anything special in the format
are you using macdef?
I don't think so:
machine <host>
login <user>
password <token>
I don't think so. I'm not sure I know what macdef is. ๐
there's no port in the hostname in either case?
It's possible I have the path wrong? The URl in a browser, like github. have <repo>/~/tree.... bits. I assume that is not needed, and it should be the path as I would see it locally ie <repo>/<path>/<module
Correct, no port
Hrm, I wonder if it has something to do with me being on a mac? The credential helper for my git config is osxkeychain
is your netrc encrypted using the osxkeychain?
No. I'm not sure how that would be done. ๐ It's clear text in my homedir. I update that file when my token changes.
mm okay, so potentially having a credential helper could be getting in the way here
if you just temporarily disable that - does it work?
also, yes, this is the right usage
I commented out the credential config from my .gitconfig but I still get the same error
Just to verify, I looked in mac Keychain Access (which took forever to find as Apple is hiding it) and I don't see anything in there listed under git or our code repo.
okay, just to confirm, something like this works for me:
โฏ cat ~/.netrc
machine github.com
login git
password ...
โฏ dagger functions -m github.com/dagger/dagger.io/api
Name Description
build -
does just using functions work for you?
sorry, i'm trying my best here ๐ i can't seem to repro properly
Lemme try functions. I've not tried that.
I'm still new to dagger, so didn't even know about that
functions gives same error. ๐
Maybe relevent, but the path I provide is <repo>/a/b/c/d/e/module, but the error complains about not being able to find <repo>/a/b. In my example c is the actual git repo (where would would append .git), and d/e are dirs in that repo
what git hosting provider are you using
Gitlab
sorry yes you said ๐
No worries. ๐
@grave dew do you know if there's anything else we need here?
if you change to have /a/b/c.git/d/e/module
does that fix anything
i remember something about that a while back
That worked. I swear I tried that in my trials
Ah, I think I tried it when I was trying to access a branch on the repo
TY!
Yeah exactly. I suppose you're working with a private gitlab remote ? Unfortunately, the .git is the only way to properly parse those remotes to distinguish between subdirectories and the root of the repo, from the ref, for this provider
where's the logic that handles that? ๐
we extracted that from google (golang), it's in https://github.com/dagger/dagger/tree/7ebbce57bf62cffff3adddeb20c70ed6e465b4c4/engine/vcs
https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/lib/gitlab/middleware/go.rb#L47-56 --> gitlab officially says: "go-get" on my refs will not give you infos on where the root of the repo is, unless authenticated