aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
AgeCommit message (Collapse)AuthorFilesLines
2020-08-03Merge remote-tracking branch 'upstream/master' into lang-enumlang-enumJohn Ericson1-128/+358
2020-08-01Put machine file and cmd line parsing in EnvironmentDylan Baker1-3/+5
This creates a full set of option in environment that mirror those in coredata, this mirroring of the coredata structure is convenient because lookups int env (such as when initializing compilers) becomes a straight dict lookup, with no list iteration. It also means that all of the command line and machine files are read and stored in the correct order before they're ever accessed, simplifying the logic of using them.
2020-08-01Allow setting built-in options from cross/native filesDylan Baker1-0/+1
This is like the project options, but for meson builtin options. The only real differences here have to do with the differences between meson builtin options and project options. Some meson options can be set on a per-machine basis (build.pkg_config_path vs pkg_config_path) others can be set on a per-subproject basis, but should inherit the parent setting.
2020-07-28Only emit warning about "native:" on projects with minimum required versionZbigniew Jędrzejewski-Szmek1-2/+5
'native:' keyword was only added in 0.54. For projects declaring meson_version >= 0.54, warn, because those projects can and should set the keyword. For older projects declaring support for older versions, don't warn and use the default implicitly. Fixes https://github.com/mesonbuild/meson/issues/6849.
2020-07-21summary: Wrap lines when printing listsXavier Claessens1-5/+29
When a list_sep is provided (e.g. ', ') all items are printed on the same line, which gets ugly on very long lists (e.g. list of plugins enabled).
2020-07-19Print a warning when importing a stabilized moduleMarc-André Lureau1-7/+17
2020-07-04find_program: Do not use fallback when before parsing project()Xavier Claessens1-1/+1
Mesa is doing `project(... find_program() ...)` so environment.wrap_resolver is not defined yet.
2020-07-04qt: Fix has_tools() when required=FalseXavier Claessens1-2/+6
Improve logs by making it clear when the program is found but has wrong version.
2020-07-04give user control of option skip_sanity_checkAlexander Neumann1-4/+4
2020-07-01interpreter: Don't abort if dep isn't required and sub didn't overrideXavier Claessens1-2/+6
2020-07-01interpreter: Already configured fallback should be used for optional depXavier Claessens1-3/+5
2020-07-01wrap: Refactor to split wraps dictionary into 3 separate dictsXavier Claessens1-1/+1
It makes the code cleaner to have 3 separate dictionaries for packagename, dependency and programs.
2020-07-01find_program: Fallback if a wrap file provide the program nameXavier Claessens1-25/+58
We don't need the legacy variable name system as for dependency() fallbacks because meson.override_find_program() is largely used already, so we can just rely on it.
2020-07-01wrap: Do not fallback implicitly on optional dependencyXavier Claessens1-2/+5
This fix the following common pattern, we don't want to implicitly fallback on the first line: foo_dep = dependency('foo', required: false) if not foo_dep.found() foo_dep = cc.find_library('foo', required : false) if not foo_dep.found() foo_dep = dependency('foo', fallback: 'foo') endif endif
2020-07-01wrap: Add 'provide' sectionXavier Claessens1-8/+10
2020-07-01Implicit dependency fallback when a subproject wrap or dir existsXavier Claessens1-0/+8
2020-07-01Merge pull request #7231 from mensinda/cmOverrideJussi Pakkanen1-2/+10
cmake: Add more advanced subproject configuration options
2020-06-16interpreter: Allow dependecy or subproject name in force_fallback_forXavier Claessens1-3/+6
2020-06-16interpreter: Avoid new feature warning when using old has_exe_wrapper()Xavier Claessens1-1/+4
2020-06-16interpreter: add support for --force-fallback-forMathieu Duponchelle1-2/+9
This new command line option allows specifying dependencies for which to force fallback. See the documentation for more information Fixes: #7218
2020-06-10Fix python3 installed from the Windows StoreD Scott Phillips1-1/+14
When meson is currently being run with a python that seems to have been installed from the Windows Store, replace the general WindowsApps directory in search paths with dirname(sys.executable), and also handle failures with pathlib.resolve on WindowsApps exe files.
2020-06-05cmake: Add more advanced subproject configuration optionsDaniel Mensinger1-2/+10
This is done with the new cmake subprojects options object that is similar to the already exisiting configuration data object. It is consumed by the new `options` kwarg of the cmake.subproject function.
2020-05-27Merge pull request #6818 from mensinda/localPatchJussi Pakkanen1-1/+1
Wrap: add local files support via *_filename
2020-05-14interpreter: Add always set default value for version and set it ASAPDylan Baker1-4/+3
Ideally we wouldn't need to have the default dict here and could just rely on it being set as soon as project is called. There is a corner case exercised by test case common/35 run program, which is that if a FeatureNew or FeatureDeprecated is called to generate the meson version it will be unset, to work around this I've changed the type from a dict to a default dict with '' as the default value. A better fix would probably be to store all of the FeatureNew/FeatureDeprecated checks until the end, then evaluate them, but for now this results in no loss of functionality, only more functionality, even if it isn't prefect.
2020-05-14use FeatureNew.single_useDylan Baker1-20/+23
This is just slightly cleaner looking
2020-05-14interpreter: Replace some uses of mlog.deprecation with FeatureDeprecatedDylan Baker1-2/+5
This gives the version that the feature was deprecated in, and doesn't print the warning if the project supports versions of meson in which the project wasn't deprecated.
2020-05-14interpreter: Rename has_exe_wrapper -> can_run_host_binariesDylan Baker1-3/+11
The implementation of this function has changed enough that the name doesn't really reflect what it actually does. It basically returns true unless you're cross compiling, need and exe_wrapper, and don't have one. The original function remains but is marked as deprecated. This makes one small change the meson source language, which is that it defines that can_run_host_binaries will return true in build == host compilation, which was the behavior that already existed. Previously this was undefined in build == host compilation.
2020-05-13Merge pull request #6620 from jon-turney/test-output-checkDylan Baker1-9/+11
Add a mechanism for validating meson output in tests
2020-05-06Merge pull request #7064 from dcbaker/gtest-protocolJussi Pakkanen1-3/+6
Add support for Gtest as a test protocol
2020-05-04Add native support for gtest testsDylan Baker1-2/+4
Gtest can output junit results with a command line switch. We can parse this to get more detailed results than the returncode, and put those in our own Junit output. We basically just throw away the top level 'testsuites' object, then fixup the names of the tests, and shove that into our junit.
2020-05-03Merge pull request #7060 from dcbaker/install-script-targetsJussi Pakkanen1-14/+64
Allow meson.add_*_script to take additional types
2020-04-30Convert test protocol into an enumDylan Baker1-1/+2
This gives us better type safety, and will be important as we add more test methods
2020-04-30Allow get_variable to still function when the fallback is a disabler.James Hilliard1-0/+2
2020-04-30Cosmetic tweak to error message for incdir() with an absolute pathJon Turney1-2/+3
Cosmetic tweak to the error message for incdir() with an absolute path. Don't split the message in the middle of a sentence at a point which may or may not correspond to the terminal width.
2020-04-30Check before compiler detection if 'c' language is present when adding 'vala'Jon Turney1-5/+6
For the sake of a consistent error message (irrespective of if 'valac' is present or not), check if the 'c' language is present if we are adding 'vala' before (rather than after) we do compiler detection.
2020-04-30Be more careful about the use of repr() in error messagesJon Turney1-2/+2
Generally, we'd want to use str() rather than repr() in error messages anyhow, as that explicitly gives something designed to be read by humans. Sometimes {!r} is being used as a shortcut to avoid writing the quotes in '{!s}'. Unfortunately, these things aren't quite the same, as the repr of a string containing '\' (the path separator on Windows) will have those escaped. We don't have a good string representation to use for the arbitrary internal object used as an argument for install_data() when it's neither a string nor file (which doesn't lead to a good error message), so drop that for the moment.
2020-04-30allow postconf and dist scripts to use Files, ExternalPrograms, andDylan Baker1-6/+8
ConfigureFiles These things are all known to be ready when these scripts are run, and thus they can safely consume them.
2020-04-30interpreter: Allow install_script to use additional input typesDylan Baker1-11/+59
This adds support for Files, CustomTarget, Indexs of CustomTargets, ConfigureFiles, ExternalPrograms, and Executables. Fixes: #1234 Fixes: #3552 Fixes: #6175
2020-04-28Clarified error message for test(). (#7040)Benjamin Frye1-1/+1
Changes the error message for test() so it now reports the expected and actual number of parameters. Fixes: #7029
2020-04-28gnome: Fix usage of gobject-introspection as subprojectXavier Claessens1-0/+5
2020-04-28dependency: log cached or skipped dependencies with reference to modulesEli Schwartz1-5/+8
* dependency: log cached or skipped dependencies with reference to modules If the dependency is a special dependency which takes modules, the modules get cached separately and probably reference different pkg-config files. It's very plausible that we have multiple dependencies, using different modules. For example: Run-time dependency qt5 (modules: Core) found: YES 5.14.2 (pkg-config) Dependency qt5 skipped: feature gui disabled Obviously this makes no sense, because of course we found qt5 and even used it. The second line is a lot more readable if it shows this: Dependency qt5 (modules: Widgets) skipped: feature gui disabled Similar confusion abounds in the case where a module is found in the cache -- which module, exactly, has been found here: Dependency qt5 found: YES 5.14.2 (cached) Rewrite the dependency function to *consistently* pass around (and use!) the display_name even in cases where we know it isn't anonymous (this is just more correct anyway), and make it serve a dual purpose by also appending the list of modules just like we do for pretty-printing that a dependency has just been found for the first time. * fixup! dependency: log cached or skipped dependencies with reference to modules pointlessly cast modules to str, as they cannot be anything else. But we want to fail later on, with something more friendly than a stacktrace. boost/wx have special exceptions for people passing an integer there.
2020-04-28find_program: Fixes when the program has been overridden by executableXavier Claessens1-15/+37
- ExternalProgramHolder has path() method while CustomTargetHolder and BuildTargetHolder have full_path(). - The returned ExternalProgramHolder's path() method was broken, because build.Executable object has no get_path() method, it needs the backend. - find_program('overridden_prog', version : '>=1.0') was broken because it needs to execute the exe that is not yet built. Now assume the program has the (sub)project version. - If the version check fails, interpreter uses ExternalProgramHolder.get_name() for the error message but build.Executable does not implement get_name() method.
2020-04-25wrap: Add support for local files via only `*_filename`Daniel Mensinger1-1/+1
2020-04-21More progressJohn Ericson1-11/+18
2020-04-21WIP: Create enum to use instead of strings for languageJohn Ericson1-2/+1
2020-04-20Compiler options per langJohn Ericson1-7/+7
A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
2020-04-17interpreter: Correctly ignore def files in build directoryXavier Claessens1-7/+7
See https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/85.
2020-04-14interpreter: find_program: Store program's name when not foundAriel D'Alessandro1-3/+3
Currently, looking for a nonexisting program using find_program() will return an NonExistingExternalProgram instace with the default name 'nonexistingprogram'. Let's store the target program's name in it, so it can be printed if needed. Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
2020-04-14interpreter: Show program's name on run_command error messageAriel D'Alessandro1-1/+1
Currently, the error message is printing the object itself. Showing the program's name is better. Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
2020-04-08Fix requireed meson version for override_dependency()Xavier Claessens1-1/+1