`bst shell` is giving a bug trace when using `--mount`

Open
#2,151 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
cli, tooling

Research direction

Reproduce the failure with bst shell components/python3-mkdocs.bst --mount /src/tests/ -- mkdocs build. Start at buildstream/element.py in _shell, then follow the mount handling into buildstream/sandbox/sandbox.py at mark_directory; compare this path with the CLI shell entry point in buildstream/_frontend/cli.py. Done means the reported mount command runs without the assertion or bug trace.

Written by the indexing model from the issue text.

Description

logging

I'm trying to work out good ways to add some tests to a bst project

I thought about using some of the software inside a shell, this works for basic command --help tests.

toolchain-2026-06-03 src # bst shell components/python3-mkdocs.bst -- mkdocs --help
[--:--:--][        ][    main:core activity                 ] START   Loading elements
[00:00:00][        ][    main:core activity                 ] SUCCESS Loading elements
[--:--:--][        ][    main:core activity                 ] START   Resolving elements
[00:00:00][        ][    main:core activity                 ] SUCCESS Resolving elements
[--:--:--][        ][    main:core activity                 ] START   Initializing remote caches
[00:00:02][        ][    main:core activity                 ] SUCCESS Initializing remote caches
[--:--:--][        ][    main:core activity                 ] START   Query cache
[00:00:00][        ][    main:core activity                 ] SUCCESS Query cache
[--:--:--][d37eff3b][    main:components/python3-mkdocs.bst ] START   Staging dependencies
[00:00:00][d37eff3b][    main:components/python3-mkdocs.bst ] SUCCESS Staging dependencies
[--:--:--][d37eff3b][    main:components/python3-mkdocs.bst ] START   Integrating sandbox
[00:00:00][d37eff3b][    main:components/python3-mkdocs.bst ] SUCCESS Integrating sandbox
[--:--:--][d37eff3b][    main:components/python3-mkdocs.bst ] STATUS  Running command

    mkdocs --help

Usage: mkdocs [OPTIONS] COMMAND [ARGS]...

  MkDocs - Project documentation with Markdown.

Options:
  -V, --version         Show the version and exit.
  -q, --quiet           Silence warnings
  -v, --verbose         Enable verbose output
  --color / --no-color  Force enable or disable color and wrapping for the output. Default is auto-detect.
  -h, --help            Show this message and exit.

Commands:
  build      Build the MkDocs documentation.
  get-deps   Show required PyPI packages inferred from plugins in mkdocs.yml.
  gh-deploy  Deploy your documentation to GitHub Pages.
  new        Create a new MkDocs project.
  serve      Run the builtin development server.
dcs-toolchain-2026-06-03 src # 

but when i try to add a example project to use i need to use --mount which triggers a bug for me

toolchain-2026-06-03 src # ls /src/tests/
config.yml  index.md

toolchain-2026-06-03 src # bst shell components/python3-mkdocs.bst --mount /src/tests/ -- mkdocs build
[--:--:--][        ][    main:core activity                 ] START   Loading elements
[00:00:00][        ][    main:core activity                 ] SUCCESS Loading elements
[--:--:--][        ][    main:core activity                 ] START   Resolving elements
[00:00:00][        ][    main:core activity                 ] SUCCESS Resolving elements
[--:--:--][        ][    main:core activity                 ] START   Initializing remote caches
[00:00:02][        ][    main:core activity                 ] SUCCESS Initializing remote caches
[--:--:--][        ][    main:core activity                 ] START   Query cache
[00:00:00][        ][    main:core activity                 ] SUCCESS Query cache
[--:--:--][d37eff3b][    main:components/python3-mkdocs.bst ] START   Staging dependencies
[00:00:00][d37eff3b][    main:components/python3-mkdocs.bst ] SUCCESS Staging dependencies
[--:--:--][d37eff3b][    main:components/python3-mkdocs.bst ] START   Integrating sandbox
[00:00:00][d37eff3b][    main:components/python3-mkdocs.bst ] SUCCESS Integrating sandbox
[--:--:--][        ][    main:core activity                 ] BUG     The directories marked in the sandbox must be absolute paths

    Traceback (most recent call last):
      File "/usr/sbin/bst", line 8, in <module>
        sys.exit(cli())
                 ~~~^^
      File "/usr/lib/python3.13/site-packages/click/core.py", line 1442, in __call__
        return self.main(*args, **kwargs)
               ~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.13/site-packages/buildstream/_frontend/cli.py", line 282, in override_main
        original_main(self, args=args, prog_name=prog_name, complete_var=None, standalone_mode=standalone_mode, **extra)
        ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.13/site-packages/click/core.py", line 1363, in main
        rv = self.invoke(ctx)
      File "/usr/lib/python3.13/site-packages/click/core.py", line 1830, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
                               ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
      File "/usr/lib/python3.13/site-packages/click/core.py", line 1226, in invoke
        return ctx.invoke(self.callback, **ctx.params)
               ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.13/site-packages/click/core.py", line 794, in invoke
        return callback(*args, **kwargs)
      File "/usr/lib/python3.13/site-packages/click/decorators.py", line 46, in new_func
        return f(get_current_context().obj, *args, **kwargs)
      File "/usr/lib/python3.13/site-packages/buildstream/_frontend/cli.py", line 774, in shell
        exitcode = app.stream.shell(
            target,
        ...<9 lines>...
            ignore_project_source_remotes=ignore_project_source_remotes,
        )
      File "/usr/lib/python3.13/site-packages/buildstream/_stream.py", line 360, in shell
        return element._shell(
               ~~~~~~~~~~~~~~^
            scope, mounts=mounts, isolate=isolate, prompt=prompt(element), command=command, usebuildtree=usebuildtree
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/usr/lib/python3.13/site-packages/buildstream/element.py", line 2099, in _shell
        sandbox.mark_directory(mount.path)
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "/usr/lib/python3.13/site-packages/buildstream/sandbox/sandbox.py", line 168, in mark_directory
        assert directory.startswith("/"), "The directories marked in the sandbox must be absolute paths"
               ~~~~~~~~~~~~~~~~~~~~^^^^^
    AssertionError: The directories marked in the sandbox must be absolute paths
Dominant language
Python
Stars
144
Forks
45
Avg merge
20h 38m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/buildstream

All issues in apache/buildstream

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.