apache / apache/buildstream

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

Open
#2,151 1 comment 1 reaction 0 assignees View on GitHub
logging
Dominant language
Python
Stars
140
Forks
45
Avg merge
1d 3h
Merged PRs (30d)
6

Description

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
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
```

Contributor guide

Open the contributing guide

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.