haskell / haskell/cabal

cabal-install does not work with git 2.7.4 (Ubuntu 16.04)

Open
#9,868 1 comment 0 reactions 0 assignees View on GitHub
needs triage type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

Executing cabal in repos that have submodules fails:

```
root@1eb2e83bccb6:~/ghcup-hs# cabal -v build
Project settings changed, reconfiguring...
creating /root/ghcup-hs/dist-newstyle/cache
creating /root/ghcup-hs/dist-newstyle
creating /root/ghcup-hs/dist-newstyle/cache
Running: /usr/bin/git --version
creating /root/ghcup-hs/dist-newstyle/src
Running: /usr/bin/git fetch
Running: /usr/bin/git submodule deinit --force --all
usage: git submodule [--quiet] add [-b ] [-f|--force] [--name ] [--reference ] [--] []
or: git submodule [--quiet] status [--cached] [--recursive] [--] [...]
or: git submodule [--quiet] init [--] [...]
or: git submodule [--quiet] deinit [-f|--force] [--] ...
or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--reference ] [--recursive] [--] [...]
or: git submodule [--quiet] summary [--cached|--files] [--summary-limit ] [commit] [--] [...]
or: git submodule [--quiet] foreach [--recursive]
or: git submodule [--quiet] sync [--recursive] [--] [...]
```

**To Reproduce**

* start a docker container with Ubuntu 16.04
* clone ghcup-hs repo
* run `cabal build`

**Expected behavior**

Cabal knows how to init and deinit submodules.

**System information**
- Operating system: Ubuntu 16.04
- `cabal-3.10.3.0`
- `ghc-9.4.8`

**Additional context**

My short investigation shows that git 2.7.4 does not know the `--all` parameter to `git submodule deinit`:

https://github.com/haskell/cabal/blob/738e4192f3adb9c77bd60a361451fd95db5bac9a/cabal-install/src/Distribution/Client/VCS.hs#L509

However, it seems that `git submodule deinit --force --all` is the same as `git submodule deinit --force .`. At least 2.7.4 seems to suggest that:

> Use '.' if you really want to deinitialize all submodules

I am not sure if there are more issues with git.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.