Git fails in Ubuntu 18.04, can't build Pynq

I’m trying to build the Pynq SD card for a new board. I’m targetting Pynq 2.7 with Vivado and Petalinux 2020.2 on Ubuntu 2018.04

I initially had the problem with git clone to get the Pynq repo, it fails like that:

error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

So I did a shallow clone and could pass that hurdle.
I managed to get to the end, wait for some hours past midnight yesterday and… boom, same error. The makefile uses git to get something, damn.

Curiously, investigating on that bug (a 4 year old one now) there seems not to be a fix. In hundreds of places they suggest changing the http:postBuffer, well that doesn’t work for me, neither similar variants of changing git variables.

I got the git repo (again with a shallow clone then fetching increasing depths) and spare some time today building different releases of git, from 2.4 to the current 2.37, none of them delivered a working git that won’t fail when cloning a repo.

I’m thinking now of going through the Pynq makefile and ‘patching’ the git clone there with a shallow version (git clone --depth 1), I just wanted to know from the community if there is a better fix that I’m unaware of. I can’t believe that the Pynq community has been in this situation for years.