Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The buildKitTargetOs is unknown if a kit is defined with toolchainFile only #4274

Open
RichardLuo0 opened this issue Feb 8, 2025 · 5 comments
Labels
more info needed More info is needed from the community for us to properly triage and investigate.

Comments

@RichardLuo0
Copy link
Contributor

RichardLuo0 commented Feb 8, 2025

Brief Issue Summary

I have a kit like this;

{
  "name": "WASM",
  "toolchainFile": "C:\\emsdk\\upstream\\emscripten\\cmake\\Modules\\Platform\\Emscripten.cmake"
}

The ${buildKitTargetOs} becomes unknown. The compiler is defined in Emscripten.cmake

CMake Tools Diagnostics

Debug Log

Additional Information

No response

@github-project-automation github-project-automation bot moved this to Blocked in CMake Tools Feb 8, 2025
@github-actions github-actions bot added the triage label Feb 8, 2025
@RichardLuo0 RichardLuo0 changed the title The buildKitTargetOs is unknown if a kit is defined without compiler The buildKitTargetOs is unknown if a kit is defined with toolchainFile only Feb 8, 2025
@Amy-Li03
Copy link
Collaborator

Hi @RichardLuo0, thanks for reporting issue here!
I tried to reproduce your problem as best I could, and then I couldn't. I have recorded a video to show the process, please see the following video.
Image

Additionally, if you can provide a video, repro steps, a demo repro project in a zip file would be great, this will help us investigate this further.

@Amy-Li03 Amy-Li03 added more info needed More info is needed from the community for us to properly triage and investigate. and removed triage labels Feb 10, 2025
@RichardLuo0
Copy link
Contributor Author

I mean the ${buildKitTargetOs} in https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/cmake-settings.md#variable-substitution

If you set "cmake.buildDirectory": "${workspaceFolder}/build-${buildKitTargetOs}" in settings, it is substituted by unknown.

@Amy-Li03
Copy link
Collaborator

@RichardLuo0, thanks for your reply! If you can provide a demo repro project in a zip file would be great, this will help us investigate this further.

@RichardLuo0
Copy link
Contributor Author

@Amy-Li03
I did some more tests, and I found that only auto-generated kits (ie. generated by cmake: scan for kit) can use ${buildKitTargetOs}, ${buildKitTriple} and so on, otherwise it becomes none (I remember it was unknown but anyways). Is it by design??? So I guess it just extracts those variables from the kit name?
If that's the case, can you address it in the docs (eg. how do I name my custom kit so that it can be parsed)? However, I think a better way is to allow me to specify them in the kit, maybe adding variables like ${kitCmakeSettings: xxx} that reads from cmakeSettings in the kit.
cmake-test.zip

@Amy-Li03
Copy link
Collaborator

Amy-Li03 commented Feb 11, 2025

@RichardLuo0 thanks for your info!
I can repro your issue on our end, when we select custom kits, ${buildKitTargetOs} is build-none, however, it displays the correct buildKitTargetOs(ie. build-win32) when selecting auto-generated kits.

Image

@gcampbell-msft , could you please confirm whether this is by design?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed More info is needed from the community for us to properly triage and investigate.
Projects
Status: Blocked
Development

No branches or pull requests

2 participants