Bug 218724 - [FlatPak] update-webkitgtk-libs fails after a clean build
Summary: [FlatPak] update-webkitgtk-libs fails after a clean build
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-09 14:03 PST by Carlos Alberto Lopez Perez
Modified: 2020-11-18 02:46 PST (History)
8 users (show)

See Also:


Attachments
Patch (7.63 KB, patch)
2020-11-09 14:34 PST, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2020-11-09 14:03:35 PST
Running update-webkitgtk-libs for the first time (after a clean build) fails with this:

Flatpak package org.webkit.Platform/x86_64/0.3 not installed. Please update your SDK: Tools/Scripts/update-webkit-flatpak
Traceback (most recent call last):
  File "Tools/Scripts/update-webkit-flatpak", line 28, in <module>
    sys.exit(WebkitFlatpak.load_from_args(["--update"] + sys.argv[1:]).run())
  File "./Tools/flatpak/flatpakutils.py", line 901, in run
    return self.main()
  File "./Tools/flatpak/flatpakutils.py", line 893, in main
    toolchains = self.pack_toolchain(("gcc", "g++"), {"/usr/bin/c++": "/usr/bin/g++"})
  File "./Tools/flatpak/flatpakutils.py", line 941, in pack_toolchain
    icc_version_filename, = re.findall(br'.*creating (.*)', tmpfile.read())
ValueError: need more than 0 values to unpack
Died at Tools/Scripts/update-webkitgtk-libs line 28.



However, if you re-run the same command twice then it works fine.
But the toolchains are not generated. You have to manually re-generate them via the script webkit-flatpak
Comment 1 Carlos Alberto Lopez Perez 2020-11-09 14:34:46 PST
Created attachment 413635 [details]
Patch
Comment 2 Lauro Moura 2020-11-10 21:38:59 PST
(In reply to Carlos Alberto Lopez Perez from comment #1)
> Created attachment 413635 [details]
> Patch

Just tested it, indeed the error is gone when initializing an empty local repo.
Comment 3 Philippe Normand 2020-11-16 01:59:34 PST
Comment on attachment 413635 [details]
Patch

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

> Tools/flatpak/flatpakutils.py:948
> +                        if os.path.isfile(config['icecc_version'][compiler]):

This function is called outside of the flatpak sandbox, IIUC, but checks paths inside it, so it might fail if the host gcc or clang paths are different.
Comment 4 Carlos Alberto Lopez Perez 2020-11-17 10:55:35 PST
(In reply to Philippe Normand from comment #3)
> Comment on attachment 413635 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=413635&action=review
> 
> > Tools/flatpak/flatpakutils.py:948
> > +                        if os.path.isfile(config['icecc_version'][compiler]):
> 
> This function is called outside of the flatpak sandbox, IIUC, but checks
> paths inside it, so it might fail if the host gcc or clang paths are
> different.

The paths it checks are the compiler toolchains that are stored under the build directory. For example in my system I have:

$ cat WebKitBuild/UserFlatpak/webkit_flatpak_config.json 
{"icecc_version": {"gcc": "/home/clopez/webkit/WebKitBuild/Toolchains/webkit-sdk-gcc-50ae74637e7fa7354ee261bb26005238.tar.gz", "clang": "/home/clopez/webkit/WebKitBuild/Toolchains/webkit-sdk-clang-7db6a9f1a6756ad6906bac8bcc51fffc.tar.gz"}}

AFAIK any path inside the build directory should be valid either inside or outside of the flatpak sandbox.

Is there any use case where my assumption would be wrong?
Comment 5 Philippe Normand 2020-11-18 01:20:55 PST
Right, I forgot the paths there correspond to the host.
Comment 6 EWS 2020-11-18 02:45:02 PST
Committed r269949: <https://trac.webkit.org/changeset/269949>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 413635 [details].
Comment 7 Radar WebKit Bug Importer 2020-11-18 02:46:19 PST
<rdar://problem/71531183>