Freed-Wu / coc-bitbake

Port vscode-bitbake to vim
https://github.com/yoctoproject/vscode-bitbake/pull/178
Other
1 stars 0 forks source link

when coc-bitbake is enabled, vim got stuck for minutes then ask for configuration #4

Open laoshaw opened 2 months ago

laoshaw commented 2 months ago

I had vim-bitbake and coc-bitbake both on, when I open a bb file, it gets stuck. removing vim-bitbake still the same, when it's stuck, watchman is running with lots of cpu load. uninstall coc-bitbake and enable vim-bitbake, it become usable with either language-server-bitbake or bitbake-language-server. question: do I need vim-bitbake when coc-bitbake is installed? question: why it's unusable? screenshot and log below: image

## versions

vim version: VIM - Vi IMproved 9.0 9000749
node version: v20.13.1
coc.nvim version: 0.0.82-33d0a523 2024-07-12 09:31:17 +0800
coc.nvim directory: /home/user/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2024-09-08T20:38:59.817 INFO (pid:2961829) [plugin] - coc.nvim initialized with node: v20.13.1 after 295
2024-09-08T20:38:59.818 INFO (pid:2961829) [services] - LanguageClient bitbake state change: stopped => starting
2024-09-08T20:38:59.827 INFO (pid:2961829) [language-client-index] - Language server "languageserver.bitbake" started with 2961933
2024-09-08T20:38:59.832 INFO (pid:2961829) [language-client-index] - Language server "bitbake" started with 2961934
2024-09-08T20:38:59.930 INFO (pid:2961829) [extension:coc-bitbake] - 01:38:59.930 [Error] BitBake settings error: Bitbake folder not found on disk.
2024-09-08T20:38:59.951 WARN (pid:2961829) [core-watchman] - opendir(/home/user/devel/yocto/poky) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl. Marking this portion of the tree deleted
To clear this warning, run:
`watchman watch-del /home/user/devel/yocto/poky ; watchman watch-project /home/user/devel/yocto/poky`

2024-09-08T20:38:59.951 INFO (pid:2961829) [core-watchman] - watchman watching project: /home/user/devel/yocto/poky
2024-09-08T20:38:59.952 ERROR (pid:2961829) [fileSystemWatcher] - Error on subscribe **/package.json Error: A non-recoverable condition has triggered.  Watchman needs your help!
The triggering condition was at timestamp=1725845939: inotify-add-watch(/home/user/devel/yocto/poky) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem.  You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch

    at BunserBuf.<anonymous> (/home/user/.vim/plugged/coc.nvim/build/index.js:46231:27)
    at BunserBuf.emit (node:events:519:28)
    at BunserBuf.process (/home/user/.vim/plugged/coc.nvim/build/index.js:45911:14)
    at /home/user/.vim/plugged/coc.nvim/build/index.js:45879:16
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  watchmanResponse: {
    error: 'A non-recoverable condition has triggered.  Watchman needs your help!\n' +
      'The triggering condition was at timestamp=1725845939: inotify-add-watch(/home/user/devel/yocto/poky) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl\n' +
      'All requests will continue to fail with this message until you resolve\n' +
      'the underlying problem.  You will find more information on fixing this at\n' +
      'https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch\n',
    version: '4.9.0'
  }
}
2024-09-08T20:38:59.954 ERROR (pid:2961829) [fileSystemWatcher] - Error on subscribe **/{.prettierrc,.prettierrc.json,.prettierrc.json5,.prettierrc.yaml,.prettierrc.yml,.prettierrc.toml,.prettierrc.js,.prettierrc.cjs,package.json,prettier.config.js,prettier.config.cjs,.editorconfig} Error: A non-recoverable condition has triggered.  Watchman needs your help!
The triggering condition was at timestamp=1725845939: inotify-add-watch(/home/user/devel/yocto/poky) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem.  You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch

    at BunserBuf.<anonymous> (/home/user/.vim/plugged/coc.nvim/build/index.js:46231:27)
    at BunserBuf.emit (node:events:519:28)
    at BunserBuf.process (/home/user/.vim/plugged/coc.nvim/build/index.js:45911:14)
    at /home/user/.vim/plugged/coc.nvim/build/index.js:45879:16
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  watchmanResponse: {
    error: 'A non-recoverable condition has triggered.  Watchman needs your help!\n' +
      'The triggering condition was at timestamp=1725845939: inotify-add-watch(/home/user/devel/yocto/poky) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl\n' +
      'All requests will continue to fail with this message until you resolve\n' +
      'the underlying problem.  You will find more information on fixing this at\n' +
      'https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch\n',
    version: '4.9.0'
  }
}
2024-09-08T20:39:00.165 INFO (pid:2961829) [services] - LanguageClient bitbake state change: starting => running
2024-09-08T20:39:00.166 INFO (pid:2961829) [services] - service languageserver.bitbake started
2024-09-08T20:41:09.357 ERROR (pid:2961829) [server] - unhandledRejection  Promise {
  <rejected> Error: Command: workbench.action.openWorkspaceSettings not found
      at CommandManager.executeCommand (/home/user/.vim/plugged/coc.nvim/build/index.js:27228:25)
      at /home/user/.config/coc/extensions/node_modules/coc-bitbake/out/ui/ClientNotificationManager.js:20:46
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
} Error: Command: workbench.action.openWorkspaceSettings not found
    at CommandManager.executeCommand (/home/user/.vim/plugged/coc.nvim/build/index.js:27228:25)
    at /home/user/.config/coc/extensions/node_modules/coc-bitbake/out/ui/ClientNotificationManager.js:20:46
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-09-08T20:41:13.652 INFO (pid:2961829) [attach] - receive notification: showInfo []
Freed-Wu commented 2 months ago

I think it is because there are too many files in the working directory, scan them cost too many time for watchman.

laoshaw commented 2 months ago

I think it is because there are too many files in the working directory, scan them cost too many time for watchman.

any workaround for that? my local directory when I invoke vim is actually just a few files, not sure why watchman is tied up.

can vim-bitbake co-exist with coc-bitbake?

Thanks

Freed-Wu commented 2 months ago

For me, there are many files in build. However, I don't install watchman.

Yes.

laoshaw commented 2 months ago

even after I removed build/, coc-bitbake will still get stuck:

## versions

vim version: VIM - Vi IMproved 9.0 9000749
node version: v20.13.1
coc.nvim version: 0.0.82-33d0a523 2024-07-12 09:31:17 +0800
coc.nvim directory: /home/user/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2024-09-09T08:34:35.462 INFO (pid:26154) [plugin] - coc.nvim initialized with node: v20.13.1 after 314
2024-09-09T08:34:35.465 INFO (pid:26154) [services] - LanguageClient bitbake state change: stopped => starting
2024-09-09T08:34:35.474 INFO (pid:26154) [language-client-index] - Language server "languageserver.bitbake" started with 26258
2024-09-09T08:34:35.478 INFO (pid:26154) [language-client-index] - Language server "bitbake" started with 26264
2024-09-09T08:34:35.558 INFO (pid:26154) [services] - LanguageClient bitbake state change: starting => running
2024-09-09T08:34:35.561 INFO (pid:26154) [services] - service languageserver.bitbake started
2024-09-09T08:34:35.577 INFO (pid:26154) [extension:coc-bitbake] - 13:34:35.577 [Error] BitBake settings error: Bitbake folder not found on disk.
2024-09-09T08:34:35.643 INFO (pid:26154) [core-watchman] - watchman watching project: /home/user/devel/yocto/poky
2024-09-09T08:34:47.744 ERROR (pid:26154) [server] - unhandledRejection  Promise {
  <rejected> Error: Command: workbench.action.openWorkspaceSettings not found
      at CommandManager.executeCommand (/home/user/.vim/plugged/coc.nvim/build/index.js:27228:25)
      at /home/user/.config/coc/extensions/node_modules/coc-bitbake/out/ui/ClientNotificationManager.js:20:46
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
} Error: Command: workbench.action.openWorkspaceSettings not found
    at CommandManager.executeCommand (/home/user/.vim/plugged/coc.nvim/build/index.js:27228:25)
    at /home/user/.config/coc/extensions/node_modules/coc-bitbake/out/ui/ClientNotificationManager.js:20:46
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-09-09T08:34:50.446 INFO (pid:26154) [attach] - receive notification: showInfo []
Freed-Wu commented 2 months ago

I doubt it is a bug only happened when user installed watchman.

laoshaw commented 2 months ago

per my test, it's not the case, I uninstalled watchman, it's still stuck. it also acts the same for both bitbake-language-server and language-server-bitbake. I move a recipe to a separate dir to get rid of any build/ etc, still the same. I think it's somewhere in coc-bitbake. I wonder, what coc-bitbake brings here? will vim-bitbake + coc-settings' bitbake-language-server be enough already? Thanks

Freed-Wu commented 2 months ago

Before it is fixed, use coc-settings is enough.