Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User 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.
- Loading branch information