build: Add devcontainer manifest for our CI image

Devcontainer [1] is a popular container schema that makes
IDEs and tooling aware about the container image you want
to use and develop against.

The most popular implementation of devcontainer are Visual
Studio and VSCode and this allows us to have a out of the
box pre-defined and working build environment that is very
close to the environment CI runs against.

This also allows VSCode on Windows and Mac to setup a
Linux docker container (vm) to develop against if so
desired.

[1] https://containers.dev/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7816>
This commit is contained in:
Jordan Petridis 2024-10-28 14:21:56 +02:00 committed by GStreamer Marge Bot
parent 2aa7dcd715
commit db17f54253
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,35 @@
{
"name": "GStreamer Dev Toolbox",
"image": "registry.freedesktop.org/gstreamer/gstreamer/amd64/fedora:gst-toolbox-main",
"containerUser": "containeruser",
"remoteUser": "containeruser",
"postCreateCommand": ["python3", "${containerWorkspaceFolder}/ci/scripts/handle-subprojects-cache.py" ,"--cache-dir", "/subprojects", "subprojects/"],
"privileged": false,
"capAdd": [ "SYS_PTRACE" ],
"customizations": {
"vscode": {
"settings": {
"files.watcherExclude": {
"**/target/**": true
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
},
"extensions": [
"charliermarsh.ruff",
"GitLab.gitlab-workflow",
"mesonbuild.mesonbuild",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.python",
"ms-vscode.cpptools",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"vadimcn.vscode-lldb"
]
}
}
}

View File

@ -8,5 +8,10 @@ git -C /gstreamer submodule update --init --depth=1
meson subprojects download --sourcedir /gstreamer
./ci/scripts/handle-subprojects-cache.py --build --cache-dir /subprojects /gstreamer/subprojects/
# Avoid the cache being owned by root
# and make sure its readable to anyone
chown containeruser:containeruser --recursive /subprojects/
chmod --recursive a+r /subprojects/
# Now remove the gstreamer clone
rm -rf /gstreamer