summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
Commit message (Collapse)AuthorAgeFilesLines
* interpreter: Move to its own folder and split itXavier Claessens2021-04-011-5061/+0
|
* Remove ConfigureFile and ConfigureFileHolderXavier Claessens2021-03-261-16/+5
| | | | They are not used anywhere.
* Use find_program also in add_*_script for consistency.Jussi Pakkanen2021-03-241-18/+2
|
* Use find_program also in custom_target for consistency.Jussi Pakkanen2021-03-241-0/+3
|
* interpreter: Fix spurious warning in include_directories()Xavier Claessens2021-03-231-1/+3
| | | | | When doing include_directories('.') at the root of the subproject we should not warn about sandboxing violation.
* environment(): Allow stacking append() and prepend() (#8547)Xavier Claessens2021-03-231-8/+6
| | | | | | | | | * environment(): Allow stacking append() and prepend() * Update docs/markdown/Reference-manual.md Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
* Merge pull request #7491 from xclaesse/callstackJussi Pakkanen2021-03-231-7/+10
|\ | | | | RFC: logs: Prepend current subproject name to all messages
| * mlog: Do not print 'subproject|' for the message 'Executing subproject'Xavier Claessens2021-03-221-7/+5
| | | | | | | | | | It already contains the full callstack and it's more visible when it's standing on its own line.
| * interpreter: Do not print "method meson"Xavier Claessens2021-03-221-1/+5
| |
| * logs: Prepend current subproject name to all messagesXavier Claessens2021-03-221-6/+7
| | | | | | | | | | | | | | | | | | Meson used to prepend '|' for each nested subproject to distinguish in the logs where a subproject start and ends. It is more useful to print the current subproject name. Also print the call stack when starting a new subproject to better see which subproject chain leads to to.
* | Remove -pipe from default list of args. Closes #8508.Jussi Pakkanen2021-03-231-3/+0
|/
* Move OverrideProgram to programsDylan Baker2021-03-191-5/+1
|
* split program related classes and functions out of dependenciesDylan Baker2021-03-191-17/+17
| | | | | | Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
* Allow add_dist_script() in subprojectsXavier Claessens2021-03-181-1/+2
| | | | Fixes: #8440.
* interpreter: Add varname as positional arg in dep.get_variable()Xavier Claessens2021-03-181-2/+7
|
* Warn when grabbing internals of subprojects with include_directories.Jussi Pakkanen2021-03-171-2/+28
|
* Add range() functionXavier Claessens2021-03-161-2/+24
| | | | Fixes: #5026.
* msetup: do not print bogus "Option ... is:" messagesPaolo Bonzini2021-03-161-1/+6
| | | | | | | | | | get_non_matching_default_options is checking a string from project_default_options against a validated value from coredata.options. Passing the string to validate_value ensures that the comparison is sound; otherwise, "false" might be compared against False and a bogus difference is printed.
* Add `meson devenv` command and meson.add_devenv()Xavier Claessens2021-03-161-6/+13
|
* EnvironmentVariables: Simplify and annotateXavier Claessens2021-03-161-17/+27
|
* Fix run_targets running scripts from different subdirs.Jussi Pakkanen2021-03-141-0/+2
|
* interpreter: Cache found dependency before converting for include_typeXavier Claessens2021-03-121-7/+7
| | | | Fixes: #8516.
* Refactor subdir visitation to track files instead of dirs.Jussi Pakkanen2021-03-061-3/+4
|
* mass rewrite of string formatting to use f-strings everywhereEli Schwartz2021-03-041-44/+44
| | | | performed by running "pyupgrade --py36-plus" and committing the results
* various python neatness cleanupsEli Schwartz2021-03-041-10/+10
| | | | | | | | | | | | | | | | All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
* Simplify module APIXavier Claessens2021-03-041-87/+31
| | | | | | | | | | | | | | | | | | | | | | | | | - ModuleState is now a real class that will have methods in the future for actions modules needs, instead of using interpreter internal API. - New ModuleObject base class, similar to InterpreterObject, that should be used by all objects returned by modules. Its methods gets the ModuleState passed as first argument. It has a `methods` dictionary to define what is public API that can be called from build definition. - Method return value is not required to be a ModuleReturnValue any more, it can be any type that interpreter can holderify, including ModuleObject. - Legacy module API is maintained until we port all modules. In the future modules should be updated: - Use methods dict. - Remove snippets. - Custom objects returned by modules should all be subclass of ModuleObject to get the state iface in their methods. - Modules should never call into interpreter directly and instead state object should have wrapper API. - Stop using ModuleReturnValue in methods that just return simple objects like strings. Possibly remove ModuleReturnValue completely since all objects that needs to be processed by interpreter (e.g. CustomTarget) should be created through ModuleState API.
* interpreter: Fix process_new_values()Xavier Claessens2021-03-041-7/+3
| | | | It should recurse on lists and does not need to return a value.
* install_man locale supportJason Woodward2021-02-271-2/+7
| | | | | | | | | | Rather than having to manually build the locale aware man paths with `install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')` Support doing `install_man('foo.fr.1', locale: 'fr')`
* interpreter: Clean up and simplify/optimize get_(external|cross)_propertyDylan Baker2021-02-261-39/+20
| | | | | | These are both way more compilcated than they needed to be, this is a much simpler implementation, and is shared between cross and external properies.
* interpreter: correctly track whether a subproject is initializedDylan Baker2021-02-261-1/+5
| | | | | | | | | | The way the tracking is currently done it works if no new subprojects are added to a configured build directory. For cases where we want to add a new subproject, it fails because we don't initialize builtins for that subproject. This corrects that by checking to see if the subproject already exists, and if it doesn't initializes the bultins for it. Fixes: #8421
* Allow printing UserOptions in the summaryStephen Gregoratto2021-02-261-0/+3
|
* meson: add .has_external_property() methodsTim-Philipp Müller2021-02-261-0/+10
| | | | | | | Useful in case of boolean values to distinguish between a boolean value having been set in the native/cross file and not having been provided, which can't be achieved by passing a fallback parameter to .get_external_property().
* deprecated `meson.get_cross_property`Dylan Baker2021-02-251-0/+1
| | | | | | It's a pure subset of `get_external_property`, and has odd behavior in host == build configurations. `get_external_property` is clear, and uses the standard `native : bool` syntax to control host vs build properties
* interpreter: stop using hasattr for held_objectDylan Baker2021-02-251-10/+4
| | | | We have unholder or isinsatnce(ObjectHolder) for that
* interpreter: Fix ObjectHolder usageDylan Baker2021-02-251-48/+52
|
* Support multiple args in error()Xavier Claessens2021-02-251-23/+12
| | | | | | Seems it got forgotten when that was added to warnings() and message(). Fixes: #8414.
* minstall: Add --skip-subprojects optionXavier Claessens2021-02-221-8/+12
| | | | | | | | | By default all subprojects are installed. If --skip-subprojects is given with no value only the main project is installed. If --skip-subprojects is given with a value, it should be a coma separated list of subprojects to skip and all others will be installed. Fixes: #2550.
* Do not validate options when finding non-matchingDylan Baker2021-02-171-5/+2
| | | | | | | | | | This is a) useless because it's only used to print which options are not default, and b) harmful because it can result in cases where things break, like in projects that set a standard that the chosen compiler doesn't support, but the project (or some subset) can be built with a different standard. Fixes: #8360
* Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgenJussi Pakkanen2021-02-071-4/+2
|\ | | | | Add a wrapper to the rust module for bindgen
| * interpreter: Add annotations for CustomTargetHolderDylan Baker2021-02-061-1/+1
| | | | | | | | needed in the rust module
| * Add a method to IncludeDirs to convert to string listDylan Baker2021-02-061-3/+1
| | | | | | | | | | I'm going to use this in the rust module as well, so having a single source of truth is useful.
* | Merge pull request #8288 from bonzini/test-setup-exclude-suitesJussi Pakkanen2021-02-071-2/+5
|\ \ | | | | | | introduce add_test_setup(exclude suites: ...) keyword argument
| * | interpreter, mtest: introduce add_test_setup(exclude_suites: ...)Paolo Bonzini2021-02-021-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new keyword argument makes it possible to run specific test setups only on a subset of the tests. For example, to mark some tests as slow and avoid running them by default: add_test_setup('quick', exclude_suites: ['slow'], is_default: true) add_test_setup('slow') It will then be possible to run the slow tests with either `meson test --setup slow` or `meson test --suite slow`.
* | | Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen2021-02-071-3/+4
|\ \ \ | |_|/ |/| | run_target: Add env kwarg
| * | run_target: Add env kwargXavier Claessens2021-02-051-3/+4
| | | | | | | | | | | | | | | | | | Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
* | | interpreter: use noPosArgs and noKwargs instead of opencodingDylan Baker2021-02-061-8/+6
|/ /
* | Introduce `fs.read` to read a file as a stringLuke Drummond2021-02-041-1/+1
|/ | | | | | | | | | | | | | | | | Following #7890, this patch introduces the ability to read the contents of a file to the fs module. This patch introduces the ability to read files at configure time, but has some restrictions: - binary files are not supported (I don't think this will prove a problem, and if people are wanting to do something with binary files, they should probably be shelling out to their own script). - Only files outside the build directory allowed. This limitation should prevent build loops. Given that reading an arbitrary file at configure time can affect the configuration in almost arbitrary ways, meson should force a reconfigure when the given file changes. This is non-configurable, but this can easily be changed with a future keyword argument.
* add_install_script: add skip_if_destdir kwargXavier Claessens2021-01-301-1/+6
| | | | | | | | It is common, at least in GNOME projects, to have scripts that must be run only in the final destination, to update system icon cache, etc. Skipping them from Meson ensures we can properly log that they have not been run instead of relying on such scripts to to it (they don't always).
* Fix executable as script on WindowsXavier Claessens2021-01-301-9/+6
| | | | | | | | | | | | | | | | | | On Windows this would fail because of missing DLL: ``` mylib = library(...) exe = executable(..., link_with: mylib) meson.add_install_script(exe) ``` The reason is on Windows we cannot rely on rpath to find libraries from build directory, they are searched in $PATH. We already have all that mechanism in place for custom_target() using ExecutableSerialisation class, so reuse it for install/dist/postconf scripts too. This has bonus side effect to also use exe_wrapper for those scripts. Fixes: #8187
* Can read project version from a file.Jussi Pakkanen2021-01-291-4/+24
|