aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2021-01-15mtest: simplify complete_exitcodePaolo Bonzini1-8/+5
There is no need anymore to pass the JUnit XML down to complete_exitcode. Just set self.junit in complete_gtest instead.
2021-01-15mtest: store the environment in the TestRunPaolo Bonzini1-1/+1
The test_env was lost from the TestRun object in commit 30741a0f2 ("mtest: create TestRun object early on"). Fix things.
2021-01-15mtest: do not print time out message twicePaolo Bonzini1-2/+0
Rebase mistake in "mtest: move timeout message to ConsoleLogger".
2021-01-14mtest: allow quickly interrupting the test runPaolo Bonzini1-5/+17
The new behavior of interrupting the longest running test with Ctrl-C is useful when tests hang, but not when the run is completely broken for some reason. Psychology tells us that the user will compulsively spam Ctrl-C in this case, so exit if three Ctrl-C's are detected within a second.
2021-01-14mtest: fix flake8Paolo Bonzini1-2/+2
2021-01-14coredata: Add missing nopromote wrap_mode choiceXavier Claessens1-1/+1
2021-01-14Merge pull request #8192 from dcbaker/submit/minstall-type-annotationsJussi Pakkanen9-160/+236
Add type annotations to minstall (and some related cleanups)
2021-01-13minstall: Fix signature of monkeypatched os.chownDylan Baker1-3/+12
this also clears up the last of the mypy problems in minstall, yay!
2021-01-13minstall: Pass destdir and fullprefix instead of adding them to instanceDylan Baker1-25/+25
Same idea as the last patch, just different data
2021-01-13minstall: Pass DirMaker separately instead of adding to instanceDylan Baker1-24/+23
Add a new attribute to an object outside of the initializer of construtor is considered an antipattern for good reason, it's gross, it's confusing, and it often leads to AttributeErrors down some paths. Let's not do that.
2021-01-13minstall: Add type annotationsDylan Baker1-31/+64
This adds annotations and fixes a couple of issues (passing Set[bytes] where List[byte] is expected), however, there's some very gross addition of attributes to types going on that I haven't fixed yet, and mypy is very grump about.
2021-01-13backends/backends: Add type annotations for InstallDataDylan Baker1-27/+36
This adds enough type annotations for InstallData and friends to make minstall happy. There is also a small change in that I've replaced the List[List] with List[Tuple], as tuples are more appropraite data types for the information (fixed length, position matters, different types at different indexes)
2021-01-13build/interpreter: Split InstallDir to fix layering violationDylan Baker3-32/+43
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: Add some type annotationsDylan Baker2-12/+20
2021-01-13build/interperter: Add annotations and move input validation to interpreterDylan Baker5-17/+20
This moves the user input validation to the interpreter, instead of being in the build module, and adds type annotations.
2021-01-13minstall: fix importsDylan Baker1-6/+10
This uses PEP8 style, one per from `import mod`, but with commas from `from mod import a, b`. Also run sort, for niceness.
2021-01-13scripts/depfixer: make rpaths_dirs_to_remove a setDylan Baker1-4/+4
It's only used for doing an `if x in container` check, which will be faster with a set, and the only caller already has a set, so avoid we can avoid a type conversion as well.
2021-01-13Fix misspellsAntonin Décimo21-34/+34
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-13gen_data.py: even more sortingEli Schwartz1-96/+96
glob.glob() is not sorted, despite using shell-style wildcards, and the documentation does not mention this: https://bugs.python.org/issue21748 Recently, it does start mentioning "Whether or not the results are sorted depends on the file system." which does not really get to the heart of the matter... This is causing fuzz too.
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-12gen_data.py: sort files when generating mesondataEli Schwartz1-111/+111
The current way this works is chaos since the tool might return files in any order and thus shuffle around the order of embedded files. This results in big diffs that cannot be easily reviewed. Also regenerate the data according to the, going forward, canonical ordering algorithm.
2021-01-12dependencies: use env.machines for is_$os methodsDylan Baker1-7/+7
Currently we use the mesonlib ones, but these are always the build machine definitions, rather than being available for either the build or host machine. We already have an `Environment` instance, and the correct `MachineChoice`, so lets use that. Fixes #8165
2021-01-12Allow '//' as project function id due to git bash path conversion.Luke Elliott1-2/+6
See https://stackoverflow.com/questions/54258996/git-bash-string-parameter-with-at-start-is-being-expanded-to-a-file-path
2021-01-12Merge pull request #8159 from dcbaker/submit/all-env-variables-up-frontJussi Pakkanen15-334/+246
Read and store all environment variables up front
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-11make some Environment methods protectedDylan Baker1-5/+5
they're really not public methods, they'r only meant to be called from the initializer. Let's mark them as such.
2021-01-11clean up get_env_var_pairDylan Baker1-14/+8
This function returns both the name and the value, but we never actually use the name, just the value. Also make this module private. We really want to keep all environment variable reading in the Environment class so it's done once up front. This should help with that goal.
2021-01-11move get_env_var_pair to environmentDylan Baker2-38/+32
This is only used in environment, so it should live there too.
2021-01-11boost: default machine file properties to env var valuesDylan Baker3-58/+36
This both moves the env reading to configuration time, which is useful, and also simplifies the implementation of the boost dependency. The simplification comes from being able to delete basically duplicated code since the values will be in the Properties if they exist at all.
2021-01-11Move BinaryTable environment lookups to EnvironmentDylan Baker2-48/+41
This means that all the env lookups are done once, at initial configure time. This has all of the expected advantages.
2021-01-11pull env to program mappings out of BinaryType classDylan Baker1-45/+45
These really aren't pivotal to that class, and they're used outside of it. In a follow up patch they're not going to be used inside it at all.
2021-01-11move handling of CFLAGS and friends to environmentDylan Baker6-111/+72
This has a bunch of nice features. It obviously centralizes everything, which is nice. It also means that env is only re-read at `meson --wipe`, not `meson --reconfigure`. And it's going to allow more cleanups.
2021-01-11use PEP8 style naming for LANGUAGES_USING_* as wellDylan Baker3-7/+7
2021-01-11rename cflags_mapping to CFLAGS_MAPPINGDylan Baker2-18/+22
This is PEP8 convention for a const variable. Also, make the type Mapping, which doesn't have mutation methods. This means mypy will warn us if someone tries to change this.
2021-01-11dependencies: Don't read PKG_CONFIG_PATH from the env againDylan Baker1-10/+2
We already read this in, don't read it again. Just rely on the value we have stored.
2021-01-11move CMAKE_PREFIX_PATH env var handling to environmentDylan Baker2-24/+20
This causes the variable to be read up front and stored, rather than be re-read on each invocation of meson. This does have two slight behavioral changes. First is the obvious one that changing the variable between `meson --reconfigure` invocations has no effect. This is the way PKG_CONFIG_PATH already works. The second change is that CMAKE_PREFIX_PATH the env var is no longer appended to the values set in the machine file or on the command line, and is instead replaced by them. CMAKE_PREFIX_PATH is the only env var in meson that works this way, every other one is replaced not appended, so while this is a behavioral change, I also think its a bug fix.
2021-01-11dependencies/mpi: Add a type annotationDylan Baker1-1/+1
Some change in this series causes mypy to notice that this isn't annotated, and it makes a wrong assumption.
2021-01-11import MachineChoice from mesonlibDylan Baker2-2/+2
there are a couple of places importing it from envconfig, which is not correct. It's defined in mesonlib, and then imported into envconfig.
2021-01-10cmake: add PATH logic to preliminary dep check (fixes #8133)Daniel Mensinger1-2/+16
2021-01-07mtest: print TAP subtest countPaolo Bonzini1-2/+15
The parentheses look ugly in the progress report. To keep it aligned with the test outcomes, remove them from the outcomes as well.
2021-01-07mtest: print time that the test has been runningPaolo Bonzini1-4/+18
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-07mtest: align decimal point of test durationsPaolo Bonzini1-2/+9
2021-01-07mtest: create runners in advancePaolo Bonzini1-17/+24
Compute all options in advance so that we can compute the maximum timeout.
2021-01-07mtest: move timeout message to ConsoleLoggerPaolo Bonzini1-0/+4
This adds a point where to call the progress report flush() method. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-07mtest: store timeout in TestRunPaolo Bonzini1-13/+13
This will be useful when printing the progress report. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-07mtest: add more formatting options to TestHarness.formatPaolo Bonzini1-15/+34
Allow leaving extra space in the left column, as well as customizing parts of the printed line. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-07mtest: align correctly tests with wide Unicode charactersPaolo Bonzini1-3/+13
This correctly formats tests with CJK names or, well, emoji. It is not perfect (for example it does not correctly format emoji that are variations of 1-wide characters), but it is as good as most terminal emulators. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-07mtest: make test output parsing asynchronousPaolo Bonzini1-22/+34
Instead of slurping in the entire stream, build the TestResult along the way. This allows reporting the results of TAP and Rust subtests as they come in, either as part of the progress report or (in the future) as individual lines of the output.
2021-01-07mtest: move Rust parsing inside TestRunPaolo Bonzini1-41/+40
Make the code look like the TAP parser. This simplifies the introduction of asynchronous parsing.
2021-01-07mtest: read test stdout/stderr via asyncio pipesPaolo Bonzini1-21/+29
Instead of creating temporary files, get the StreamReaders from _run_subprocess's returned object. Through asyncio magic, their contents will be read as it becomes ready and then returned when the StreamReader.read future is awaited. Because of this change, the stdout and stderr can be easily preserved when TestSubprocess returns an additional_error. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>