Bug 221070

Summary: [Flatpak SDK] Flatpak environment JSON is prematurely deleted with flatpak-spawn calls
Product: WebKit Reporter: Lauro Moura <lmoura>
Component: Tools / TestsAssignee: Lauro Moura <lmoura>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, pnormand, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=220781
https://bugs.webkit.org/show_bug.cgi?id=221711
Attachments:
Description Flags
Initial patch none

Description Lauro Moura 2021-01-27 17:22:37 PST
r271938 added a flatpak_env.json file to forward some variables to webkit-bwrap after flatpak 1.10 changes.

This is working fine most of the time, but if flatpak-spawn is used to invoke a command from the host into the flatpak again (e.g. calling coredumpctl when a layout test fails), the new webkit-flatpak invocation may overwrite the file and delete it when exiting.

This could cause the finally block in the first flatpak process to fail with:

Traceback (most recent call last):
  File "./Tools/Scripts/run-webkit-tests", line 42, in <module>
    flatpakutils.run_in_sandbox_if_available(sys.argv)
  File "./Tools/flatpak/flatpakutils.py", line 1124, in run_in_sandbox_if_available
    sys.exit(flatpak_runner.run_in_sandbox(*app_args))
  File "./Tools/flatpak/flatpakutils.py", line 877, in run_in_sandbox
    os.remove(env_file)
OSError: [Errno 2] No such file or directory: '/home/lauro/dev/WebKit/WebKitBuild/flatpak-env.json'
Comment 1 Lauro Moura 2021-01-27 17:39:10 PST
Created attachment 418603 [details]
Initial patch
Comment 2 EWS 2021-01-28 10:26:58 PST
Committed r272018: <https://trac.webkit.org/changeset/272018>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418603 [details].
Comment 3 Radar WebKit Bug Importer 2021-01-28 10:27:19 PST
<rdar://problem/73714133>