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

The first build and run (Ctrl+F5) always starts in Debug mode disregarding Release settings.

Open pauljurczak opened this issue 1 year ago • 7 comments

Screenshot from 2023-12-19 23-14-56

Type: Bug

Fresh install of VS Code on Ubuntu 22.04.3. Added only C/C++ Extension Pack. Installed CMake and dependencies. Followed your getting started tutorial at https://code.visualstudio.com/docs/cpp/CMake-linux. Set CMake: Select Variant to Release. CMakeLists.txt also contains set(CMAKE_BUILD_TYPE "Release"). The first build and run (Ctrl+F5) always starts in Debug mode. The second and the following ones are correctly in Release mode.

Extension version: 1.3.0 VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:47:11.635Z) OS version: Linux x64 6.2.0-39-generic Modes:

System Info
Item Value
CPUs Intel(R) N100 (4 x 2917)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 1, 1, 1
Memory (System) 11.41GB (6.60GB free)
Process Argv --unity-launch --crash-reporter-id aef934d6-fd74-440a-a24f-e74f7a8cfae5
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE wayland
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30899288
vscaat:30438848
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
3biah626:30602489
f6dab269:30613381
showlangstatbar:30737416
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30902429
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
aa_t_chat:30882232
cp7184t:30925682

pauljurczak avatar Dec 20 '23 06:12 pauljurczak

Additional observations:

  1. Starting VSCode and clicking Build and Run icons on the bottom bar, behave correctly, i.e. program builds and runs in release mode.
  2. Starting VSCode and selecting Run -> Run Without Debugging results in this failure:

Screenshot from 2023-12-19 23-39-30

I suspect a duplication and discrepancy of project build settings between VSCode and CMake.

pauljurczak avatar Dec 20 '23 06:12 pauljurczak

@gcampbell-msft @sinemakinci1 this looks like an issue with CMake Tools, and maybe with the Getting Started documentation. Can you please take a look?

bobbrow avatar Dec 20 '23 17:12 bobbrow

I've been using VSCode with these extensions for several years and this bug was always there.

pauljurczak avatar Dec 20 '23 19:12 pauljurczak

Hi @pauljurczak Ctrl+F5 is actually meant to run in debug mode according to these docs. The docs say this:

Start a debugging session on the active target by running the CMake: Debug command from the VS Code command palette, by selecting the Debug button in the status bar or CMake Tools sidebar Project Status View, or by pressing the keyboard shortcut (the default is Ctrl+F5).

You should be able to run without debugging by using Shift+F5 according to these docs. The docs say this:

You can run a target without debugging it, by running the CMake: Run Without Debugging from VS Code's command palette, by selecting the play button in the status bar or the play button to the left of the Launch node, or by pressing the keyboard shortcut (the default Shift+F5).

I looked through the Getting Started documentation and didn't see where it says to use Ctrl+F5. Could you point me more specifically to where you saw that? Thanks!

snehara99 avatar Jan 02 '24 18:01 snehara99

The UI suggests Ctrl+F5 for Run without debugging, see:

Screenshot from 2024-01-02 15-22-41

pauljurczak avatar Jan 02 '24 22:01 pauljurczak

@pauljurczak thank you for the screenshot. We'll look more into it as soon as we have the capacity. Can you confirm if Shift + F5 works for you?

snehara99 avatar Jan 04 '24 15:01 snehara99

Yes, Shift+F5 works.

pauljurczak avatar Jan 04 '24 21:01 pauljurczak

@andreeis I think this might could be fixed by modifying the keybindings in the package.json.

gcampbell-msft avatar Jun 24 '24 15:06 gcampbell-msft