Snapcraft crashing when using alsa parts manually in snap

I can’t seems to build using alsa parts manually even tried with fresh snapcraft.yaml.

And I know I can use below alsa parts to build snap fine but I want to use different PATHS on configdir and plugindir for content interface.

  alsa:
    after: [alsa-plugins, alsa-lib]
  alsa-plugins:
    after: [alsa-lib]

I’m getting into this error when locally building the snap.

Sorry, Snapcraft ran into an error when trying to running through its
lifecycle that generated a trace that has been put in '/tmp/tmpycfhw0sg/trace.txt'.
You can anonymously report this issue to the snapcraft developers.
No other data than this traceback and the version of snapcraft in
use will be sent.
Would you like send this error data? (Yes/No/Always) [no]:
Traceback (most recent call last):
  File "/snap/snapcraft/1803/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.43', 'console_scripts', 'snapcraft')()
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 115, in prime
    _execute(steps.PRIME, parts, **kwargs)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 30, in _execute
    project = get_project(**kwargs)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/snapcraft/cli/_options.py", line 68, in get_project
    snapcraft_yaml_file_path=snapcraft_yaml_file_path,
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/snapcraft/project/_project.py", line 48, in __init__
    self.info = ProjectInfo(snapcraft_yaml_file_path=snapcraft_yaml_file_path)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/snapcraft/project/_project_info.py", line 32, in __init__
    self.__raw_snapcraft = _load_yaml(yaml_file_path=snapcraft_yaml_file_path)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/snapcraft/project/_project_info.py", line 64, in _load_yaml
    yaml_contents = yaml.safe_load(fp)  # type: ignore
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/yaml/__init__.py", line 94, in safe_load
    return load(stream, SafeLoader)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/yaml/__init__.py", line 72, in load
    return loader.get_single_data()
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/yaml/constructor.py", line 35, in get_single_data
    node = self.get_single_node()
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/snap/snapcraft/1803/lib/python3.5/site-packages/yaml/parser.py", line 439, in parse_block_mapping_key
    "expected <block end>, but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block mapping
  in "snap/snapcraft.yaml", line 1, column 1
expected <block end>, but found '<block mapping start>'
  in "snap/snapcraft.yaml", line 28, column 2

your indentation is screwed-up. you’ve set the alsa definition as top-level, not nested beneath parts:. Also, alsa-lib definition is not indented properly - one space instead of two (two spaces are required because that’s what you used for enable-i386.)

3 Likes

oops silly me:man_facepalming: good catch daniel :+1:

1 Like