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

hydra fails checking out gitinputs with submodules with relative URLs #661

Open
tfc opened this issue Jul 8, 2019 · 1 comment
Open

Comments

@tfc
Copy link

tfc commented Jul 8, 2019

When using repositories as input that...

  • have submodules
  • and the .gitmodule file contains lines like:
    [submodule "contrib/somelib"]
        path = cotnrib/somelib
        url = ../../open-source-libs/somelib.git
    

then hydra fails to check this out with error messages like the following:

command `nix-prefetch-git /var/lib/hydra/scm/git/123123123 abcabcabc' failed with exit status 256 (in an indeterminate location) at /nix/store/9fvyrab5cmaz9knrchij1p2khp6z3d42-hydra-0.1.0.0000000000000000000000000000000000000000/libexec/hydra/lib/Hydra/Helper/Nix.pm line 433.

I started debugging this and realized that when nix-prefetch-git clones this project, it uses an intermediate folder in /var/lib/hydra/scm/git/123123123... to clone from, and then during the git submodule init step, it will think that those relative URLs from the .gitmodule file are relative to this folder instead of being relative to the original URL (which was some SSH or HTTPS URL)...

when running nix-prefetch-git with bash -x you see lines like:

[...]
+ git submodule init
Submodule 'contrib/somelib' (/var/lib/hydra/scm/somelib.git) registered for path 'controb/somelib'
[...]

Which does result in:

[...]
fatal: repository '/var/lib/hydra/scm/somelib.git' does not exist
[...]
@tfc
Copy link
Author

tfc commented Jul 11, 2019

Of course it is possible that my usecase seems esoteric and hence this problem doesn't appear to have much weight.

If this is the case, i hope to at least get some advice what to do in my case. Implement another jobset input type that works for my usecase or something like that?

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

1 participant