git_repo: Fetching fails when shallow repo already exists in sources directory
bst source track components/spirv-llvm-translator.bst
failed with
======================================================================
BuildStream 2.0.1 - Monday, 03-04-2023 at 07:05:15
[--:--:--] START [e754c9aa] components/spirv-llvm-translator.bst: Track
[--:--:--] STATUS components/spirv-llvm-translator.bst: Tracking llvm_release_150 from https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git
[--:--:--] STATUS components/spirv-llvm-translator.bst: Tracked refs/heads/llvm_release_150: 068260b61669d7b3e50ce82b19737be548e0762f
[--:--:--] START components/spirv-llvm-translator.bst: Fetching from https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git
[--:--:--] STATUS components/spirv-llvm-translator.bst: Fetching 068260b61669d7b3e50ce82b19737be548e0762f
[00:00:07] FAILURE components/spirv-llvm-translator.bst: Fetching from https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git
[00:00:10] FAILURE [e754c9aa] components/spirv-llvm-translator.bst: failed to fetch: not enough values to unpack (expected 2, got 1)
- Freedesktop SDK: git 21280f7342b3d435f7741ba5c77d58b39c83e096
- Buildstream run in container: registry.gitlab.com/freedesktop-sdk/infrastructure/freedesktop-sdk-docker-images/bst2:b9943e56c65deee32ddf19d6e4f3a624edb4db4d
If I don't catch other Exception at https://gitlab.com/BuildStream/bst-plugins-experimental/-/blob/master/src/bst_plugins_experimental/sources/git_repo.py#L247 , the full trace shows:
An unhandled exception occured:
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/buildstream/_scheduler/jobs/job.py", line 438, in child_action
result = self.child_process() # pylint: disable=assignment-from-no-return
File "/usr/lib/python3.10/site-packages/buildstream/_scheduler/jobs/elementjob.py", line 91, in child_process
return self._action_cb(self._element)
File "/usr/lib/python3.10/site-packages/buildstream/_scheduler/queues/trackqueue.py", line 65, in _track_element
return element._track()
File "/usr/lib/python3.10/site-packages/buildstream/element.py", line 1390, in _track
return self.__sources.track(self._get_workspace())
File "/usr/lib/python3.10/site-packages/buildstream/_elementsources.py", line 97, in track
new_ref = source._track()
File "/usr/lib/python3.10/site-packages/buildstream/source.py", line 1202, in _track
new_ref = self.__do_track()
File "/usr/lib/python3.10/site-packages/buildstream/source.py", line 1438, in __do_track
ref = new_source.track(**kwargs) # pylint: disable=assignment-from-none
File "/src/.bst/staged-junctions/plugins/bst-plugins-experimental.bst/5442208eddd1a5d1110bf639f57e6c6bafabfc5f050e4f76025ca3628dacd674/src/bst_plugins_ex
perimental/sources/git_repo.py", line 428, in track
fetcher.fetch()
File "/src/.bst/staged-junctions/plugins/bst-plugins-experimental.bst/5442208eddd1a5d1110bf639f57e6c6bafabfc5f050e4f76025ca3628dacd674/src/bst_plugins_ex
perimental/sources/git_repo.py", line 243, in fetch
remote_refs = client.fetch(
File "/usr/lib/python3.10/site-packages/dulwich/client.py", line 837, in fetch
result = self.fetch_pack(
File "/usr/lib/python3.10/site-packages/dulwich/client.py", line 2112, in fetch_pack
(new_shallow, new_unshallow) = _read_shallow_updates(
File "/usr/lib/python3.10/site-packages/dulwich/client.py", line 428, in _read_shallow_updates
cmd, sha = pkt.split(b" ", 1)
ValueError: not enough values to unpack (expected 2, got 1)
Edited by Seppo Yli-Olli