Skip to content

Attaching to a running docker container VSCode session still uses the host environment #415

@yassibeh

Description

@yassibeh

Question:
I've launched a Docker container with full configuration and sourced the environment during the build process. By doing this, I am able to run any bitbake command directly from my terminal without needing to source anything. I’ve tested various sanity check commands, such as which bitbake, which devtool, and bitbake-layers show-layers, and everything works fine in the container. Despite having the correct paths and everything appearing fine, the sanity check still fails and can't even run which bitbake, and I can't figure out why.

Here’s my devcontainer.json configuration that should enable the Bitbake extension to work without needing any extra environment setup:

{
  "workspaceFolder": "/home/user/Documents/Prj_1/mep",
  "extensions": [
    "mads-hartmann.bash-ide-vscode",
    "ms-python.debugpy",
    "ms-python.python",
    "ms-python.vscode-pylance",
    "yocto-project.yocto-bitbake"
  ],
  "settings": {
    "bitbake.loggingLevel": "debug",
    "files.watcherExclude": {
      "**/.git/**": true,
      "**/build_*": true,
      "./Delivery*/**": true,
      "./packages/**": true
    },
    "files.associations": {
      "*.conf": "bitbake",
      "*.inc": "bitbake"
    },
    "search.exclude": {
      "**/build_*": true
    },
    "bitbake.pathToBitbakeFolder": "${workspaceFolder}/bitbake",
    "bitbake.sdkImage": "mgdp-biosdk-image",
    "bitbake.commandWrapper": "",
    "python.analysis.exclude": [
      "**/build_*"
    ],
    "python.autoComplete.extraPaths": [
      "${workspaceFolder}/sources/poky/bitbake/lib",
      "${workspaceFolder}/sources/poky/meta/lib",
      "${workspaceFolder}/bitbake/lib",
      "${workspaceFolder}/meta/lib"
    ],
    "python.analysis.extraPaths": [
      "${workspaceFolder}/sources/poky/bitbake/lib",
      "${workspaceFolder}/sources/poky/meta/lib",
      "${workspaceFolder}/bitbake/lib",
      "${workspaceFolder}/meta/lib"
    ],
    "bitbake.disableConfigModification": true
  }
}

Despite all configurations being correct and logging level set to "debug", the output is still empty, and I am not sure what’s wrong. Any suggestions?

Another separate question unrelated to the first one :
Additionally, I have a script that takes multiple configuration options as parameters. Based on the selected configuration, I need to source the terminal before running bitbake. The command looks like this:

./script_setup -arg config_case.conf

I want to know how to use bitbake.shellEnv for this purpose. Can anyone provide examples of how to configure this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    contribution welcomeMaintainers haven't planned to address this but welcome external PRsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions