[Bug] CPack button is on status bar, but no CPack commands appear in command palette.
Brief Issue Summary
Going by the json file in the tree it looks like the CPack commands are only enabled when useCMakePresets is true. I'm not sure why this is. However, we have been using CPack up until now by clicking the icon in the toolbar and it works fine, but the corresponding command is not there in the command palette. This seems backwards, is it intentional?
CMake Tools Diagnostics
{
"os": "linux",
"vscodeVersion": "1.97.2",
"cmtVersion": "1.20.53",
"configurations": [
{
"folder": "/workspace",
"cmakeVersion": "3.28.3",
"configured": true,
"generator": "Ninja",
"usesPresets": false,
"compilers": {
"C": "/var/yocto-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc",
"CXX": "/var/yocto-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++"
}
},
{
"folder": "/root/build/great-lakes",
"cmakeVersion": "unknown",
"configured": false,
"generator": "unknown",
"usesPresets": false,
"compilers": {}
}
],
"cpptoolsIntegration": {
"isReady": true,
"hasCodeModel": true,
"activeBuildType": "Debug",
"buildTypesSeen": [
"Debug"
],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 119,
"executablesCount": 78,
"librariesCount": 13,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": true
},
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": true
}
]
}
Debug Log
Not applicable to this bug
Additional Information
No response
Hi @rmerrill-fw Thanks for reporting issue here!
Verified this issue on CMake Tools v1.21.22(pre-release) and v1.20.53(release), the test result as below:
- Pack commands in the command palette and project status of CMake pane all are enabled when
usesPresetsis true, and I didn't see the pack related icon on status bar. - Pack commands in the command palette and project status of CMake pane all are disabled when
usesPresetsis false.
I have recorded a video to display the process, please correct if there is difference with yours.
@Amy-Li03 The main way your result differs is that I have the CPack icon on the status bar. I have no idea why that would be different, or why you don't have it in either case.
I am also missing Pack from the project status view, which I did not look at initially.
@rmerrill-fw could you please try reinstall the CMake Tools Extension, reset the state of the extension by running command CMake: Reset CMake Tools Extension State?
Sorry are you asking me to do both of those things or try them one at a time? I tried resetting extension state and not much happened.
Can you help me out by answering whether it's expected that CPack is only supported with presets, and if so why?
@rmerrill-fw please check what's the value of cmake-> options: Status Bar Visibility, maybe your choose is visible. so you have the CPack icon on the status bar.
Can you help me out by answering whether it's expected that CPack is only supported with presets, and if so why?
I think yes, it's expected that CPack is only supported with presets. @gcampbell-msft could you please help confirm this?
My setting is icon.
This is what I see.
My setting is
icon.
This is what I see.
That is the correct behavior.
That is the correct behavior.
OK, but why is the package icon showing up in this toolbar when CPack is otherwise disabled? Shouldn't the pack icon also be gone if CPack is disabled?
I'm able to run CPack by clicking that icon, but I'm not able to invoke it any other way.
That is the correct behavior.
OK, but why is the package icon showing up in this toolbar when CPack is otherwise disabled? Shouldn't the pack icon also be gone if CPack is disabled?
This seems like a bug, the package icon should be gone in status bar when CPack is disabled.
I'm able to run CPack by clicking that icon, but I'm not able to invoke it any other way.
You can also invoke CPack by running the CMake: Run CPack command in the Command Palette.
This seems like a bug, the package icon should be gone in status bar when CPack is disabled.
Yes, that would in fact be a bug. THIS bug, that I filed an issue for!
You can also invoke CPack by running the
CMake: Run CPackcommand in the Command Palette.
As I said in the description of the issue, those commands do not appear for me... because I am not using presets. However, I can still run it by clicking the CPack icon and it works fine.
We have finally arrived at the behavior I initially described :)
Summary this issue:
- When using presets, CPack is supported, CPack commands in the command palette and project status of CMake pane all are enabled , and CPack icon is on status bar when setting cmake-> options: Status Bar Visibility as icon.
- When not using presets, CPack is not supported, CPack commands in the command palette and project status of CMake pane all are disabled, but CPack icon is still on status bar when setting cmake-> options: Status Bar Visibility as icon(this is a bug).
@rmerrill-fw @Amy-Li03 In short, from reading the comments above, it sounds like it's a simple bug of when the CPack buttons or icons are available.
By our current design, cpack options and buttons should be conditional on the use of presets, because the cpack support comes from Package Presets.
Thanks for notifying us of the bug, we will work to fix it.
Thank you @gcampbell-msft and @Amy-Li03 !