Bug 219934 - [Flatpak SDK] coredumpctl invocation when using a local SDK repo fallbacks to the remote repo
Summary: [Flatpak SDK] coredumpctl invocation when using a local SDK repo fallbacks to...
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: Lauro Moura
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-15 22:16 PST by Lauro Moura
Modified: 2021-01-06 05:46 PST (History)
6 users (show)

See Also:


Attachments
Patch (2.50 KB, patch)
2021-01-05 07:51 PST, Lauro Moura
pnormand: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2020-12-15 22:16:32 PST
While investigating bug219933, building the updated SDK followed by running `update-webkit-flatpak`, running a test that crashes shows the following message:

```
Flatpak package org.webkit.Sdk.Debug/x86_64/0.3 not installed. Please update your SDK: Tools/Scripts/update-webkit-flatpak
```

Digging a bit deeper, indeed org.webkit.Sdk.Debug was not being shown in the output of `flatpak list` when generating the list of FlatpakPackages in flatpakutils.py, despite executing the same command in the shell[1] shows the Debug component (org.webkit.Sdk.Locale is present though).

The issue is that linux_get_crash_log.py's _get_trace_from_flatpak invokes webkit-flatpak on the host without keeping the WEBKIT_FLATPAK_USER_DIR variable, making it fall back to the regular remote repo scheme. In my case, installing the remote packages. Due to the silent and lengthy process, after a ctrl+c this remote clone ended incomplete, thus the missing org.webkit.Sdk.Debug message.

WIP patch already working. Will submit after cleanup.

[1] `flatpak list --user --columns=application,arch,branch,origin -a`
Comment 1 Lauro Moura 2021-01-05 07:51:13 PST
Created attachment 417004 [details]
Patch
Comment 2 Philippe Normand 2021-01-05 08:29:32 PST
Comment on attachment 417004 [details]
Patch

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

> Tools/Scripts/webkitpy/port/linux_get_crash_log.py:117
> +        user_dir = os.environ.get('WEBKIT_FLATPAK_USER_DIR')
> +        if user_dir:
> +            cmd.append("--env=WEBKIT_FLATPAK_USER_DIR=%s" % user_dir)

Might be simpler to pass-through the env to popen?
Comment 3 Lauro Moura 2021-01-05 10:22:22 PST
(In reply to Philippe Normand from comment #2)
> Comment on attachment 417004 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=417004&action=review
> 
> > Tools/Scripts/webkitpy/port/linux_get_crash_log.py:117
> > +        user_dir = os.environ.get('WEBKIT_FLATPAK_USER_DIR')
> > +        if user_dir:
> > +            cmd.append("--env=WEBKIT_FLATPAK_USER_DIR=%s" % user_dir)
> 
> Might be simpler to pass-through the env to popen?

It's already passed through env as it's popen's default behavior to inherit the environment.

The issue is that flatpak-spawn needs to be instructed which "non default" variables needs to be exported when creating the new shell for the new host command.
Comment 4 Lauro Moura 2021-01-06 05:45:34 PST
Committed r271199: <https://trac.webkit.org/changeset/271199>
Comment 5 Radar WebKit Bug Importer 2021-01-06 05:46:21 PST
<rdar://problem/72849449>