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

Can't build when this repository is a git submodule #398

Closed
alef opened this issue May 11, 2021 · 1 comment
Closed

Can't build when this repository is a git submodule #398

alef opened this issue May 11, 2021 · 1 comment
Labels
Milestone

Comments

@alef
Copy link

alef commented May 11, 2021

Describe the bug

Your Makefile variable GIT_REFRESH_PREREQ relies on .git/index if path .git exists.
This doesn't apply to submodules because .git is a file here, instead of being a directory.
The error you get in such case:
make[1]: *** No rule to make target '.git/index', needed by 'version.inc'. Stop.

To Reproduce

Steps to reproduce the behavior (untested):

Kind of ...

$ mkdir /tmp/parent 
$ cd /tmp/parent
$ git init 
$ git submodule add https://github.com/cea-hpc/modules.git
$ cd modules
$ ./configure
$ make
...

Expected behavior

It should build even when you are a submodule of another git repository.

Additional context

Workaround: remove ".git/index".

@alef alef added the bug label May 11, 2021
@xdelaruelle xdelaruelle added this to the 4.8 milestone May 11, 2021
@xdelaruelle
Copy link
Member

Many thanks for this bug report. I have adapted tests of .git as it could be either a file or a directory. The git rev-parse --git-dir command is also now used to determine git directory location rather assuming it is .git.

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

No branches or pull requests

2 participants