-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuring Linux Kernel - make dry-run fails #174
Comments
Here are some steps to give us extra information to look at:
|
I have attached the requested files (with redacted username - it's related to uni and shouldn't be public). After activating debug-level logging and clean rebuilding, I wasn't able to reproduce the squiggles in the header, but was only getting "language modes specified are incompatible". Probably related to this? https://github.com/microsoft/vscode-makefile-tools/issues/156 c_cpp_diag_output.log |
Thanks. I'll look into those log files shortly. Since you're saying that you don't reproduce the squiggle anymore, let me also explain that if you open a header file in VSCode without opening first a source file that is meant to include that header, the header will make the CppTools extension (the one responsible with the real IntelliSense calculations) to invoke some heuristics that pick various defaults (and which many times may result in squiggles). Currently, we track information and compute IntelliSense only for source files (c, cpp... etc) and any headers included by a translation unit will inherit its IntelliSense configuration. Where were the original squiggles that you saw? In a header or in a c/cpp source file? |
Ah, that's good to know, thanks! The original squiggles were in a C source file. |
I looked at the files and l only noticed extract-cert.c and iomem.c, right? Was there any other with squiggles that you'd like to zoom in? If you can't easily and safely add --always-make back, you can also produce a full clean build log of whole linux kernel and pass it to the extension via "makefile.buildLog". This will prevent make from being invoked. Make sure to refresh this full clean build log every time there is a change in how source files are compiled, to operate on last actual IntelliSense information. Or load linux kernel in VSCode after you cleaned the whole repository (make clean distClean) so that all source files are seen by ---dry-run even without --always-make. Let us know how any of this works. |
Thank you so much for taking the time! I don't think it's an issue with a specific file, but rather that I'm just doing something wrong. And no, I did not remove --always-make. For other reasons, I had to reorganise my repo, which lead to me more or less cleaning everything out. I ran make CC=clang-11 distclean defconfig clean, I passed CC=clang-11 to makefile tools in setting.json and I am able to build the kernel through makefile tools, which is great! (I need clang for what I'm doing) However, I'm still getting language modes specified are incompatible after compilation. The c/c++ config isn't updating either (wrong C standard for example), which I am finding suspicious. Also, I have been noticing this although .config is clearly present (after running make CC=clang-11 distclean defconfig clean):
Do you maybe have a take on the last two points? |
@PBHDK, I have seen those errors and always tried to do something that would result in a make which doesn't complain about that. I did run menuconfig or xconfig. I don't have experience about what is the right way to configure linux kernel. I only tried various things until I got a configuration that would produce compiler commands for the extension to parse (instead of useless output about not having .config and running make config commands) and then only focused on bugs that I identified as belonging to the Makefile Tools extension. I don't know what is the best way for your scenario to create the linux kernel .config file. As soon as you have that figured out, when you have a make --dry-run output that produces compilations, then if IntelliSense has any issues we can investigate what Makefile Tools does wrong. |
Many thanks for getting back to me on this, @andreeis ! I now managed to get intellisensing the manual way through the c/ c++ extension. That will do for now, I guess. Once I have more time, I'll try to get Makefile Tools running with my project again. Once I have, I'd also love to contribute something like "How to: Setting up the linux kernel project in VS Code". Again, once I have more time. Will close this issue for. Many thanks again for your help! |
Hi all,
I'm currently trying to set up a Linux kernel dev environment in VS Code on my Linux VM and I have been struggling to get intelliSense running.
First, this issue in the C/C++ extension's repo brought me here. However, I have been struggling to set up makefile-tools with the linux kernel.
I generated a default configuration as per docs/repositories.md with
distclean defconfig clean
and then calledMakefile: Configure
in VS Code.Logs tell me that the configuration succeeds with the make dry-run command is failing though because it is missing some rules. I am also getting include squiggles, telling me that header files cannot be opened.
From what I have been reading, Linux kernel should be compatible with Makefile-tools, so I was wondering what I was doing wrong?
Any suggestions? Many thanks!
The text was updated successfully, but these errors were encountered: