]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-init-build-env: Drop VSCode setup
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Thu, 26 Feb 2026 20:19:50 +0000 (21:19 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 2 Mar 2026 18:02:33 +0000 (18:02 +0000)
Remove the VSCode setup from oe-init-build-env.

Since poky as a combo-layer repository is no longer available, using the
oe-init-build-env script from openembedded-core is no longer
straightforward. There are too many ways to set up a build environment,
with different directory structures, with containers involved or not,
etc. Each of these setups may have its own way to provide IDE support.
A simple shell script like oe-init-vscode cannot address all these use
cases. Rather than trying to make oe-init-build-env smart enough to
cover all these cases, it is better to delegate the responsibility to
whatever tool or repository is used to set up the build environment.

If no tool such as bitbake-setup is used, it is still possible to use
a variant of the oe-setup-vscode script from a custom layer. One way
which works well is to create a custom oe-init-build-env script in the
custom layer repository which calls the custom oe-setup-vscode script
from the custom layer repository. Example directory structure:

  my-project/
  ├── .vscode     # generated by oe-setup-vscode
  |               # when oe-init-build-env is called
  ├── layers/
  │   └── openembedded-core/
  |   └── bitbake/
  ├── scripts/
  │   └── oe-setup-vscode
  ├── build/
  │   └── conf
  └── oe-init-build-env

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oe-init-build-env
scripts/oe-setup-vscode [deleted file]

index 82382f27078f6a7cd909f7c34be5fda85e37ce62..5a2bd0f4d9d7d8df645f9dd81945e95618514c75 100755 (executable)
@@ -48,11 +48,6 @@ export OEROOT
     return 1
 }
 
-# Generate an initial configuration for VSCode and the yocto-bitbake plugin.
-if command -v code > /dev/null && [ ! -d "$OEROOT/.vscode" ]; then
-    oe-setup-vscode "$OEROOT" "$BUILDDIR"
-fi
-
 unset OEROOT
 
 [ -z "$BUILDDIR" ] || cd "$BUILDDIR"
diff --git a/scripts/oe-setup-vscode b/scripts/oe-setup-vscode
deleted file mode 100755 (executable)
index b864278..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-
-usage() {
-    echo "$0 <OEINIT> <BUILDDIR>"
-    echo "  OEINIT:   path to directory where the .vscode folder is"
-    echo "  BUILDDIR: directory passed to the oe-init-setup-env script"
-}
-
-if [ "$#" -ne 2 ]; then
-    usage
-    exit 1
-fi
-
-OEINIT=$(readlink -f "$1")
-BUILDDIR=$(readlink -f "$2")
-VSCODEDIR=$OEINIT/.vscode
-
-if [ ! -d "$OEINIT" ] || [ ! -d "$BUILDDIR" ]; then
-    echo "$OEINIT and/or $BUILDDIR directories are not present."
-    exit 1
-fi
-
-VSCODE_SETTINGS=$VSCODEDIR/settings.json
-ws_builddir="$(echo "$BUILDDIR" | sed -e "s|$OEINIT|\${workspaceFolder}|g")"
-
-# If BUILDDIR is in scope of VSCode ensure VSCode does not try to index the build folder.
-# This would lead to a busy CPU and finally to an OOM exception.
-mkdir -p "$VSCODEDIR"
-cat <<EOMsettings > "$VSCODE_SETTINGS"
-{
-    "bitbake.pathToBitbakeFolder": "\${workspaceFolder}/bitbake",
-    "bitbake.pathToEnvScript": "\${workspaceFolder}/oe-init-build-env",
-    "bitbake.pathToBuildFolder": "$ws_builddir",
-    "bitbake.commandWrapper": "",
-    "bitbake.workingDirectory": "\${workspaceFolder}",
-    "files.exclude": {
-        "**/.git/**": true,
-        "**/_build/**": true,
-        "**/buildhistory/**": true,
-        "**/cache/**": true,
-        "**/downloads/**": true,
-        "**/node_modules/**": true,
-        "**/oe-logs/**": true,
-        "**/oe-workdir/**": true,
-        "**/sstate-cache/**": true,
-        "**/tmp*/**": true,
-        "**/workspace/attic/**": true,
-        "**/workspace/sources/**": true
-    },
-    "files.watcherExclude": {
-        "**/.git/**": true,
-        "**/_build/**": true,
-        "**/buildhistory/**": true,
-        "**/cache/**": true,
-        "**/downloads/**": true,
-        "**/node_modules/**": true,
-        "**/oe-logs/**": true,
-        "**/oe-workdir/**": true,
-        "**/sstate-cache/**": true,
-        "**/tmp*/**": true,
-        "**/workspace/attic/**": true,
-        "**/workspace/sources/**": true
-    },
-    "python.analysis.exclude": [
-        "**/_build/**",
-        "**/.git/**",
-        "**/buildhistory/**",
-        "**/cache/**",
-        "**/downloads/**",
-        "**/node_modules/**",
-        "**/oe-logs/**",
-        "**/oe-workdir/**",
-        "**/sstate-cache/**",
-        "**/tmp*/**",
-        "**/workspace/attic/**",
-        "**/workspace/sources/**"
-    ]
-}
-EOMsettings
-
-
-# Ask the user if the yocto-bitbake extension should be installed
-VSCODE_EXTENSIONS=$VSCODEDIR/extensions.json
-cat <<EOMextensions > "$VSCODE_EXTENSIONS"
-{
-    "recommendations": [
-        "yocto-project.yocto-bitbake"
-    ]
-}
-EOMextensions
-
-echo "You had no $VSCODEDIR configuration."
-echo "These configuration files have therefore been created for you."