Bug 202790

Summary: update-webkitgtk-libs fails to run in Fedora 31
Product: WebKit Reporter: Emilio Cobos Álvarez (:emilio) <emilio>
Component: WebKitGTKAssignee: Emilio Cobos Álvarez (:emilio) <emilio>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, bugs-noreply, clopez, commit-queue
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Emilio Cobos Álvarez (:emilio) 2019-10-10 03:14:11 PDT
Errors like:

./Tools/Scripts/update-webkitgtk-libs                                                                                                                                                                                     
Updating GTK+ port dependencies using jhbuild...
Traceback (most recent call last):
  File "./jhbuild-wrapper", line 21, in <module>
    import jhbuildutils
  File "/home/emilio/src/WebKit/Tools/jhbuild/jhbuildutils.py", line 5, in <module>
    import __builtin__
ModuleNotFoundError: No module named '__builtin__'
Failed to build GTK+ port dependencies with jhbuild
Died at ./Tools/Scripts/update-webkitgtk-libs line 25

This patch fixes it:

diff --git a/Tools/jhbuild/jhbuild-wrapper b/Tools/jhbuild/jhbuild-wrapper
index ed1be88191b..02616db4ce1 100755
--- a/Tools/jhbuild/jhbuild-wrapper
+++ b/Tools/jhbuild/jhbuild-wrapper
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 # Copyright (C) 2011 Igalia S.L.
 # Copyright (C) 2012 Gustavo Noronha Silva <gns@gnome.org>
 # Copyright (C) 2012 Intel Corporation

But not sure if it's acceptable.
Comment 1 Carlos Alberto Lopez Perez 2019-10-10 03:23:22 PDT
From a debian/ubuntu based perspective that patch is acceptable.

Not sure about arch. CC'ing adrian.
Comment 2 Emilio Cobos Álvarez (:emilio) 2019-10-10 05:31:08 PDT
Hmm, that only actually got me a bit further:

gawk -f /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/mkerrcodes1.awk /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/errnos.in >_mkerrcodes.h
gawk -f /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/mkstrtable.awk -v textidx=2 -v nogettext=1 \
	/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/err-sources.h.in >err-sources-sym.h
gawk -f /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/mkstrtable.awk -v textidx=2 -v nogettext=1 \
	/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/err-codes.h.in >err-codes-sym.h
gawk -f /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/mkstrtable.awk -v textidx=2 -v nogettext=1 \
	-v prefix=GPG_ERR_ -v namespace=errnos_ \
	/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/errnos.in >errnos-sym.h
/usr/lib64/ccache/gcc -g -O0 -I. -I/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src -o mkheader /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/mkheader.c
/usr/lib64/ccache/gcc -DHAVE_CONFIG_H -I. -I/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src -I..     -Wno-error -O2 -g1 -Wall -Wpointer-arith -Wno-psabi -fvisibility=hidden -MT gen-posix-lock-obj.o -MD -MP -MF .deps/gen-posix-lock-obj.Tpo -c -o gen-posix-lock-obj.o /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/gen-posix-lock-obj.c
gawk: fatal: cannot use gawk builtin `namespace' as variable name
gawk: /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/mkerrnos.awk:86: warning: regexp escape sequence `\#' is not a known regexp operator
gawk: /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/mkerrcodes1.awk:84: warning: regexp escape sequence `\#' is not a known regexp operator
gawk: /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/mkstrtable.awk:113: warning: regexp escape sequence `\#' is not a known regexp operator
cat /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/src/gpg-error.def.in >_gpg-error.def.h
make[2]: *** [Makefile:1324: errnos-sym.h] Error 2


Looks like that's fixed upstream per https://dev.gnupg.org/T4459, is there any way to update that?
Comment 3 Carlos Alberto Lopez Perez 2019-10-10 06:21:29 PDT
(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)
> Hmm, that only actually got me a bit further:
> 
> gawk -f
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/mkerrcodes1.awk
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/errnos.in >_mkerrcodes.h
> gawk -f
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/mkstrtable.awk -v textidx=2 -v nogettext=1 \
> 	/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.
> 27/src/err-sources.h.in >err-sources-sym.h
> gawk -f
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/mkstrtable.awk -v textidx=2 -v nogettext=1 \
> 	/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.
> 27/src/err-codes.h.in >err-codes-sym.h
> gawk -f
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/mkstrtable.awk -v textidx=2 -v nogettext=1 \
> 	-v prefix=GPG_ERR_ -v namespace=errnos_ \
> 	/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.
> 27/src/errnos.in >errnos-sym.h
> /usr/lib64/ccache/gcc -g -O0 -I.
> -I/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.
> 27/src -o mkheader
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/mkheader.c
> /usr/lib64/ccache/gcc -DHAVE_CONFIG_H -I.
> -I/home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.
> 27/src -I..     -Wno-error -O2 -g1 -Wall -Wpointer-arith -Wno-psabi
> -fvisibility=hidden -MT gen-posix-lock-obj.o -MD -MP -MF
> .deps/gen-posix-lock-obj.Tpo -c -o gen-posix-lock-obj.o
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/gen-posix-lock-obj.c
> gawk: fatal: cannot use gawk builtin `namespace' as variable name
> gawk:
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/mkerrnos.awk:86: warning: regexp escape sequence `\#' is not a known
> regexp operator
> gawk:
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/mkerrcodes1.awk:84: warning: regexp escape sequence `\#' is not a known
> regexp operator
> gawk:
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/mkstrtable.awk:113: warning: regexp escape sequence `\#' is not a known
> regexp operator
> cat
> /home/emilio/src/WebKit/WebKitBuild/DependenciesGTK/Source/libgpg-error-1.27/
> src/gpg-error.def.in >_gpg-error.def.h
> make[2]: *** [Makefile:1324: errnos-sym.h] Error 2
> 
> 
> Looks like that's fixed upstream per https://dev.gnupg.org/T4459, is there
> any way to update that?


If there is a small patch that fixes the build error, it can be applied on the JHBuild for the affected recipe.

On the other hand if for fixing the build error, upgrading the version of the package is required on the JHBuild that can be done as well, but that is tricky because it may require upgrading dependencies that depend on this one. It may require updating hundred of layout test results and this can only be done from Debian 10 because it what the bots run and the expectations have to match on the bots..... so, its tricky.


On the other hand, why are you trying to use the internal JHBuild? Fedora 31 should have already even newer version of all the required dependencies to build WebKit.
Comment 4 Emilio Cobos Álvarez (:emilio) 2019-10-10 06:23:43 PDT
(In reply to Carlos Alberto Lopez Perez from comment #3)
> On the other hand, why are you trying to use the internal JHBuild? Fedora 31
> should have already even newer version of all the required dependencies to
> build WebKit.

/me was just following instructions[1]; do they need to get updated?

[1]: https://trac.webkit.org/wiki/BuildingGtk#BuildingWebKitGTKfromgit
Comment 5 Adrian Perez 2019-10-10 07:07:43 PDT
(In reply to Carlos Alberto Lopez Perez from comment #1)
> From a debian/ubuntu based perspective that patch is acceptable.
> 
> Not sure about arch. CC'ing adrian.

The suggested patch would be fine for Arch as well. I think that
I haven't hit this before because here I am using a Python 2
virtualenv for WebKit development. I'll give it a try without.
Comment 6 Adrian Perez 2019-10-10 07:10:53 PDT
(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)
> (In reply to Carlos Alberto Lopez Perez from comment #3)
> > On the other hand, why are you trying to use the internal JHBuild? Fedora 31
> > should have already even newer version of all the required dependencies to
> > build WebKit.
> 
> /me was just following instructions[1]; do they need to get updated?
> 
> [1]: https://trac.webkit.org/wiki/BuildingGtk#BuildingWebKitGTKfromgit

Using the JHBuild is recommended if you are going to run tests locally
and want to have the same environment (library versions, for example)
that the build bots use — which is a good idea in general, so that is
why it's recommended in the instructions.
Comment 7 Adrian Perez 2019-10-10 08:29:46 PDT
(In reply to Adrian Perez from comment #5)
> (In reply to Carlos Alberto Lopez Perez from comment #1)
> > From a debian/ubuntu based perspective that patch is acceptable.
> > 
> > Not sure about arch. CC'ing adrian.
> 
> The suggested patch would be fine for Arch as well. I think that
> I haven't hit this before because here I am using a Python 2
> virtualenv for WebKit development. I'll give it a try without.

Without using the virtualenv, changing the shebangs to use “python2”,
and installing the “python2” package from the Arch repository, both
running “update-webkitgtk-flatpak” and “update-webkitgtk-libs” seem
to work fine here. Probably I will hit the gpg-error build issue in
a moment (the “update-webkitgtk-libs” script is still running).
Comment 8 Emilio Cobos Álvarez (:emilio) 2019-10-13 14:59:22 PDT
Created attachment 380854 [details]
Patch
Comment 9 Adrian Perez 2019-10-17 10:57:51 PDT
Comment on attachment 380854 [details]
Patch

I tested days ago and worked well. We'll need to make this (and the
rest of Python scripts) run on 3.x at some point, but for now this
will do.

Thanks for the patch!
Comment 10 WebKit Commit Bot 2019-10-17 11:49:54 PDT
Comment on attachment 380854 [details]
Patch

Clearing flags on attachment: 380854

Committed r251250: <https://trac.webkit.org/changeset/251250>
Comment 11 WebKit Commit Bot 2019-10-17 11:49:55 PDT
All reviewed patches have been landed.  Closing bug.