summaryrefslogtreecommitdiff
path: root/mesonbuild/mlog.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
* mtest: cleanup and fix print_statsPaolo Bonzini2020-11-181-1/+4
| | | | | | | Avoid calling self.collected_failures.append twice, and avoid inflated indentation by adding a "plain" decorator to mlog. Fixes: ba71fde18 ("mtest: collect failures regardless of colorized console", 2020-10-12)
* pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger2020-10-041-1/+1
|
* typing: Add run_mypy.py for easier mypy invocationDaniel Mensinger2020-09-081-1/+1
|
* Add a notice about Python 3.5 supportNirbheek Chauhan2020-09-021-2/+7
| | | | | | | | This will be printed in bold at the end of interactive meson sub-commands that won't be parsed by a program. Specifically: setup, compile, test, and install. NOTICE: You are using [...]
* Don't make unactionable warnings fatalNirbheek Chauhan2020-07-051-2/+2
| | | | | | | | | | | Some warnings are out of the user's control, such as the RCC QT bug, or the GNU windres bug, or our informational warning about auto-disabling of options when -Db_bitcode is enabled. Such warnings should not be fatal when --fatal-meson-warnings is passed because there's no action that the user can take to fix it. The only purpose it serves is to prevent people who use those features from using --fatal-meson-warnings.
* Make colourize_console() a functionJon Turney2020-04-301-6/+23
| | | | | | | | | | | | | | | | Currently, colourize_console is a constant, set at process initialization. To allow the actual stdout to be easily compared with the expected when running tests, we want to allow colourization to be on for the test driver, but not for the in-process configure done by run_configure, which has stdout redirected from a tty to a pipe. v2: Cache _colorize_console per file object v3: Reset cache on setup_console()
* switch python2 %s for python3 .formatMichael2020-04-211-1/+1
|
* Add property to disable compiler sanity checks during cross compilation.Jussi Pakkanen2020-03-221-1/+1
|
* fix conversion of hasattr to getattrDylan Baker2020-03-151-1/+1
| | | | | | getattr() requires a default (return if missing) value or it raises an AttributeError. In a few cases I changed hasattr to getattr and didn't set a default value, so those cases could except. This corrects that.
* mesonbuild/mesonlib: Add type annotationsDylan Baker2020-03-051-1/+1
|
* Merge pull request #6692 from xclaesse/summary-warningsJussi Pakkanen2020-03-011-0/+4
|\ | | | | Summary improvements
| * summary: Add more info in Subprojects sectionXavier Claessens2020-02-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | This adds a warnings counter for subprojects that passed. This is to encourage developpers to check warnings in the logs and hopefully fix them. Otherwise they could be hidden in hundreds lines of logs. This also print the error message for subprojects that did not pass. The error message is often enough to fix the issue (e.g. missing dependency) and it's easier than searching in the logs why a subproject failed.
* | Merge pull request #6627 from jon-turney/cwd-relative-file-locationsJussi Pakkanen2020-03-011-4/+12
|\ \ | | | | | | Consistently report file locations relative to cwd
| * | Rename 'subdir' -> 'filename' in location objectsJon Turney2020-02-281-2/+1
| | |
| * | Display filename cwd relative in warning locationJon Turney2020-02-281-2/+2
| | | | | | | | | | | | Format the filename relative to cwd in a warning location.
| * | Store filename in node locationJon Turney2020-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warnings have a location node object (with subdir and lineno attributes), which is passed as a location: kwarg to mlog.warning() and formatted in _log_error(). Re-purpose the subdir attribute (path relative to the source root dir, with an implied filename of 'meson.build'), which is stored into the node by parser(), to contain a pathname. (Properly I should rename 'subdir' -> 'file' everywhere, but that's a lot of churn just to see if this works) Notes: The warning location node may also have a colno attribute, which is currently ignored by _log_error(). We can't currently issue warnings with locations in meson_options.txt because the filename isn't part of the location (as it's assumed to be 'meson.build).
| * | Fix typos in comments about type annotationsJon Turney2020-02-281-2/+2
| | |
| * | Remove unused MesonException.get_msg_with_context()Jon Turney2020-02-281-1/+10
| |/ | | | | | | | | After that, the only remaining user of get_error_location_string() is mlog, so move that there.
* | mlog: fix remaining mypy errors and add to mypy checkDylan Baker2020-02-291-9/+9
|/ | | | | | | There were two things mypy was warning about: 1) it doesn't understand hasattr() 2) It was possible for mlog.{error,warning,deprecation} to get passed multiple values for the once keyword argument.
* Split console colourization into a separate functionNirbheek Chauhan2020-02-161-7/+9
| | | | Use it instead of making a direct call to mlog._windows_ansi().
* types: import typing as T (fixes #6333)Daniel Mensinger2020-01-081-39/+28
|
* mlog: Add a log_once functionDylan Baker2019-12-131-10/+38
| | | | | There are a number of cases where we end up spamming users with the same message over and over again, which is really annoying. This solves that.
* mlog: remove incorrect uses of global keywordDylan Baker2019-12-131-2/+0
| | | | | global is only needed to allow replacement of global values, they're always in scope to read.
* lgtm: Fix Module imported with `import` and `import from`Daniel Mensinger2019-12-051-3/+2
|
* ci: Add CI command to include text files in the CI logDaniel Mensinger2019-11-191-0/+10
|
* mlog: add non bold version of colorsDaniel Mensinger2019-11-141-0/+15
|
* Fix typos found by codespellWolfgang Stöggl2019-11-061-1/+1
| | | | - Typos were found by codespell v1.16.0
* Make parser errors print relative path to meson.build fileNiklas Claesson2019-10-101-1/+18
|
* pythonic file checksMichael Hirsch, Ph.D2019-07-111-4/+7
|
* Fix flake8-bugbear warningsDaniel Mensinger2019-04-291-20/+23
|
* Fix builtin variable namesDaniel Mensinger2019-04-291-5/+5
|
* mlog: add type annotationsDylan Baker2019-04-221-54/+70
|
* rewriter: Quiet logging by defaultDaniel Mensinger2019-03-041-5/+16
|
* do_subproject: Improve log messages and formattingXavier Claessens2019-01-161-4/+7
|
* Disable mlog and don't require build directory for environmentDaniel Mensinger2018-12-291-0/+12
|
* Add 'meson subprojects update' commandXavier Claessens2018-12-021-0/+3
| | | | This is inspired by gst-build's git-update script.
* Print dependencies being used for compiler checksNirbheek Chauhan2018-10-291-0/+2
| | | | | | | | | | | | | | | | | | | It is a common idiom to look for a function or a specific type or a header in various locations/libraries, and it can be confusing to see the (seemingly) identical compiler check being done multiple times. Now we print the dependencies being used when a compiler check is run Before: Checking for function "fbGetDisplay": NO Checking for type "GLeglImageOES": YES Checking for function "asinh": YES After: Checking for function "fbGetDisplay" with dependency egl: NO Checking for type "GLeglImageOES" with dependencies glesv2, gl: YES Checking for function "asinh" with dependency -lm: YES
* Add --fatal-meson-warnings command line optionXavier Claessens2018-09-041-2/+9
| | | | | | This makes any warning message printed by meson raise an exception, intended to be used by CI and developpers to easily catch deprecation warnings and other potential issues.
* mlog.shutdown(): Return the log file path or None if not initializedXavier Claessens2018-08-221-0/+3
|
* Print a more usable message when a subproject fails to configureNirbheek Chauhan2018-07-071-4/+4
| | | | | | | Instead of just printing the message in the exception, if it's a MesonException, also print the file and the line number. If it's an unknown exception, print the entire traceback so that we can pin-point what the Meson bug causing it is.
* Add new method: mlog.deprecation()Nirbheek Chauhan2018-07-071-0/+5
| | | | Instead of constructing it manually, use a helper.
* mlog: Log timestamps in profile-self modeNirbheek Chauhan2018-07-061-1/+12
| | | | | This makes it much clearer which statements are taking a long time, and helps in interpreting the outputted profile itself.
* mlog: Add built-in support for quoting bolded messagesNirbheek Chauhan2018-07-061-5/+9
| | | | | This allows us to drop wonky sep='' hacks and manual addition of spaces across the codebase.
* Add VT100 ANSI escape sequences for Windows 10.Isabella Muerte2018-05-011-1/+15
| | | | | | This change still relies on the older 'ANSICON' environment check as a fallback, in the event we're on "not Windows 10". (Calling `SetConsoleMode` with unsupported values results in a 0 being returned)
* interpreter: Verify permitted kwargs on all methodsXavier Claessens2018-04-261-3/+2
|
* Indicate subproject depth in console outputJon Turney2018-04-131-6/+23
|
* Refactor: Add log.error and log.exception to reduce code duplication.Jukka Laurila2018-03-101-5/+24
|
* Handle a warning location which evaluates to FalseJon Turney2018-02-211-1/+1
| | | | | | | | | | | | | | As written in PR #2856, this code isn't quite right. An ArgumentNode object can evaluate as False (if it's arguments attribute is an empty sequence). If that happens, we then try to hand the location kwarg down to print(), rather than removing it, which causes an invalid keyword argument exception. This failure can be seen e.g. when generating for gnome-twitch (See [1]) [1] https://travis-ci.org/jon-turney/meson-corpus-test/jobs/343017109
* Report warning/error locations in a format IDEs may already know how to parseJon Turney2018-01-301-2/+5
| | | | | | | | | | | | | | | Examples: meson.build:2:0: ERROR: Dependency is both required and not-found meson.build:4: WARNING: Keyword argument "link_with" defined multiple times. These are already matched by the default compilation-error-regexp-alist in emacs. Also: Don't start 'red' markup until after the \n before an error Unabsorb full-stop at end of warning with location from mlog.warning() Update warning_location test