aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
AgeCommit message (Collapse)AuthorFilesLines
2021-02-07Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgenJussi Pakkanen1-4/+2
Add a wrapper to the rust module for bindgen
2021-02-07Merge pull request #8288 from bonzini/test-setup-exclude-suitesJussi Pakkanen1-2/+5
introduce add_test_setup(exclude suites: ...) keyword argument
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen1-3/+4
run_target: Add env kwarg
2021-02-06interpreter: Add annotations for CustomTargetHolderDylan Baker1-1/+1
needed in the rust module
2021-02-06Add a method to IncludeDirs to convert to string listDylan Baker1-3/+1
I'm going to use this in the rust module as well, so having a single source of truth is useful.
2021-02-06interpreter: use noPosArgs and noKwargs instead of opencodingDylan Baker1-8/+6
2021-02-05run_target: Add env kwargXavier Claessens1-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.
2021-02-04Introduce `fs.read` to read a file as a stringLuke Drummond1-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.
2021-02-02interpreter, mtest: introduce add_test_setup(exclude_suites: ...)Paolo Bonzini1-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`.
2021-01-30add_install_script: add skip_if_destdir kwargXavier Claessens1-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).
2021-01-30Fix executable as script on WindowsXavier Claessens1-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
2021-01-29Can read project version from a file.Jussi Pakkanen1-4/+24
2021-01-27intepreter: Allow using file objects for the script_name of add_*_scriptDylan Baker1-8/+20
It's a bit silly and conveluted to have to call find_program on the output of configure_file, so let's just allow passing files as the script name.
2021-01-27custom_target: Add env kwargXavier Claessens1-1/+4
2021-01-27test: Make timeout <= 0 infinite duractionXavier Claessens1-2/+6
2021-01-21interpreter: accept external programs and dependencies for summaryPaolo Bonzini1-7/+11
2021-01-21mlog: add __len__ to AnsiDecoratorPaolo Bonzini1-9/+1
2021-01-14Merge pull request #8192 from dcbaker/submit/minstall-type-annotationsJussi Pakkanen1-28/+31
Add type annotations to minstall (and some related cleanups)
2021-01-13build/interpreter: Split InstallDir to fix layering violationDylan Baker1-22/+18
Currently InstallDir is part of the interpreter, and is an Interpreter object, which is then put in the Build object. This is a layering violation, the interperter should have a Holder for build data. This patch fixes that.
2021-01-13build/interperter: Add annotations and move input validation to interpreterDylan Baker1-6/+13
This moves the user input validation to the interpreter, instead of being in the build module, and adds type annotations.
2021-01-13Fix misspellsAntonin Décimo1-1/+1
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-12summary: align left, not align middleEli Schwartz1-2/+2
aligning along the left is, I think, what most projects want to do. Aligning along the middle looks subjectively ugly, and objectively prevents me from further indenting an element, e.g. Build information: prefix : /usr sysconfdir : /etc conf file : /etc/myprogram.conf
2021-01-12Interpreter: Fix nested subsubproject detectionXavier Claessens1-35/+13
A sub-subproject can be configured directly from `subprojects/foo/subprojects/bar/` in the case `bar` is in the same git repository as `foo` and not downloaded separately into the main project's `subprojects/`. In that case the nested subproject violation code was wrong because it is allowed to have more than one "subprojects" in path (was not possible before Meson 0.56.0). Example: - self.environment.source_dir = '/home/user/myproject' - self.root_subdir = 'subprojects/foo/subprojects/bar' - project_root = '/home/user/myproject/subprojects/foo/subprojects/bar' - norm = '/home/user/myproject/subprojects/foo/subprojects/bar/file.c' We want `norm` path to have `project_root` in its parents and not have `project_root / 'subprojects'` in its parents. In that case we are sure `file.c` is within `bar` subproject.
2021-01-05interpreter: split code that creates a Test instanceDylan Baker1-5/+8
For modules to make use of, as they're not allowed to modify the Build instance directly.
2021-01-05interpreter: allow modules to create testsDylan Baker1-0/+2
2021-01-05mtest: Add support for rust unit testsDylan Baker1-2/+2
Rust has it's own built in unit test format, which is invoked by compiling a rust executable with the `--test` flag to rustc. The tests are then run by simply invoking that binary. They output a custom test format, which this patch adds parsing support for. This means that we can report each subtest in the junit we generate correctly, which should be helpful for orchestration systems like gitlab and jenkins which can parse junit XML.
2021-01-04fix LGTM warningsDylan Baker1-1/+0
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-39/+38
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04use OptionKey for builtin and base optionsDylan Baker1-28/+15
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2021-01-04move OptionKey to mesonlibDylan Baker1-1/+1
There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
2021-01-04use OptionKey for compiler_optionsDylan Baker1-5/+11
2021-01-04use new optionkey.is_* methodsDylan Baker1-1/+1
2021-01-04use OptionKey for coredata.user_optionsDylan Baker1-4/+5
2021-01-04use the OptionKey type for command line and machine filesDylan Baker1-3/+4
2020-12-16build/interpreter: Add some type annotationsDylan Baker1-1/+1
2020-12-16interpreter: Use a typing.NamedTuple instead of collections.namedtupleDylan Baker1-6/+34
The former can hold type annotations, unlike the other. It also uses the class syntax, which is easier to read.
2020-12-16build/interpreter: fix layering violations for ManPagesDylan Baker1-27/+25
Like `install_headers`, `install_man` used the same objects for both the interpreter and the build, this is bad. Let's have two separate objects.
2020-12-16build/interpreter: split representation of HeadersDylan Baker1-23/+27
This was all layering violations before. Now we have Headers in the build module, and a holder in the interpreter. All of the type validation is done in interpreter method for `install_headers`.
2020-12-10pkgconfig: Respect variable ordering when passed as listXavier Claessens1-1/+1
This fix a regression introduced in Meson 0.56.0 when using python 3.5. Also mention in documentation that using a meson dict does not guarantee ordering. Fixes: #8074.
2020-11-24compiler: allow non-built internal dependencies as argumentsPaolo Bonzini1-10/+13
Allow methods on the compiler object to receive internal dependencies, as long as they only specify compiler/linker arguments or other dependencies that satisfy the same requirements. This is useful if you're using internal dependencies to add special "-D" flags such as -DNCURSES_WIDECHAR, -D_XOPEN_SOURCE_EXTENDED or -DGLIB_STATIC_COMPILATION.
2020-11-22Merge pull request #8011 from dcbaker/submit/post-python36-cleanupsJussi Pakkanen1-1/+1
Python 3.6 cleanups
2020-11-21Handle cmake dependencies which require a specified versionJason Ekstrand1-0/+2
Some CMake packages fail to find at all if no version is specified. This commit adds a cmake_version parameter to dependency() to allow you to specify the requested version.
2020-11-20use real pathlib moduleDylan Baker1-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
2020-11-17add warning for projects with manually specified -WerrorEli Schwartz1-0/+3
Point people to the "werror" builtin option.
2020-11-13Do not warn when -Wpedantic is added as a project argument.Eli Schwartz1-1/+5
The only way to add it via warning_level is top opt in to -Wextra too. But this is often not really desirable, since -Wextra is not stable -- it changes its meaning every compiler release, thus mysteriously adding new warnings. Furthermore, it's not really the same kind of warning -- a pedantic warning is always correct that your code is wrong, but defines wrongness as "not per the portable standard". Unlike -Wextra it doesn't try to judge your code to see if you're doing something that is "often not what you meant", but is prone to false positives. Really, we need different *kinds* of warning levels, possibly as an array -- not just a monotonically increasing number. But since there's currently nothing flexible enough to specify -Wpedantic without -Wextra, we will just remove the warning for the former, and let people add it to their project arguments in peace.
2020-11-13The version kwarg must be a string. Closes #7975.Jussi Pakkanen1-0/+2
2020-11-12interpreter: Add get_keys function for configuration_data (#7887)Jones1-0/+5
2020-11-01interpreter: store correct files for project regenerationDylan Baker1-6/+18
Right now sub-sub projects are not correctly registered, because we don't have a way to pass up past the first level of subproject. This patch changes that by making the build_Def_files as defined in the Interpreter initializer accurate for translated dependencies, ie, cmake dependencies won't define a dependency on a non-existent meson.build. This means that it can always add the subi.build_def_files because they are always accurate.
2020-10-19interpreter: Add missing new feature flag for executable(win_subsystem)Dylan Baker1-1/+2
I noticed this when reviewing #7872
2020-10-19switch gui_app deprecation to FeatureDeprecatedKwargsPaolo Bonzini1-0/+1
The deprecation message for "gui_app" is appearing for every target rather than just once, and even if the required version is older than 0.56.0. Use @FeatureDeprecatedKwargs to fix both issues.