aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mlog.py
AgeCommit message (Collapse)AuthorFilesLines
2020-09-02Add a notice about Python 3.5 supportNirbheek Chauhan1-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 [...]
2020-07-05Don't make unactionable warnings fatalNirbheek Chauhan1-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.
2020-04-30Make colourize_console() a functionJon Turney1-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()
2020-04-21switch python2 %s for python3 .formatMichael1-1/+1
2020-03-22Add property to disable compiler sanity checks during cross compilation.Jussi Pakkanen1-1/+1
2020-03-15fix conversion of hasattr to getattrDylan Baker1-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.
2020-03-05mesonbuild/mesonlib: Add type annotationsDylan Baker1-1/+1
2020-03-01Merge pull request #6692 from xclaesse/summary-warningsJussi Pakkanen1-0/+4
Summary improvements
2020-03-01Merge pull request #6627 from jon-turney/cwd-relative-file-locationsJussi Pakkanen1-4/+12
Consistently report file locations relative to cwd
2020-02-29mlog: fix remaining mypy errors and add to mypy checkDylan Baker1-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.
2020-02-28Rename 'subdir' -> 'filename' in location objectsJon Turney1-2/+1
2020-02-28Display filename cwd relative in warning locationJon Turney1-2/+2
Format the filename relative to cwd in a warning location.
2020-02-28Store filename in node locationJon Turney1-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).
2020-02-28Fix typos in comments about type annotationsJon Turney1-2/+2
2020-02-28Remove unused MesonException.get_msg_with_context()Jon Turney1-1/+10
After that, the only remaining user of get_error_location_string() is mlog, so move that there.
2020-02-26summary: Add more info in Subprojects sectionXavier Claessens1-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.
2020-02-16Split console colourization into a separate functionNirbheek Chauhan1-7/+9
Use it instead of making a direct call to mlog._windows_ansi().
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-39/+28
2019-12-13mlog: Add a log_once functionDylan Baker1-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.
2019-12-13mlog: remove incorrect uses of global keywordDylan Baker1-2/+0
global is only needed to allow replacement of global values, they're always in scope to read.
2019-12-05lgtm: Fix Module imported with `import` and `import from`Daniel Mensinger1-3/+2
2019-11-19ci: Add CI command to include text files in the CI logDaniel Mensinger1-0/+10
2019-11-14mlog: add non bold version of colorsDaniel Mensinger1-0/+15
2019-11-06Fix typos found by codespellWolfgang Stöggl1-1/+1
- Typos were found by codespell v1.16.0
2019-10-10Make parser errors print relative path to meson.build fileNiklas Claesson1-1/+18
2019-07-11pythonic file checksMichael Hirsch, Ph.D1-4/+7
2019-04-29Fix flake8-bugbear warningsDaniel Mensinger1-20/+23
2019-04-29Fix builtin variable namesDaniel Mensinger1-5/+5
2019-04-22mlog: add type annotationsDylan Baker1-54/+70
2019-03-04rewriter: Quiet logging by defaultDaniel Mensinger1-5/+16
2019-01-16do_subproject: Improve log messages and formattingXavier Claessens1-4/+7
2018-12-29Disable mlog and don't require build directory for environmentDaniel Mensinger1-0/+12
2018-12-02Add 'meson subprojects update' commandXavier Claessens1-0/+3
This is inspired by gst-build's git-update script.
2018-10-29Print dependencies being used for compiler checksNirbheek Chauhan1-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
2018-09-04Add --fatal-meson-warnings command line optionXavier Claessens1-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.
2018-08-22mlog.shutdown(): Return the log file path or None if not initializedXavier Claessens1-0/+3
2018-07-07Print a more usable message when a subproject fails to configureNirbheek Chauhan1-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.
2018-07-07Add new method: mlog.deprecation()Nirbheek Chauhan1-0/+5
Instead of constructing it manually, use a helper.
2018-07-06mlog: Log timestamps in profile-self modeNirbheek Chauhan1-1/+12
This makes it much clearer which statements are taking a long time, and helps in interpreting the outputted profile itself.
2018-07-06mlog: Add built-in support for quoting bolded messagesNirbheek Chauhan1-5/+9
This allows us to drop wonky sep='' hacks and manual addition of spaces across the codebase.
2018-05-01Add VT100 ANSI escape sequences for Windows 10.Isabella Muerte1-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)
2018-04-26interpreter: Verify permitted kwargs on all methodsXavier Claessens1-3/+2
2018-04-13Indicate subproject depth in console outputJon Turney1-6/+23
2018-03-10Refactor: Add log.error and log.exception to reduce code duplication.Jukka Laurila1-5/+24
2018-02-21Handle a warning location which evaluates to FalseJon Turney1-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
2018-01-30Report warning/error locations in a format IDEs may already know how to parseJon Turney1-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
2018-01-01Consolidate warning location formatting in mlog.warning()Jon Turney1-0/+7
Also use .format() rather than % Also use build.environment rather than hardcoding 'meson.build'
2017-11-29Enable ANSI colors on Windows when ANSICON is setJoergen Ibsen1-2/+4
This enables colors with ConEmu.
2017-09-14logging: Print location of log file on errorNirbheek Chauhan1-1/+2
Similar to configure Closes https://github.com/mesonbuild/meson/issues/2316
2017-08-18Ensure log file gets closed.Jussi Pakkanen1-1/+3