microsoft / vscode-makefile-tools

MAKE integration in Visual Studio Code
Other
196 stars 60 forks source link

The latest release v0.10.25 does not work. #639

Closed xiahualiu closed 3 months ago

xiahualiu commented 3 months ago

It doesn't work anymore.

The Makefile Tools got stuck and it doesn't do anything nor print anything after the configuration is done (or not done, there is no compile_commands.json generated at all):

Output console:

Reading current configuration "XXX" from the workspace state.
Reading current build target "all" from the workspace state.
Dropping various extension output files at /home/xiahua.liu/.vscode-server/data/User/workspaceStorage/e2f27589a8d3b7583b9755985e1732a0/ms-vscode.makefile-tools
Logging level: Verbose
Configurations cached at /home/xiahua.liu/.vscode-server/data/User/workspaceStorage/e2f27589a8d3b7583b9755985e1732a0/ms-vscode.makefile-tools/configurationCache.log
Expanding from '${workspaceFolder}/software/Makefile' to '/home/xiahua.liu/myworkspace/software/Makefile' for setting 'makefilePath'.
Expanding from '${workspaceFolder}/software/' to '/home/xiahua.liu/myworkspace/software/' for setting 'makeDirectory'.
Expanding from '${workspaceFolder}/software/ci' to '/home/xiahua.liu/myworkspace/software/ci' for setting 'preConfigureScript'.
Found pre-configure script defined as /home/xiahua.liu/myworkspace/software/ci
Always pre-configure: true
Always post-configure: false
Dry-run switches: '--always-make', '--keep-going', '--print-directory'
Found the following configurations defined in makefile.configurations setting: XXX,YYY
No current launch configuration is set in the workspace state.
Default launch configuration: MIMode = undefined,
                miDebuggerPath = undefined,
                stopAtEntry = undefined,
                symbolSearchPath = undefined
Configure on open: null
Configure on edit: true
Configure after command: true
Only .PHONY targets: false
Save before build or configure: true
Build before launch: true
Clear output before build: true
Ignore directory commands: true
compile_commands.json path: /home/xiahua.liu/myworkspace/compile_commands.json
Deduced command 'make -f /home/xiahua.liu/myworkspace/software/Makefile -C /home/xiahua.liu/myworkspace/software/ TARGET=XXX' for configuration "XXX"

Extension Host (Not changed before and after v0.10.25):

2024-08-13 11:18:25.079 [info] Extension host with pid 15770 started
2024-08-13 11:18:25.104 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2024-08-13 11:18:25.104 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: false, activationEvent: 'onFileSystem:git', root cause: vscode.git
2024-08-13 11:18:25.105 [info] ExtensionService#_doActivateExtension cschlosser.doxdocgen, startup: false, activationEvent: 'onLanguage:cpp'
2024-08-13 11:18:25.105 [info] ExtensionService#_doActivateExtension llvm-vs-code-extensions.vscode-clangd, startup: false, activationEvent: 'onLanguage:cpp'
2024-08-13 11:18:25.105 [info] ExtensionService#_doActivateExtension ms-vscode.cpptools, startup: false, activationEvent: 'onLanguage:cpp'
2024-08-13 11:18:25.408 [info] Lock '/home/xiahua.liu/.vscode-server/data/User/workspaceStorage/e2f27589a8d3b7583b9755985e1732a0/vscode.lock': Lock acquired.
2024-08-13 11:18:25.502 [info] ExtensionService#_doActivateExtension vscode.git, startup: false, activationEvent: 'onFileSystem:git'
2024-08-13 11:18:26.106 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2024-08-13 11:18:26.138 [info] ExtensionService#_doActivateExtension ms-vscode.cmake-tools, startup: true, activationEvent: 'workspaceContains:.vscode/cmake-kits.json'
2024-08-13 11:18:26.430 [info] ExtensionService#_doActivateExtension vscode.configuration-editing, startup: false, activationEvent: 'onLanguage:json'
2024-08-13 11:18:26.430 [info] ExtensionService#_doActivateExtension vscode.extension-editing, startup: false, activationEvent: 'onLanguage:json'
2024-08-13 11:18:26.431 [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:json'
2024-08-13 11:18:26.431 [info] ExtensionService#_doActivateExtension vscode.npm, startup: false, activationEvent: 'onLanguage:json'
2024-08-13 11:18:26.874 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
2024-08-13 11:18:27.111 [info] ExtensionService#_doActivateExtension ms-vscode.makefile-tools, startup: true, activationEvent: 'workspaceContains:**/makefile,**/Makefile,**/GNUmakefile'
2024-08-13 11:18:36.111 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2024-08-13 11:18:36.112 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'

After that the extension is like this and VS Code showed activating extension all the time:

image

Please note this only happened after I upgraded it to v0.10.25, v0.9.10 didn't have any issue. I was using this tool on WSL:Ubuntu and Intellisense was disabled (I use clangd).

gcampbell-msft commented 3 months ago

@xiahualiu This is definitely an issue, however, there were not many significant changes made in 0.10 (see CHANGELOG here), and in our release testing we didn't see issues like the one you describe. All that simply to say, nothing immediately comes to mind of what could be going on.

To help us diagnose more, could you give us a couple of answers and try some other versions out?

  1. Could you try out the pre-release channel versions from before this official release? (i.e. 0.10.0 - 0.10.24) If you were able to find a specific pre-release version that started having this behavior for your, that would be incredibly helpful.
  2. What is the output in the "Makefile tools" output pane?
  3. If you click on the icon you screenshotted, in order to view the Project Outline, what do you see?
gcampbell-msft commented 3 months ago

@xiahualiu Also, in addition to the above information, if you could provide a sample project for us to try to reproduce with, that would be exceedingly helpful as well. Thanks for your patience and understanding.

xiahualiu commented 3 months ago

Thank you, sure no problem. I have tested that v0.10.1 is the last good version on my WSL. It stops working on v0.10.2 and later versions. I will create a demo project and see if I can reproduce it there.

gcampbell-msft commented 3 months ago

@xiahualiu What happens if you explicitly run the "Makefile: Configure" command?

gcampbell-msft commented 3 months ago

@xiahualiu Forgot to mention, when you project a demo project, it is necessary to also provide specific details about what OS you're on, and how to replicate your setup. Thanks

gcampbell-msft commented 3 months ago

I may have an inkling of the changes between that 0.10.1 and 0.10.2. What do you see as the setting for makefile.configureOnOpen when you open your project?

Also, do you see this pop-up in the bottom right corner? image

xiahualiu commented 3 months ago

This bug can be reproduced easily with the following demo project:

$ tree
.
├── Makefile
└── hello.c

0 directories, 2 files

$ cat hello.c 
#include <stdio.h>

int main() {
    printf("Hello World!\n");
}

$ cat Makefile 
hello: hello.c
        /usr/bin/gcc hello.c -o hello

And it will make the Makefile Tool stuck forever.

Our project also uses absolute paths for compilers because there are multiple cross compilers used in our project.

gcampbell-msft commented 3 months ago

@xiahualiu And to confirm you said that you were opening this in WSL?

xiahualiu commented 3 months ago

@xiahualiu And to confirm you said that you were opening this in WSL?

Yes, WSL, default Ubuntu OS.

xiahualiu commented 3 months ago

~If I change /usr/bin/gcc to gcc, then there is no problem at all, I suspect there is something wrong with the string handling code.~

No even after I rename it to gcc it still wouldn't work for some reason.

gcampbell-msft commented 3 months ago

I have found the issue, and I think that it's by design, I've reproed with your project and the reason that it's happening is that you need to answer the pop-up question about whether you want to configure using Makefile: image

Once you answer "Yes" to this question it configures and everything behaves as expected. image

Could you confirm that this resolves your issue?

xiahualiu commented 3 months ago

This pop-up question windows doesn't appear if I switch back to v0.9.10 and upgrade to v0.10.25.

gcampbell-msft commented 3 months ago

@xiahualiu While I believe that the above may resolve your issue, there is definitely a bug, and I believe I have a fix, could you manually install this vsix?

You'll first need to modify the extension to be .vsix instead of .zip. Thanks! makefile-tools.zip

xiahualiu commented 3 months ago

This zip file you uploaded worked for me. Thanks! Although I am still not seeing the pop up windows, but it worked just as v0.9.10.

gcampbell-msft commented 3 months ago

@xiahualiu The way to confirm my suspicion would be to navigate to makefile.configureOnOpen and click the gear icon and "reset" the setting. Then, when you reload, you should see the popup.

xiahualiu commented 3 months ago

You are correct, after toggling makefile.configureOnOpen to true and reload the window the Makefile Tool v0.10.25 just works as intended.

gcampbell-msft commented 3 months ago

Perfect, thanks for your quick responses and testing, I plan to get a PR merged as soon as I can to get a fix into the pre-release and then perform an official release as well with the fix.

gcampbell-msft commented 3 months ago

@xiahualiu The most recent pre-release contains the fix, could you test again on that? It'd be most helpful if you tested installing fresh and the update scenario with different values for "configureOnOpen". I very much appreciate your help.

xiahualiu commented 3 months ago

I can confirm pre-release v0.11.1 works fine for me.

Yingzi1234 commented 3 months ago

@gcampbell-msft We can reproduced this issue on makefile version v0.10.25(preview), you can get the details below. Thank you!

Repro steps:

  1. Open VSCode and clone this repo
  2. Open the VSCode settings and set the "Makefiel: Extension Output Folder" to .vscode
  3. Click F1 to run command "Makefile: configure"
  4. Check if the Makefile tools output window display "Configured successfully"

Actual result: Configuration Failed image

Output info: https://microsoft-my.sharepoint.com/:t:/p/v-cathyzhang/EfQysn_VKO5NqD65Reckp7oBEWg6X1d5j8byazFgYr2CoA?e=SibJiy

Yingzi1234 commented 3 months ago

@gcampbell-msft This issue has been fixed on latest Makfile version v0.11.2(pre-release), you can get the details below. Thank you! image

gcampbell-msft commented 3 months ago

Fixed in pre-release, closing.