Skip to content

Git url without alias causes ValueError

Summary

Getting a traceback when tracking element without alias for git source.

Steps to reproduce

Have a git source with url: files/repo

bst track <element>

What is the current bug behavior?

Traceback

What is the expected correct behavior?

Failure with a suggested fix

Relevant logs and/or screenshots

    Traceback (most recent call last):
      File "/home/joshsmith/.local/bin/bst", line 8, in <module>
        sys.exit(cli())
      File "/home/joshsmith/.local/lib/python3.5/site-packages/click/core.py", line 722, in __call__
        return self.main(*args, **kwargs)
      File "/home/joshsmith/buildstream/buildstream/_frontend/cli.py", line 162, in override_main
        standalone_mode=standalone_mode, **extra)
      File "/home/joshsmith/.local/lib/python3.5/site-packages/click/core.py", line 697, in main
        rv = self.invoke(ctx)
      File "/home/joshsmith/.local/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/joshsmith/.local/lib/python3.5/site-packages/click/core.py", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/joshsmith/.local/lib/python3.5/site-packages/click/core.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "/home/joshsmith/.local/lib/python3.5/site-packages/click/decorators.py", line 27, in new_func
        return f(get_current_context().obj, *args, **kwargs)
      File "/home/joshsmith/buildstream/buildstream/_frontend/cli.py", line 420, in track
        cross_junctions=cross_junctions)
      File "/home/joshsmith/buildstream/buildstream/_stream.py", line 279, in track
        fetch_subprojects=True)
      File "/home/joshsmith/buildstream/buildstream/_stream.py", line 872, in _load
        fetch_subprojects=fetch_subprojects)
      File "/home/joshsmith/buildstream/buildstream/_pipeline.py", line 111, in load
        fetch_subprojects=fetch_subprojects)
      File "/home/joshsmith/buildstream/buildstream/_project.py", line 324, in load_elements
        for meta in meta_elements
      File "/home/joshsmith/buildstream/buildstream/_project.py", line 324, in <listcomp>
        for meta in meta_elements
      File "/home/joshsmith/buildstream/buildstream/element.py", line 883, in _new_from_meta
        first_pass=meta.first_pass)
      File "/home/joshsmith/buildstream/buildstream/_project.py", line 252, in create_source
        return self.config.source_factory.create(self._context, self, meta)
      File "/home/joshsmith/buildstream/buildstream/_sourcefactory.py", line 61, in create
        source = source_type(context, project, meta)
      File "/home/joshsmith/buildstream/buildstream/source.py", line 295, in __init__
        self.configure(self.__config)
      File "/home/joshsmith/buildstream/buildstream/plugins/sources/git.py", line 310, in configure
        self.mirror = GitMirror(self, '', self.original_url, ref)
      File "/home/joshsmith/buildstream/buildstream/plugins/sources/git.py", line 111, in __init__
        self.mark_download_url(url)
      File "/home/joshsmith/buildstream/buildstream/source.py", line 224, in mark_download_url
        alias, _ = url.split(utils._ALIAS_SEPARATOR, 1)
    ValueError: not enough values to unpack (expected 2, got 1)

Possible fixes

Other relevant information

  • BuildStream version affected: /milestone %BuildStream_v1.x

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information