flatpak: fix wrong cwd when running a command through "flatpak build"
"flatpak build" will set the cwd of the run command to the build dir, regardless of what directory it is run from. Previously, this would cause us to ignore the cwd set on subprocess launchers created in a flatpak runtime. In turn, this would break subprocesses that rely on the cwd to find configuration, such as eslint, which uses the cwd to resolve the location of the source file and from there the .eslintrc.yml file.
Previously, this would have been unnoticed because:
- build system tools (eg make) would run in the build directory anyway
- source lint tools (eg eslint) would find some configuration file anyway because the build directory is a descendant of the source directory
- most projects only have on .eslintrc.yml file at the root, so they would not notice the wrong cwd on eslint
- most projects that use multiple .eslintrc.yml (eg have both node and web JS files) would not use flatpak and/or builddir!=srcdir, therefore the cwd on eslint would be correct anyway
In other words, to trigger this bug you need to have:
- half of the JS files written for node and half for GJS, in different
folders with different .eslintrc.yml
- use meson as build system
- use flatpak to package the project