Bug 228581

Summary: [CMake] Use an imported target for the libgcrypt library
Product: WebKit Reporter: Adrian Perez <aperez>
Component: CMakeAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, cgarcia, clopez, don.olmstead, ews-watchlist, gyuyoung.kim, Hironori.Fujii, lmoura, mcatanzaro, pnormand, ryuan.choi, sergio
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 228609    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch v2
none
Follow-up Patch
none
Follow-up Patch (bis) none

Description Adrian Perez 2021-07-29 04:56:30 PDT
SSIA ^_^
Comment 1 Adrian Perez 2021-07-29 05:02:47 PDT
Created attachment 434515 [details]
Patch
Comment 2 Adrian Perez 2021-07-29 05:21:26 PDT
Created attachment 434516 [details]
Patch v2
Comment 3 EWS 2021-07-29 08:16:09 PDT
Committed r280423 (240063@main): <https://commits.webkit.org/240063@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434516 [details].
Comment 4 Lauro Moura 2021-07-29 11:21:00 PDT
Reopening for debug build fixes regarding gpg-error not being pulled as dependency automatically by libgcrypt.
Comment 5 Adrian Perez 2021-07-29 12:24:49 PDT
(In reply to Lauro Moura from comment #4)
> Reopening for debug build fixes regarding gpg-error not being pulled as
> dependency automatically by libgcrypt.

Gah! I assumed that libgcrypt.pc would list gpg-error as a dependency,
but it does not — which is what manually adding -lgpg-error was
workarounding.

I will submit a patch adding also a LibGcrypt::GpgError imported target
and make LibGcrypt::LibGcrypt depend on it :|
Comment 6 Adrian Perez 2021-07-29 12:50:15 PDT
Created attachment 434559 [details]
Follow-up Patch
Comment 7 Carlos Alberto Lopez Perez 2021-07-29 13:04:50 PDT
Build failure here: https://build.webkit.org/#/builders/43/builds/3684
Comment 8 EWS 2021-07-29 18:44:58 PDT
Committed r280461 (240096@main): <https://commits.webkit.org/240096@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434559 [details].
Comment 9 Carlos Alberto Lopez Perez 2021-07-29 21:04:03 PDT
I'm afraid we would have to revert this, or at least modify it to not rely on the pkg-config files


After r280423 is not longer possible to build WebKit on Debian 10.

See the failure on our bot: https://build.webkit.org/#/builders/46/builds/5192

I can reproduce this on buildbox with:

$ rm -fr WebKitBuild # wipe build so there is no flatpak
$ Tools/Scripts/build-webkit --gtk  --no-experimental-features

It seems the issue is that the package that Debian 10 ships for libgcrypt20-dev doesn't have a libgcrypt.pc file, and I can't find this file shipped by any other package on the distro.

I can see on the libgcrypt upstream repository that the pc file was added in 

$ git describe 97194b422bc89a6137f4e218d4cdee118c63e96e
libgcrypt-1.9-base-91-g97194b42

And Debian 10 still ships libgcrypt 1.8.4
Comment 10 Adrian Perez 2021-07-29 22:43:25 PDT
(In reply to Carlos Alberto Lopez Perez from comment #9)
> I'm afraid we would have to revert this, or at least modify it to not rely
> on the pkg-config files
> 
> 
> After r280423 is not longer possible to build WebKit on Debian 10.
> 
> See the failure on our bot:
> https://build.webkit.org/#/builders/46/builds/5192
> 
> I can reproduce this on buildbox with:
> 
> $ rm -fr WebKitBuild # wipe build so there is no flatpak
> $ Tools/Scripts/build-webkit --gtk  --no-experimental-features
> 
> It seems the issue is that the package that Debian 10 ships for
> libgcrypt20-dev doesn't have a libgcrypt.pc file, and I can't find this file
> shipped by any other package on the distro.
> 
> I can see on the libgcrypt upstream repository that the pc file was added in 
> 
> $ git describe 97194b422bc89a6137f4e218d4cdee118c63e96e
> libgcrypt-1.9-base-91-g97194b42
> 
> And Debian 10 still ships libgcrypt 1.8.4

Not having a .pc file should not be a failure, there is a fallback
path that uses the “libgcrypt-config” script, which is part of the
Debian package in versions <1.9, see:

  https://packages.debian.org/buster/amd64/libgcrypt20-dev/filelist

From the build log you linked I see that the fallback is being tried
but I made some mistake there. I would not revert; so let's reopen
this and I will submit a follow-up with a fix in the next hour or so :)
Comment 11 Adrian Perez 2021-07-30 00:12:35 PDT
Created attachment 434608 [details]
Follow-up Patch (bis)
Comment 12 Carlos Alberto Lopez Perez 2021-07-30 00:38:18 PDT
Comment on attachment 434608 [details]
Follow-up Patch (bis)

nice! thanks!
Comment 13 EWS 2021-07-30 01:29:37 PDT
Committed r280469 (240104@main): <https://commits.webkit.org/240104@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434608 [details].