Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with a private dependency #33

Open
takeda opened this issue Mar 27, 2022 · 3 comments
Open

Building with a private dependency #33

takeda opened this issue Mar 27, 2022 · 3 comments

Comments

@takeda
Copy link

takeda commented Mar 27, 2022

Not sure if this is a bug, or perhaps it's just advice needed.

I have problem with building a project that contains a private dependency. It appears to be slightly different problem than described in #3.

After gomod2nix asked me for credentials I just entered it and it did its job, but when I'm trying to build and that dependency came up this is what I got:

exporting https://gitlab.<snip>/<snip>/go-commons (rev 0b8910c77d4eac6c27ef7024e7596bfcfa07feff) into /nix/store/1348m1ip818a03dj49d4ljv5qm14rj7g-go-commons-0b8910c
Initialized empty Git repository in /nix/store/1348m1ip818a03dj49d4ljv5qm14rj7g-go-commons-0b8910c/.git/
fatal: could not read Username for 'https://gitlab.<snip>': Device not configured
fatal: could not read Username for 'https://gitlab.<snip>': Device not configured
fatal: could not read Username for 'https://gitlab.<snip>': Device not configured
Unable to checkout 0b8910c77d4eac6c27ef7024e7596bfcfa07feff from https://gitlab.<snip>/<snip>/go-commons.

Is there a way to let me compile to project? During build I don't even have an opportunity to enter credentials. Of course saved credentials as well like using insteadOf in git configuration don't work.

@takeda
Copy link
Author

takeda commented Mar 27, 2022

That concept isn't completely clear to me yet, but I'm wondering if: https://github.com/tweag/gomod2nix/blob/master/builder/default.nix#L50-L60 isn't violating IFD. If instead of using and parsing toml, gomod2nix would just generate a nix file that would be simply imported, wouldn't then nix respect local configuration?

@adisbladis
Copy link
Member

I've added an override interface in #42 for dealing with these types of issues.
The same interface could also potentially be used to apply patches to individual upstream packages.

@adisbladis
Copy link
Member

#55 should help, but it's not a full fix for private dependencies which are generally a bit painful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants