Skip to content
Permalink
Browse files
[Flatpak SDK] Flatpak environment JSON is prematurely deleted with fl…
…atpak-spawn calls

https://bugs.webkit.org/show_bug.cgi?id=221070

Reviewed by Philippe Normand.

To avoid nested webkit-flatpak calls overwriting/deleting whe
environment file, only create if there is no such file and only delete
in the same process that created it.

This approach has the drawback of limiting nested calls changing the
variable values and a file undeleted after a crash might avoid the
next normal invocation creating it.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):


Canonical link: https://commits.webkit.org/233443@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
lauromoura committed Jan 28, 2021
1 parent bc3d282 commit d778028b6d17f93e9a8930dab5acc3beebedd4b5
Showing 2 changed files with 25 additions and 3 deletions.
@@ -1,3 +1,21 @@
2021-01-28 Lauro Moura <lmoura@igalia.com>

[Flatpak SDK] Flatpak environment JSON is prematurely deleted with flatpak-spawn calls
https://bugs.webkit.org/show_bug.cgi?id=221070

Reviewed by Philippe Normand.

To avoid nested webkit-flatpak calls overwriting/deleting whe
environment file, only create if there is no such file and only delete
in the same process that created it.

This approach has the drawback of limiting nested calls changing the
variable values and a file undeleted after a crash might avoid the
next normal invocation creating it.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):

2021-01-28 Alicia Boya García <aboya@igalia.com>

[GTK] run-gtk-tests: Ensure correct count when subtests are specified
@@ -871,15 +871,19 @@ def envvar_in_suffixes_to_keep(envvar):
})

env_file = os.path.join(self.build_root, 'flatpak-env.json')
with open(env_file, 'w') as f:
json.dump(dict(flatpak_env), f, indent=2)
if not os.path.exists(env_file):
with open(env_file, 'w') as f:
json.dump(dict(flatpak_env), f, indent=2)
else:
env_file = None

try:
return self.execute_command(flatpak_command, stdout=stdout, env=flatpak_env)
except KeyboardInterrupt:
return 0
finally:
os.remove(env_file)
if env_file is not None and os.path.exists(env_file):
os.remove(env_file)

return 0

0 comments on commit d778028

Please sign in to comment.