Bug 209901

Summary: [Flatpak SDK] Path references shouldn't point to the sandbox in compile_commands.json
Product: WebKit Reporter: Sergio Villar Senin <svillar>
Component: Tools / TestsAssignee: Philippe Normand <pnormand>
Status: RESOLVED FIXED    
Severity: Normal CC: pnormand, webkit-bug-importer, zan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Emacs config
none
Patch none

Description Sergio Villar Senin 2020-04-02 06:02:52 PDT
The problem is that the paths specified in the compilation database are flatpak's paths, so any tool using the compilation database like ycmd, ccls, etc... is unable to find references to the source files in it.
Comment 1 Sergio Villar Senin 2020-04-02 06:47:16 PDT
BTW for those using VSCode there is a workaround. Just need to use path mappings setting, for example:

"ccls.clang.pathMappings": [
        "/app/webkit>PATH_TO_YOUR_WEBKIT_CHECKOUT_ROOT"
    ],

Note the ">" in between paths, it's superimportant :)
Comment 2 Philippe Normand 2020-04-03 01:35:18 PDT
Is there something to fix then? Or this is "only" a matter of documentation :)
Comment 3 Philippe Normand 2020-04-03 04:53:32 PDT
What's your use-case for this? Are you building WebKit from VSCode?
Comment 4 Sergio Villar Senin 2020-04-06 12:23:24 PDT
(In reply to Philippe Normand from comment #3)
> What's your use-case for this? Are you building WebKit from VSCode?

The use case is having semantic autocompletion when using LSP tools with different editors: VSCode, emacs..., is not about building.
Comment 5 Philippe Normand 2020-05-02 10:59:49 PDT
So you use LSP in Emacs for WebKit dev? Can you share your config? :D
Comment 6 Sergio Villar Senin 2020-05-04 05:38:03 PDT
Created attachment 398360 [details]
Emacs config

Not my default editor anymore, but here you are the relevant bits. Note that the path mapping setting is not used anymore as I'm using jhbuild again because I could not make it work with flatpak builds.
Comment 7 Philippe Normand 2020-05-05 02:06:06 PDT
Perhaps the SDK could ship ccls and have it running in the sandbox. This needs investigation but is down below in my TODO.
Comment 8 Philippe Normand 2020-05-08 08:49:45 PDT
Created attachment 398863 [details]
Patch
Comment 9 Philippe Normand 2020-05-12 01:09:47 PDT
(In reply to Philippe Normand from comment #3)
> What's your use-case for this? Are you building WebKit from VSCode?

FWIW I now have compilation errors reported in Emacs thanks to LSP/CCLS.
Comment 10 EWS 2020-05-14 02:41:47 PDT
Committed r261681: <https://trac.webkit.org/changeset/261681>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398863 [details].
Comment 11 Radar WebKit Bug Importer 2020-05-14 02:42:15 PDT
<rdar://problem/63220932>