potassco / clingo

🤔 A grounder and solver for logic programs.
https://potassco.org/clingo
MIT License
606 stars 81 forks source link

Absolute submodule paths would be welcome. #505

Closed gl-yziquel closed 3 months ago

gl-yziquel commented 3 months ago

Paths of submodules are relative in this repository.

My internal build system, in which I wish to integrate clingo, fares better when submodule paths are relative.

I raised a similar issue on swi-prolog:

https://github.com/SWI-Prolog/swipl-devel/issues/1283

I know this may be a contentious issue. But I'd really suggest making the paths of submodules absolute instead of relative: relative paths behave incorrectly when double cloning git repositories.

rkaminsk commented 3 months ago

We use relative paths to consistently checkout via ssh/https. Afaik this is not possible with absolute paths. I don't want to change this setup.

gl-yziquel commented 3 months ago

We use relative paths to consistently checkout via ssh/https. Afaik this is not possible with absolute paths. I don't want to change this setup.

Sure. I just wanted to make aware of what it implies on the other side. It makes cloning a clone really problematic.

rkaminsk commented 3 months ago

There should however be very few users with this use case. I trust this can be resolved with a little bit of scripting.

gl-yziquel commented 3 months ago

That kind of scripting ? Yes...

for submodule in $(grep -E "^\[submodule" .gitmodules | sed 's/^\[submodule "//;s/"\]//'); do git config submodule.$submodule.url "$(git config --file /path/to/my/local/git/clone/of/swipl-devel/.git/config --get submodule.$submodule.url)"; done

That use case arises pretty naturally, though: 1. you want to archive the repositories (which is pretty natural) and 2. you want to build from the archived repositories out of source tree (pretty natural too).

  1. requires a clone. 2. requires a clone of a clone. And here comes the problem.

I've just bumped into that same problem with the potassco-asp-course/course repo too.

Granted: many people do not archive code they download, and they do not build it, in this era of docker containers. They should, however.

rkaminsk commented 3 months ago

I really want to keep the current setup. Note however that the releases do not contain submodules. There is one final commit that bundles the contents of the submodules. As long as you do not want to provide development snapshots, there should be no trouble.

gl-yziquel commented 3 months ago

I really want to keep the current setup.

Your call. Just making you aware of the issue.