${env:...}
in customizations:vscode:settings
are interpolated from local env instead of remote env
#485
Labels
enhancement
New feature or request
I’m setting up a
devcontainers.json
that works with our container images containing a cross-compiling SDK. In the Dockerfile, we already define anENV SDK_NATIVE_SYSROOT=/path/to/sdk
pointing to the path where the SDK is installed. We set thecmake.cmakePath
to make thems-vscode.cmake-tools
extension use the CMake executable from our SDK. According to its documentation,cmake.cmakePath
supports expanding${env:...}
variables. Thus, I tried to use the following in my.devcontainer/devcontainer.json
:However, when running the above configuration, I get an error that the CMake executable cannot be found at
/usr/bin/cmake
. Thus, the${env:SDK_NATIVE_SYSROOT}
seems to expand to an empty string. Interestingly, the same setting works when placed in.vscode/settings.json
instead.After further investigation, I think the issue is that
${env:...}
in thecustomizations:vscode:settings
is evaluated/expanded on the local host before being passed to the remote. Thus,${env:SDK_NATIVE_SYSROOT}
results in an empty string since it's only defined in the container, not on my local host. From my understanding, this is unintended behaviour as thecustomizations:vscode:settings
are primarily to override settings specific to the devcontainer, and environment variables should be taken from theremoteEnv
instead oflocalEnv
.Is there a way to escape
${env:...}
or anything else that allows the use ofSDK_NATIVE_SYSROOT
from the container?The text was updated successfully, but these errors were encountered: