WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
236240
[Flatpak SDK] Add a wrapper for clangd
https://bugs.webkit.org/show_bug.cgi?id=236240
Summary
[Flatpak SDK] Add a wrapper for clangd
Martin Robinson
Reported
2022-02-07 07:55:07 PST
A wrapper for clangd would make it easier to launch the clangd necessary for processing WebKit source code. The main issue is that the build relies on a sandboxed build directory and headers from the Flatpak SDK.
Attachments
Patch
(16.61 KB, patch)
2022-02-07 08:08 PST
,
Martin Robinson
no flags
Details
Formatted Diff
Diff
Patch
(16.10 KB, patch)
2022-02-08 04:56 PST
,
Martin Robinson
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Martin Robinson
Comment 1
2022-02-07 08:08:36 PST
Created
attachment 451101
[details]
Patch
Martin Robinson
Comment 2
2022-02-07 08:11:19 PST
The way to use this script is to set your IDE's clang binary path to <WebKitSourceDirectory>/Tools/flatpak/webkit-flatpak and then pass the --enable-config and --<platform> arguments. For instance, I have this working by installing coc and coc-clangd for vim and then the contents of my local coc configuration (":CocLocalConfig") are: { "clangd.arguments": [ "--enable-config", "--gtk" ], "clangd.path": "/home/martin/WebKit/Tools/flatpak/webkit-clangd" } The first indexing for this takes a while, but eventually you should have real-time compilation errors and completion.
Philippe Normand
Comment 3
2022-02-08 04:16:00 PST
Comment on
attachment 451101
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=451101&action=review
> Tools/ChangeLog:32 > +2022-02-07 Martin Robinson <
mrobinson@webkit.org
> > + > + [Flatpak SDK] Add a wrapper for clangd > +
https://bugs.webkit.org/show_bug.cgi?id=236240
> + > + Reviewed by NOBODY (OOPS!). > + > + * flatpak/webkit-clangd: Added.
Double changelog!
> Tools/flatpak/flatpakutils.py:37 > +import toml
EWS chokes on this :(
> Tools/flatpak/webkit-clangd:20 > +import flatpakutils
What will call this script? Will it have the Tools/flatpak directory listed in PYTHONPATH?
Martin Robinson
Comment 4
2022-02-08 04:56:48 PST
Created
attachment 451238
[details]
Patch
Martin Robinson
Comment 5
2022-02-08 04:58:57 PST
(In reply to Philippe Normand from
comment #3
)
> Comment on
attachment 451101
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=451101&action=review
> > > Tools/ChangeLog:32 > > +2022-02-07 Martin Robinson <
mrobinson@webkit.org
> > > + > > + [Flatpak SDK] Add a wrapper for clangd > > +
https://bugs.webkit.org/show_bug.cgi?id=236240
> > + > > + Reviewed by NOBODY (OOPS!). > > + > > + * flatpak/webkit-clangd: Added. > > Double changelog!
Whoops. Fixed.
> > > Tools/flatpak/flatpakutils.py:37 > > +import toml > > EWS chokes on this :(
Ah, odd. I've fixed this. It's because these imports are from the webkitpy directory.
> > Tools/flatpak/webkit-clangd:20 > > +import flatpakutils > > What will call this script? Will it have the Tools/flatpak directory listed > in PYTHONPATH?
The way this generally works is that you set up your editor or IDE to start clangd. Both Visual Studio Code and Vim (via coc-clangd) have settings for this. The connection to clangd runs in the background via your editor and it provides real-time information like completions and compilation errors.
EWS
Comment 6
2022-02-09 08:00:12 PST
Committed
r289470
(
247013@main
): <
https://commits.webkit.org/247013@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 451238
[details]
.
Radar WebKit Bug Importer
Comment 7
2022-02-09 08:01:19 PST
<
rdar://problem/88689997
>
Philippe Normand
Comment 8
2022-02-20 04:06:54 PST
Comment on
attachment 451238
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=451238&action=review
> Tools/flatpak/flatpakutils.py:595 > - os.environ["FLATPAK_USER_DIR"] = FLATPAK_USER_DIR_PATH + ".Local" > + os.environ["FLATPAK_USER_DIR"] = os.path.join(FLATPAK_USER_DIR_PATH, ".Local")
This is not correct actually, an invalid path is computed:
>>> os.path.join("/foo/bar", ".bas")
'/foo/bar/.bas' I'll submit a follow-up patch.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug