aboutsummaryrefslogtreecommitdiff
path: root/authors.txt
diff options
context:
space:
mode:
authorEmanuele Aina <emanuele.aina@collabora.com>2016-09-27 15:31:38 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-10-08 15:41:31 +0200
commit6c50253645dad81afbfd2e1bca2c5d9e08f42e05 (patch)
tree959112e58d4f988feef0c4b151dbe47546d4b2e2 /authors.txt
parentcd6d5a642de41ccec5c934d5a6de074599f54436 (diff)
downloadmeson-6c50253645dad81afbfd2e1bca2c5d9e08f42e05.zip
meson-6c50253645dad81afbfd2e1bca2c5d9e08f42e05.tar.gz
meson-6c50253645dad81afbfd2e1bca2c5d9e08f42e05.tar.bz2
Use argv[0] to internally relaunch meson.py
When installing Meson, distutils may choose to put shim scripts in the `PATH` that only set up the egg requirements before launching the real `meson.py` contained in the egg. This means that `__file__` points to the real `meson.py` file, but launching it directly is doomed to fail as it's missing the metadata contained in the shim to set up the path egg, resulting in errors when trying to import the `mesonbuild` module. A similar issue affects Meson when installed as a zipapp, with the current code going great lengths to figure out how to relaunch itself. Using `argv[0]` avoids these issues as it gives us the way the current executable has been launched, so we are pretty much guaranteed that using it will create another instance of the same executable. We only need to resolve relative paths as the current working directory may get changed before re-launching the script, and using `realpath()` for that saves us the trouble of manually resolving links and getting caught in endless loops. This also mean that `meson_script_file` no longer necessarily point to a absolute file, so rename it to `_launcher` which hopefully would be less prone to inducing false assumptions.
Diffstat (limited to 'authors.txt')
-rw-r--r--authors.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/authors.txt b/authors.txt
index f0c2006..229a2ff 100644
--- a/authors.txt
+++ b/authors.txt
@@ -46,3 +46,4 @@ Patrick Griffis
Iain Lane
Daniel Brendle
Franz Zapata
+Emanuele Aina