** Description changed:

- This is not a requirement but it will make it easier to navigate the
- code using language servers. Kernel has a script to generate this file.
+ BugLink: https://bugs.launchpad.net/bugs/2119438
+ 
+ SRU Justification
  
  [Impact]
  
  Other source code tagging utilities (such as gtags) index the whole code
  base. However, in practice quite a bit of code base is disabled (either
  through macro definitions or makefiles where some sources are kept out
  of compilation).
  
  When inspecting a crash on certain architecture, it would help a lot to
- search thought only the active source code. Language servers does this
- but requires compilation commands to parse the code exactly as it was
- compiled. Linux has a script to generate compile_commands.json but it is
- not used by our builds.
+ search thought only the active source code. Language servers [2] does
+ this but requires compilation commands [1] to parse the code exactly as
+ it was compiled. Linux has a script to generate compile_commands.json
+ but it is not used by our builds.
  
  Users can build the sources themselves and generate this file. However,
  this requires compilation first and it takes quite a bit of time. Since
  we already compile the code, it takes at most a couple seconds more to
  generate this file.
  
  [Fix]
  
  After compilation run scripts/clang-tools/gen_compile_commands.py and
- package compile_commands.json into build-info.
+ package compile_commands.json into linux-buildinfo package.
  
  [Test Case]
  
- Build tested.
+ Build tested. Compile commands are compressed and  included in the
+ linux-buildinfo package [3].
+ 
+ 
+ $ dpkg --contents linux-buildinfo-6.14.0-24-generic_6.14.0-24.24_amd64.deb
+ 
+ drwxr-xr-x root/root         0 2025-08-01 18:14 ./
+ drwxr-xr-x root/root         0 2025-08-01 18:14 ./usr/
+ drwxr-xr-x root/root         0 2025-08-01 18:10 ./usr/lib/
+ drwxr-xr-x root/root         0 2025-08-01 18:10 ./usr/lib/linux/
+ drwxr-xr-x root/root         0 2025-08-01 18:11 
./usr/lib/linux/6.14.0-24-generic/
+ -rw-r--r-- root/root   2373194 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/abi
+ -rw-r--r-- root/root     21582 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/canonical-certs.pem
+ -rw-r--r-- root/root     38606 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/canonical-revoked-certs.pem
+ -rw-r--r-- root/root    889358 2025-08-01 18:11 
./usr/lib/linux/6.14.0-24-generic/compile_commands.tgz
+ -rw-r--r-- root/root        38 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/compiler
+ -rw-r--r-- root/root    296789 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/config
+ -rw-r--r-- root/root     96802 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/fwinfo
+ -rw-r--r-- root/root         0 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/fwinfo.builtin
+ -rw-r--r-- root/root     77077 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/modules
+ -rw-r--r-- root/root      3065 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/modules.builtin
+ -rw-r--r-- root/root   2131941 2025-08-01 18:10 
./usr/lib/linux/6.14.0-24-generic/sources
+ drwxr-xr-x root/root         0 2025-08-01 18:14 ./usr/share/
+ drwxr-xr-x root/root         0 2025-08-01 18:14 ./usr/share/doc/
+ drwxr-xr-x root/root         0 2025-08-01 18:14 
./usr/share/doc/linux-buildinfo-6.14.0-24-generic/
+ -rw-r--r-- root/root    317265 2025-08-01 18:14 
./usr/share/doc/linux-buildinfo-6.14.0-24-generic/changelog.Debian.gz
+ -rw-r--r-- root/root      1292 2025-08-01 17:08 
./usr/share/doc/linux-buildinfo-6.14.0-24-generic/copyright
+ 
  
  [Where things could go wrong]
  
  Package may fail to build. Otherwise, there are no runtime
  complications.
  
  [Other Notes]
  
  [1] https://clang.llvm.org/docs/JSONCompilationDatabase.html
  [2] https://clangd.llvm.org/
+ [3] See the tracking bug for the newly generated linux-buildinfo packages.

** Attachment added: "linux-buildinfo-6.14.0-24-generic_6.14.0-24.24_amd64.deb"
   
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2119438/+attachment/5899089/+files/linux-buildinfo-6.14.0-24-generic_6.14.0-24.24_amd64.deb

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2119438

Title:
  Include compile_commands.json in build info for language servers

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2119438/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to