Bug 211144 - [GTK] update-webkitgtk-libs: TypeError: cannot use a string pattern on a bytes-like object
Summary: [GTK] update-webkitgtk-libs: TypeError: cannot use a string pattern on a byte...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Lauro Moura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-28 13:42 PDT by Michael Catanzaro
Modified: 2020-04-28 17:26 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.09 KB, patch)
2020-04-28 15:52 PDT, Lauro Moura
mcatanzaro: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2020-04-28 13:42:02 PDT
Looks like this script was written for python2 (in 2018!) and then never updated:

$ update-webkitgtk-libs 
Adding repo webkit-sdk
Updating Flatpak Debug environment
Installing from webkit-sdk org.webkit.Platform x86_64 0.2
Looking for matches…


        ID                         Branch Op Remote     Download
 1. [✓] org.webkit.Platform.Locale 0.2    i  webkit-sdk  16.9 kB / 1.3 GB
 2. [✓] org.webkit.Platform        0.2    i  webkit-sdk 367.1 MB / 1.2 GB

Installation complete.
Installing from webkit-sdk org.webkit.Sdk x86_64 0.2
Looking for matches…


        ID                      Branch   Op   Remote      Download
 1. [✓] org.webkit.Sdk.Locale   0.2      i    webkit-sdk   16.9 kB / 1.4 GB
 2. [✓] org.webkit.Sdk          0.2      i    webkit-sdk  489.9 MB / 2.3 GB

Installation complete.
Installing from flathub org.freedesktop.Platform.GL.default x86_64 19.08
Looking for matches…


        ID                                  Branch Op Remote  Download
 1. [✓] org.freedesktop.Platform.GL.default 19.08  i  flathub 94.4 MB / 94.9 MB

Installation complete.
Installing from webkit-sdk org.webkit.Sdk.Debug x86_64 0.2
Looking for matches…


        ID                     Branch   Op   Remote       Download
 1. [✓] org.webkit.Sdk.Debug   0.2      i    webkit-sdk   2.3 GB / 3.7 GB

Installation complete.
bwrap: Can't find source path /run/user/b'1000'/doc: No such file or directory
Traceback (most recent call last):
  File "Tools/Scripts/update-webkit-flatpak", line 28, in <module>
    WebkitFlatpak.load_from_args(["--update"] + sys.argv[1:]).run()
  File "./Tools/flatpak/flatpakutils.py", line 805, in run
    return self.main()
  File "./Tools/flatpak/flatpakutils.py", line 797, in main
    self.setup_icecc("gcc")
  File "./Tools/flatpak/flatpakutils.py", line 826, in setup_icecc
    icc_version_filename, = re.findall(r'.*creating (.*)', tmpfile.read())
  File "/usr/lib64/python3.8/re.py", line 239, in findall
    return _compile(pattern, flags).findall(string)
TypeError: cannot use a string pattern on a bytes-like object
Died at /home/mcatanzaro/Projects/WebKit/Tools/Scripts/update-webkitgtk-libs line 28.
Comment 1 Lauro Moura 2020-04-28 15:52:21 PDT
Created attachment 397893 [details]
Patch
Comment 2 Michael Catanzaro 2020-04-28 16:13:30 PDT
Comment on attachment 397893 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=397893&action=review

LGTM, thanks.

> Tools/ChangeLog:12
> +        Also check if the doc directory exists before passing it to bwrap.
> +        Should avoid errors like these:
> +
> +        bwrap: Can't find source path /run/user/1000/doc: No such file or directory

Hm, well I actually do have /run/user/1000/doc. That error must have been caused because the script was not mounting /run/user/1000/doc, it was mounting /run/user/b'1000'/doc. Oops. :) I'll let you decide whether it's still worth checking if that exists.
Comment 3 Lauro Moura 2020-04-28 16:26:53 PDT
(In reply to Michael Catanzaro from comment #2)
> Comment on attachment 397893 [details]
> Hm, well I actually do have /run/user/1000/doc. That error must have been
> caused because the script was not mounting /run/user/1000/doc, it was
> mounting /run/user/b'1000'/doc. Oops. :) I'll let you decide whether it's
> still worth checking if that exists.

Yeah, this is an issue that is happening in the WPE Debug test bot (and can happen if the dir does not exist).
Comment 4 EWS 2020-04-28 16:27:35 PDT
/Volumes/Data/worker/Commit-Queue/build/Tools/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).
Comment 5 Lauro Moura 2020-04-28 17:26:42 PDT
Committed r260859: <https://trac.webkit.org/changeset/260859>