vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

[Bug] CPack button is on status bar, but no CPack commands appear in command palette.

Open rmerrill-fw opened this issue 7 months ago • 13 comments

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

rmerrill-fw avatar May 06 '25 18:05 rmerrill-fw

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:

  1. Pack commands in the command palette and project status of CMake pane all are enabled when usesPresets is true, and I didn't see the pack related icon on status bar.
  2. Pack commands in the command palette and project status of CMake pane all are disabled when usesPresets is false.

I have recorded a video to display the process, please correct if there is difference with yours.

Image

Amy-Li03 avatar May 08 '25 06:05 Amy-Li03

@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 avatar May 22 '25 22:05 rmerrill-fw

@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?

Amy-Li03 avatar May 23 '25 05:05 Amy-Li03

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 avatar May 28 '25 22:05 rmerrill-fw

@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. Image

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?

Amy-Li03 avatar May 29 '25 07:05 Amy-Li03

My setting is icon.

Image

This is what I see.

Image

rmerrill-fw avatar May 29 '25 19:05 rmerrill-fw

My setting is icon.

Image

This is what I see.

Image

That is the correct behavior.

Amy-Li03 avatar May 30 '25 07:05 Amy-Li03

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.

rmerrill-fw avatar May 30 '25 17:05 rmerrill-fw

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.

Amy-Li03 avatar Jun 03 '25 02:06 Amy-Li03

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 CPack command 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 :)

rmerrill-fw avatar Jun 03 '25 03:06 rmerrill-fw

Summary this issue:

  1. 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.
  2. 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).

Amy-Li03 avatar Jun 04 '25 02:06 Amy-Li03

@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.

gcampbell-msft avatar Jun 09 '25 14:06 gcampbell-msft

Thank you @gcampbell-msft and @Amy-Li03 !

rmerrill-fw avatar Jun 10 '25 20:06 rmerrill-fw