Bug 237606 - REGRESSION(r290506): [GTK] GBM dependency breaks build
Summary: REGRESSION(r290506): [GTK] GBM dependency breaks build
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: DMA-BUF
  Show dependency treegraph
 
Reported: 2022-03-08 08:17 PST by Jim Mason
Modified: 2022-10-20 09:55 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Mason 2022-03-08 08:17:14 PST
Building on X11/nVIDIA, USE_ANGLE_WEBGL=OFF

I don't have libgbm, and building webkit for me has always succeeded without it.  GL seems to work fine; for example, I can run the tanks demo.  Now my build fails because GBM does not exist on my system.

After removing the GBM dependency introduced by r290506, webkit still builds and runs fine.

Is this going to be a hard dependency going forward, because (older) nVIDIA drivers maybe don't have it.
Comment 1 Adrian Perez 2022-03-08 14:21:33 PST
(In reply to Jim Mason from comment #0)
> Building on X11/nVIDIA, USE_ANGLE_WEBGL=OFF
> 
> I don't have libgbm, and building webkit for me has always succeeded without
> it.  GL seems to work fine; for example, I can run the tanks demo.  Now my
> build fails because GBM does not exist on my system.
> 
> After removing the GBM dependency introduced by r290506, webkit still builds
> and runs fine.
> 
> Is this going to be a hard dependency going forward, because (older) nVIDIA
> drivers maybe don't have it.

There has been some talk internally about making GBM unneeded at build
time, and relying on dlopening() it where needed/available at runtime.

I wonder if we could make the GBM dependency optional with USE_ANGLE_WEBGL
disabled in the meantime, though 🤔️
Comment 2 Zan Dobersek 2022-03-08 22:41:32 PST
No, because it will be used outside of ANGLE too.
Comment 3 Alejandro G. Castro 2022-03-09 00:01:39 PST
Thanks for the report!

In the patch we forgot to add the ` if (USE_ANGLE_WEBGL) ` around the find_package option, but the compilation is correctly guarded. That is why it stops when the library is not found in the system but it compiles and works correctly if you remove the find_package manually, the not ANGLE solution does not require gbm. This was fixed in a commit later here:

https://trac.webkit.org/changeset/289575/webkit

Just try to update to that commit and it should work.

Anyway, As Zan is explaining we are planning to make ANGLE/GBM solution the default one in the near future and focus on working/supporting just that technology for the future. We will maintain the old solution for some time though.
Comment 4 Alejandro G. Castro 2022-03-09 00:08:34 PST
(In reply to Alejandro G. Castro from comment #3)
> Thanks for the report!
> 
> In the patch we forgot to add the ` if (USE_ANGLE_WEBGL) ` around the
> find_package option, but the compilation is correctly guarded. That is why
> it stops when the library is not found in the system but it compiles and
> works correctly if you remove the find_package manually, the not ANGLE
> solution does not require gbm. This was fixed in a commit later here:
> 
> https://trac.webkit.org/changeset/289575/webkit
> 

Oops sorry, this commit was previous to that one :-), so yep, you have to move back to the previous commit because we are already moving to use the technology outside ANGLE.

Sorry again for the confusion. I'm keeping the bug open to check more comments about the situation in your configuration for the new solutions.

Thanks again!
Comment 5 Carlos Garcia Campos 2022-03-09 04:48:44 PST
We can't add required packages like r290506. New dependencies should be optional.
Comment 6 Zan Dobersek 2022-03-09 05:25:20 PST
Even if it makes video playback and WebGL optional down the line?
Comment 7 Zan Dobersek 2022-03-09 05:44:57 PST
(In reply to Adrian Perez from comment #1)
> (In reply to Jim Mason from comment #0)
> > Building on X11/nVIDIA, USE_ANGLE_WEBGL=OFF
> > 
> > I don't have libgbm, and building webkit for me has always succeeded without
> > it.  GL seems to work fine; for example, I can run the tanks demo.  Now my
> > build fails because GBM does not exist on my system.
> > 
> > After removing the GBM dependency introduced by r290506, webkit still builds
> > and runs fine.
> > 
> > Is this going to be a hard dependency going forward, because (older) nVIDIA
> > drivers maybe don't have it.
> 
> There has been some talk internally about making GBM unneeded at build
> time, and relying on dlopening() it where needed/available at runtime.
> 

This is the end goal but hasn't been started yet. The two libraries were added as deps to not block the ongoing work.
Comment 8 Zan Dobersek 2022-03-09 05:45:48 PST
(In reply to Zan Dobersek from comment #6)
> Even if it makes video playback and WebGL optional down the line?

With dlopen()-y solution these two would end up being optional at runtime.
Comment 9 Carlos Garcia Campos 2022-03-09 05:48:20 PST
(In reply to Zan Dobersek from comment #6)
> Even if it makes video playback and WebGL optional down the line?

No, that would be a regression.
Comment 10 Alejandro G. Castro 2022-03-15 11:45:30 PDT
I've commented in the other bug but I'll add it here too to make sure everyone is updated, this week we discussed the way to move forward with the new buffer sharing architecture and we are going to add a new define to guard the gbm code. This will allow to compile without it using the current architecture.
Comment 11 Zan Dobersek 2022-03-23 02:42:18 PDT
Resolved with changes in bug #237974.
Comment 12 Jim Mason 2022-03-23 07:01:58 PDT
(In reply to Zan Dobersek from comment #11)
> Resolved with changes in bug #237974.

Confirmed, thanks!
Comment 13 Jim Mason 2022-10-10 01:46:59 PDT
This has returned because of this commit:

https://commits.webkit.org/254947@main
Comment 14 Alejandro G. Castro 2022-10-20 02:17:47 PDT
(In reply to Jim Mason from comment #13)
> This has returned because of this commit:
> 
> https://commits.webkit.org/254947@main

Thanks for reporting! Would you mind creating a different bug and closing this one, it is better for us to handle it that way because it is a different problem added later.
Comment 15 Jim Mason 2022-10-20 09:55:55 PDT
Reopening in new issue as requested.