summaryrefslogtreecommitdiff
path: root/meson.py
Commit message (Collapse)AuthorAgeFilesLines
* use real pathlib moduleDylan Baker2020-11-201-1/+1
| | | | | We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
* pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger2020-10-041-1/+1
|
* meson.py: sys.path requires str, not pathlib.PathNirbheek Chauhan2018-06-101-1/+1
|
* Set the meson command to use when we know what it isNirbheek Chauhan2018-06-011-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using fragile guessing to figure out how to invoke meson, set the value when meson is run. Also rework how we pass of meson_script_launcher to regenchecker.py -- it wasn't even being used With this change, we only need to guess the meson path when running the tests, and in that case: 1. If MESON_EXE is set in the env, we know how to run meson for project tests. 2. MESON_EXE is not set, which means we run the configure in-process for project tests and need to guess what meson to run, so either - meson.py is found next to run_tests.py, or - meson, meson.py, or meson.exe is in PATH Otherwise, you can invoke meson in the following ways: 1. meson is installed, and mesonbuild is available in PYTHONPATH: - meson, meson.py, meson.exe from PATH - python3 -m mesonbuild.mesonmain - python3 /path/to/meson.py - meson is a shell wrapper to meson.real 2. meson is not installed, and is run from git: - Absolute path to meson.py - Relative path to meson.py - Symlink to meson.py All these are tested in test_meson_commands.py, except meson.exe since that involves building the meson msi and installing it.
* Revert "mesonlib: handle meson exe wrappers"Nirbheek Chauhan2018-05-311-2/+7
| | | | | | | | This reverts commit 0627e9d616dc311b7c9b0ef17301f680ac9e78a7. Breaks installation: https://github.com/mesonbuild/meson/issues/3647 Will be restored once that can be fixed.
* mesonlib: handle meson exe wrappersMartin Kelly2018-05-301-7/+2
| | | | | | | | | | | | | | | | | | | | There are cases when it is useful to wrap the main meson executable with a script that sets up environment variables, passes --cross-file, etc. For example, in a Yocto SDK, we need to point to the right meson.cross so that everything "just works", and we need to alter CC, CXX, etc. In such cases, it can happen that the "meson" found in the path is actually a wrapper script that invokes the real meson, which may be in another location (e.g. "meson.real" or similar). Currently, in such a situation, meson gets confused because it tries to invoke itself using the "meson" executable (which points to the wrapper script) instead of the actual meson (which may be called "meson.real" or similar). In fact, the wrapper script is not necessarily even Python, so the whole thing fails. Fix this by using Python imports to directly find mesonmain.py instead of trying to detect it heuristically. In addition to fixing the wrapper issue, this should make the detection logic much more robust.
* Fix flake8 'imported but unused' reportsJon Turney2018-03-031-2/+2
| | | | | | | | | | | | | | | | $ flake8 | grep F401 ./meson.py:17:1: F401 'mesonbuild.mesonlib' imported but unused ./meson.py:18:1: F401 'locale' imported but unused ./run_unittests.py:24:1: F401 'sys' imported but unused ./mesonbuild/minit.py:2:1: F401 'pyclbr.Function' imported but unused ./mesonbuild/minit.py:18:1: F401 'os' imported but unused ./mesonbuild/backend/vs2010backend.py:15:1: F401 'sys' imported but unused ./mesonbuild/backend/xcodebackend.py:19:1: F401 'sys' imported but unused ./mesonbuild/dependencies/ui.py:20:1: F401 'shutil' imported but unused ./mesonbuild/modules/python3.py:15:1: F401 'sys' imported but unused ./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..compilers' imported but unused ./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..mlog' imported but unused ./test cases/common/98 gen extra/srcgen3.py:3:1: F401 'os' imported but unused
* Print UTF-8 warning only when actually encountering non-ascii filenames.Jussi Pakkanen2017-12-141-11/+0
|
* fix a typo in the UTF-8 warning messageLuke Shumaker2017-09-201-1/+1
|
* Write deprecation warnings to stderr.Jussi Pakkanen2017-08-021-6/+6
|
* Print deprecation warnings on old style commands.Jussi Pakkanen2017-08-021-1/+1
|
* Do not warn about non-utf8 locales on Windows.Jussi Pakkanen2016-12-101-2/+2
|
* meson.py: Warn if the encoding is not UTF-8 compatibleNirbheek Chauhan2016-11-231-2/+13
|
* meson.py: Always resolve full path to meson.pyNirbheek Chauhan2016-10-121-4/+2
| | | | | | | | | | | | | There is no reason to not always do this. Without this, we end up with a relative path to meson.py in build.ninja files when meson.py is launched using subprocess.Popen and friends from the meson source root. This was causing the unittests to intermittently fail when regen was getting invoked by the pic test. Funnily enough, this only happened when run via ./run_tests.py because __file__ was 'run_unittests.py' in that (as opposed to './run_unittests.py') case which made os.path.dirname(__file__) be '', and the os.path.split test in meson.py thought that meson.py was invoked via PATH.
* Reintroduce Python Zipapp supportFranz Zapata2016-10-101-6/+9
| | | | | | * Added `main` function as an entry point. * Created `__main__.py` to allow the creation of Zipapps without explicitly calling `meson:main`.
* Use argv[0] to internally relaunch meson.pyEmanuele Aina2016-10-081-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Revert #823, see also #830.Jussi Pakkanen2016-10-021-15/+8
|
* Revert #830 because it broke the case when the main script is not in path.Jussi Pakkanen2016-10-011-1/+15
|
* User argv[0] to internally relaunch meson.pyEmanuele Aina2016-09-301-11/+1
| | | | | | | | | | | | | | | | | | 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.
* Support running Meson as a Python zip applicationFranz Zapata2016-09-281-4/+10
|
* Back to .py suffix in files. Closes #394.Jussi Pakkanen2016-03-021-0/+24
|
* Renamed meson package to mesonbuild so that we can have a script named meson ↵Jussi Pakkanen2016-01-161-24/+0
| | | | in the same toplevel dir.
* Moved scripts in the module and started work to run them via the main meson ↵Jussi Pakkanen2016-01-151-2/+20
| | | | command.
* Organise files into a module structure.Jussi Pakkanen2016-01-151-222/+3
|
* Make it working on python 3.3Thibault Saunier2015-12-041-2/+2
|
* Added support for extended command line to overcome OS command line length ↵Yoav Alon2015-11-281-0/+3
| | | | limitation
* Yet another step in the neverending saga of -Wpedantic.Jussi Pakkanen2015-11-231-1/+1
|
* Add --version to command line arguments.Wink Saville2015-11-171-1/+1
|
* Made shared the default libtype as it is faster for daily development.Jussi Pakkanen2015-11-041-1/+1
|
* Turned builtin options into proper objects.Jussi Pakkanen2015-11-031-7/+4
|
* Refactored builtin options to a dictionary and created a new default library ↵Jussi Pakkanen2015-11-031-0/+2
| | | | target type.
* Now that projects can easily override defaults, return warning level to 2.Jussi Pakkanen2015-10-261-7/+1
|
* Added cpu family property to system information.Jussi Pakkanen2015-10-181-0/+3
|
* Do not use intr before it existsThibault Saunier2015-09-191-3/+4
|
* Merged trunk changes.Jussi Pakkanen2015-09-171-0/+11
|\
| * Can set default warning with an envvar.Jussi Pakkanen2015-09-041-2/+10
| |
| * Added multiple selectable warning levels.Jussi Pakkanen2015-08-271-0/+3
| |
* | Added conf option for build tree layout.Jussi Pakkanen2015-09-171-0/+3
| |
* | Added outdir() method to build targets so we can make output dirs togglable.Jussi Pakkanen2015-09-171-7/+7
|/
* More robust windows detection and more logs.Jussi Pakkanen2015-08-251-0/+3
|
* Better sanity testing.Jussi Pakkanen2015-08-251-0/+2
|
* Support target-only cross compilation properly.Jussi Pakkanen2015-07-271-2/+2
|
* Get build machine's CPU info too.Jussi Pakkanen2015-07-271-0/+1
|
* Now host_machine, build_machine and target_machine are properly separated ↵Jussi Pakkanen2015-07-271-0/+3
| | | | and return correct values.
* style: fix indenting in meson.pyIgor Gnatenko2015-06-181-17/+17
| | | | Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* meson: fix undefined-variable in backends chooserIgor Gnatenko2015-06-181-1/+1
| | | | | | E:146,57: Undefined variable 'options' (undefined-variable) Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* introduce check python version in meson.pyIgor Gnatenko2015-05-161-0/+5
| | | | | | | To ensure that people will not confused that something won't work. Related: https://github.com/miit-pm/RWD/pull/1#issuecomment-102607931 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Moved functionality from __main__ to a function to make it callable.Jussi Pakkanen2015-04-231-13/+15
|
* Add command line switch to print version number.Jussi Pakkanen2015-03-131-1/+6
|
* Added gobject-introspection to gnome module.Jussi Pakkanen2015-03-081-1/+0
|