Article View: linux.debian.bugs.dist
Article #4215Bug#1145549: fails to download submodules if run from git checkout and upstream is configured as remote
From: Simon Richter
Date: Thu, 12 Nov 2026 03:40
Date: Thu, 12 Nov 2026 03:40
84 lines
5651 bytes
5651 bytes
Hi,
On 11/12/26 8:12 AM, Agustin Martin wrote:
> $ git clone https://salsa.debian.org/electronics-team/nextpnr.git --recurse-submodules
That does not set up submodules, because none of the existing git
mappings for Debian source packages has submodule support, so the
"upstream" branch merges them (and omits the excluded files). It should
perhaps omit the .gitmodules file, but that's a different problem.
The watch file points to another git server though, which *does* have
submodules.
Now uscan, when run from a checkout, will check if we already have a
remote configured for the server listed in the watch file, to avoid a
clone if we already have one. That is good.
The problem is that in order to also get the submodule contents from the
existing clone, the submodule's base URL must also be configured as a
remote.
So, after
> Cloning into 'nextpnr'...
> ...
> $ cd nextpnr
You can run uscan there with no problem, but it will do a full clone
into a temporary directory:
$ uscan -ddd
[some warnings]
Successfully repacked ../nextpnr-0.11.1.tar.xz as
../nextpnr_0.11.1+dfsg.orig.tar.xz, deleting 461 files from it.
$ tar -tJvvf ../nextpnr_0.11.1+dfsg.orig.tar.xz nextpnr-0.11.1/tests/ |
wc -l
260
If you add
$ git remote add yosyshq https://github.com/YosysHQ/nextpnr.git
running uscan will detect that the "yosyshq" remote can be used, and no
fresh clone is necessary. It will even fetch from the remote first:
$ uscan -ddd
[fetch output]
Could not access submodule '3rdparty/abseil-cpp' at commit 0afa0da1
Could not access submodule '3rdparty/corrosion' at commit 06992bda
Could not access submodule '3rdparty/googletest' at commit 64db93e3
Could not access submodule '3rdparty/fpga-interchange-schema' at commit
ba69b355
Could not access submodule 'himbaechel/uarch/xilinx/meta' at commit 0cd6e72d
Could not access submodule 'tests' at commit cd7f7c12
Could not access submodule 'torc' at commit 36edbdcb
fatal: Use '--all' if you really want to deinitialize all submodules
Successfully repacked ../nextpnr-0.11.1.tar.xz as
../nextpnr_0.11.1+dfsg.orig.tar.xz, deleting 461 files from it.
but tests/ is empty:
$ tar -tJvvf ../nextpnr_0.11.1+dfsg.orig.tar.xz nextpnr-0.11.1/tests/ |
wc -l
1
The problem seems to be that uscan tries to avoid using the working
directory, except during submodule handling, where it uses whatever is
currently checked out (so if upstream changes the list of submodules,
that is ignored as well).
> So, seems that intially submodules were not declared as submodules, but
> present in the repo. This did not happen when using upstream git repo (what
> happens when there is no remote defined). If I now add the remote and run
> "uscan --download-current-version" created upstream tarball contains
> tests/ contents, but not the contents for other submodules.
Yes, because now tests/ is a submodule in the current working directory
-- but that is local state influencing the output of uscan, when all we
want is to use the cached objects -- and what's probably worse, uscan
also changes local state by attempting to deinitialize and reinitialize
the submodules.
Simon
Technical Details
Message-ID:
<NYtPk-blRW-9@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<Nw1g5-dc1o-15@gated-at.bofh.it> <Nw1g5-dc1o-15@gated-at.bofh.it> <NA2Qi-fnN2-23@gated-at.bofh.it> <Nw1g5-dc1o-15@gated-at.bofh.it> <NO4pb-5rsB-15@gated-at.bofh.it> <NYpLH-bjAF-1@gated-at.bofh.it> <Nw1g5-dc1o-15@gated-at.bofh.it> <NYpLH-bjAF-1@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Simon Richter <sjr@debian.org> Newsgroups: linux.debian.bugs.dist Subject: Bug#1145549: fails to download submodules if run from git checkout and upstream is configured as remote Date: Thu, 12 Nov 2026 04:40:02 +0100 Message-ID: <NYtPk-blRW-9@gated-at.bofh.it> References: <Nw1g5-dc1o-15@gated-at.bofh.it> <Nw1g5-dc1o-15@gated-at.bofh.it> <NA2Qi-fnN2-23@gated-at.bofh.it> <Nw1g5-dc1o-15@gated-at.bofh.it> <NO4pb-5rsB-15@gated-at.bofh.it> <NYpLH-bjAF-1@gated-at.bofh.it> <Nw1g5-dc1o-15@gated-at.bofh.it> <NYpLH-bjAF-1@gated-at.bofh.it> X-Original-To: Agustin Martin <agmartin@debian.org>, 1145549@bugs.debian.org X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Thu Nov 12 03:35:08 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.7 Reply-To: Simon Richter <sjr@debian.org>, 1145549@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: devscripts@packages.debian.org X-Debian-Pr-Message: followup 1145549 X-Debian-Pr-Package: devscripts X-Debian-Pr-Source: devscripts MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Debian-User: sjr X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2002151 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 84 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: Hugh McMaster <hmc@debian.org> X-Original-Date: Thu, 12 Nov 2026 12:32:44 +0900 X-Original-Message-ID: <dc404f34-c781-47d3-a54f-147a3e62f696@debian.org> X-Original-References: <178767150187.15208.1608292962938188952.reportbug@lime.hogyros.de> <178767150187.15208.1608292962938188952.reportbug@lime.hogyros.de> <apxXj2N9z25BgYKI@lenovo-sid.aq.upm.es> <178767150187.15208.1608292962938188952.reportbug@lime.hogyros.de> <as9XMjxEAvzLPMt1@lenovo-sid.aq.upm.es> <avT2ZCp6JjLeY2cS@lenovo-sid.aq.upm.es> <178767150187.15208.1608292962938188952.reportbug@lime.hogyros.de> <avT2ZCp6JjLeY2cS@lenovo-sid.aq.upm.es>